ezEngine  Milestone 7
ezTokenizedFileCache Class Reference

This object caches files in a tokenized state. It can be shared among ezPreprocessor instances to improve performance when they access the same files. More...

#include <Preprocessor.h>

Classes

struct  FileData
 

Public Member Functions

ezMap< ezString, FileData >
::ConstIterator 
Lookup (const ezString &sFileName) const
 Checks whether sFileName is already in the cache, returns an iterator to it. If the iterator is invalid, the file is not cached yet.
 
void Remove (const ezString &sFileName)
 Removes the cached content for sFileName from the cache. Should be used when the file content has changed and needs to be re-read.
 
void Clear ()
 Removes all files from the cache to ensure that they will be re-read.
 
const ezTokenizerTokenize (const ezString &sFileName, const ezDynamicArray< ezUInt8 > &FileContent, const ezTimestamp &FileTimeStamp, ezLogInterface *pLog)
 Stores FileContent for the file sFileName as the new cached data. More...
 

Private Member Functions

void SkipWhitespace (ezDeque< ezToken > &Tokens, ezUInt32 &uiCurToken)
 

Private Attributes

ezMutex m_Mutex
 
ezMap< ezString, FileDatam_Cache
 

Detailed Description

This object caches files in a tokenized state. It can be shared among ezPreprocessor instances to improve performance when they access the same files.


Class Documentation

struct ezTokenizedFileCache::FileData
Class Members
ezTimestamp m_Timestamp
ezTokenizer m_Tokens

Member Function Documentation

const ezTokenizer * ezTokenizedFileCache::Tokenize ( const ezString sFileName,
const ezDynamicArray< ezUInt8 > &  FileContent,
const ezTimestamp FileTimeStamp,
ezLogInterface pLog 
)

Stores FileContent for the file sFileName as the new cached data.

The file content is tokenized first and all #line directives are evaluated, to update the line number and file origin for each token. Any errors are written to the given log.


The documentation for this class was generated from the following files: