inline bool CTextFileScanner::ScanSentence( std::string& strTag, std::string& text ) { std::string line_buffer = this->GetCurrentLine(); size_t pos = GetTagString().length(); while( pos < line_buffer.length() ) { if( line_buffer[pos] != '\t' && line_buffer[pos] != ' ' ) break; pos++; } for( ; pos < line_buffer.length(); pos++ ) { if( line_buffer.substr(pos,2) == "\\n" ) { text.push_back( '\n' ); pos++; } else text.push_back( line_buffer[pos] ); } return true; /* if( pos < line_buffer.length() ) { text = line_buffer.substr( pos, line_buffer.length() - pos ); return true; } else return true;*/ }
/******************************************************************************************** > INT32 HTMLExportFilter::WriteTag(UINT32 uiResource, CCLexFile* pfileToWrite=NULL, TCHAR* pcBuffer=NULL) Author: Graham_Walmsley (Xara Group Ltd) <*****@*****.**> Created: 9/4/97 Inputs: uiResource The resource to write pfileToWrite The file to write to (may be NULL) pcBuffer The text buffer to write to (may be NULL) Returns: The number of TCHARs written Purpose: Writes out the specified UI resource enclosed by < and >. ********************************************************************************************/ INT32 HTMLExportFilter::WriteTag(UINT32 uiResource, CCLexFile* pfileToWrite, TCHAR* pcBuffer) { //Get our tag string String_256 strToWrite=GetTagString(uiResource); //Then call our sister function to write out the string return Write(strToWrite, pfileToWrite, pcBuffer); }
inline bool CTextFileScanner::FindLineWithTag( const std::string& tag ) { if( !m_fp ) return false; // reset the file pointer // TDOO: check 2nd & 3rd arguments fseek( m_fp, 0, SEEK_SET ); // load the first line fgets( m_acCurrentLine, MAX_LINE_LENGTH - 1, m_fp ); UpdateTagStr(); for( ; !End(); NextLine() ) { if( GetTagString() == tag ) return true; } return false; }