"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/Plugins/Pdf/PDFWriter/PDFParserTokenizer.cpp" between
TeXmacs-1.99.4-src.tar.gz and TeXmacs-1.99.5-src.tar.gz

About: GNU TeXmacs is a what-you-see-is-what-you-get scientific text editor, which was both inspired by TeX and GNU Emacs.

PDFParserTokenizer.cpp  (TeXmacs-1.99.4-src):PDFParserTokenizer.cpp  (TeXmacs-1.99.5-src)
skipping to change at line 49 skipping to change at line 49
ResetReadState(); ResetReadState();
} }
void PDFParserTokenizer::ResetReadState() void PDFParserTokenizer::ResetReadState()
{ {
mHasTokenBuffer = false; mHasTokenBuffer = false;
mStreamPositionTracker = 0; mStreamPositionTracker = 0;
mRecentTokenPosition = 0; mRecentTokenPosition = 0;
} }
void PDFParserTokenizer::ResetReadState(const PDFParserTokenizer& inExternalToke
nizer)
{
mTokenBuffer = inExternalTokenizer.mTokenBuffer;
mHasTokenBuffer = inExternalTokenizer.mHasTokenBuffer;
mStreamPositionTracker = inExternalTokenizer.mStreamPositionTracker;
mRecentTokenPosition = inExternalTokenizer.mRecentTokenPosition;
}
static const Byte scBackSlash[] = {'\\'}; static const Byte scBackSlash[] = {'\\'};
static const std::string scStream = "stream"; static const std::string scStream = "stream";
static const char scCR = '\r'; static const char scCR = '\r';
static const char scLF = '\n'; static const char scLF = '\n';
BoolAndString PDFParserTokenizer::GetNextToken() BoolAndString PDFParserTokenizer::GetNextToken()
{ {
BoolAndString result; BoolAndString result;
Byte buffer; Byte buffer;
OutputStringBufferStream tokenBuffer; OutputStringBufferStream tokenBuffer;
skipping to change at line 355 skipping to change at line 363
return isWhiteSpace; return isWhiteSpace;
} }
void PDFParserTokenizer::SaveTokenBuffer(Byte inToSave) void PDFParserTokenizer::SaveTokenBuffer(Byte inToSave)
{ {
mHasTokenBuffer = true; mHasTokenBuffer = true;
mTokenBuffer = inToSave; mTokenBuffer = inToSave;
--mStreamPositionTracker; // decreasing position trakcer, because it is a s if the byte is put back in the stream --mStreamPositionTracker; // decreasing position trakcer, because it is a s if the byte is put back in the stream
} }
IOBasicTypes::LongFilePositionType PDFParserTokenizer::GetReadBufferSize()
{
return mHasTokenBuffer ? 1 : 0;
}
static const Byte scEntityBreakers[] = {'(',')','<','>',']','[','{','}','/','%'} ; static const Byte scEntityBreakers[] = {'(',')','<','>',']','[','{','}','/','%'} ;
bool PDFParserTokenizer::IsPDFEntityBreaker(Byte inCharacter) bool PDFParserTokenizer::IsPDFEntityBreaker(Byte inCharacter)
{ {
bool isEntityBreak = false; bool isEntityBreak = false;
for(int i=0; i < 10 && !isEntityBreak; ++i) for(int i=0; i < 10 && !isEntityBreak; ++i)
isEntityBreak = (scEntityBreakers[i] == inCharacter); isEntityBreak = (scEntityBreakers[i] == inCharacter);
return isEntityBreak; return isEntityBreak;
} }
LongFilePositionType PDFParserTokenizer::GetRecentTokenPosition() LongFilePositionType PDFParserTokenizer::GetRecentTokenPosition()
 End of changes. 2 change blocks. 
0 lines changed or deleted 14 lines changed or added

Home  |  About  |  All  |  Newest  |  Fossies Dox  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTPS