Ignore:
Timestamp:
May 2, 2008, 2:56:06 PM (16 years ago)
Author:
dai_9181
Message:

SourceTemplateクラスをLexicalAnalyzerクラスのインナークラスにした

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ab5.0/abdev/BasicCompiler_Common/src/Source.cpp

    r523 r531  
    10231023    return 1;
    10241024}
    1025 
    1026 
    1027 SourceTemplate::SourceTemplate( const std::string &filePath )
    1028 {
    1029     Jenga::Common::File file = Jenga::Common::File( GetApplicationBaseFullPath( filePath ) );
    1030     source = file.Read();
    1031 }
    1032 std::string SourceTemplate::GetResult( const std::map<std::string,std::string> &values )
    1033 {
    1034     std::string result = source;
    1035 
    1036     std::map<std::string,std::string>::const_iterator it = values.begin();
    1037     while( it != values.end() )
    1038     {
    1039         while( true )
    1040         {
    1041             std::string::size_type index = result.find( it->first );
    1042             if( index == std::string::npos )
    1043             {
    1044                 break;
    1045             }
    1046 
    1047             result = result.substr( 0, index ) + it->second + result.substr( index + it->first.length() );
    1048         }
    1049         it++;
    1050     }
    1051 
    1052     return result;
    1053 }
Note: See TracChangeset for help on using the changeset viewer.