![]() |
Plasma Engine
2.0
|
This object caches files in a tokenized state. It can be shared among plPreprocessor instances to improve performance when they access the same files. More...
#include <Preprocessor.h>
Classes | |
struct | FileData |
Public Member Functions | |
plMap< plString, FileData >::ConstIterator | Lookup (const plString &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 plString &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 plTokenizer * | Tokenize (const plString &sFileName, plArrayPtr< const plUInt8 > fileContent, const plTimestamp &fileTimeStamp, plLogInterface *pLog) |
Stores FileContent for the file sFileName as the new cached data. | |
This object caches files in a tokenized state. It can be shared among plPreprocessor instances to improve performance when they access the same files.
const plTokenizer * plTokenizedFileCache::Tokenize | ( | const plString & | sFileName, |
plArrayPtr< const plUInt8 > | fileContent, | ||
const plTimestamp & | fileTimeStamp, | ||
plLogInterface * | 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.