bool Configuration::GetConfigBlockLine(ifstream& file, string& key, string& value) { string line; // end of file while( !file.eof() ) { // read line from config file getline( file, line ); TrimString( line ); // end of object's data if( line.compare( "#end" ) == 0 ) return false; size_t p = line.find( '=' ); if( p != string.npos ) { // key key = line.substr( 0, p ); TrimString( key ); // value value = line.substr( p + 1, line.length() ); TrimString( value ); // key - value pair read successfully return true; } } // error return false; }
c:\users\zahrina\documents\visual studio 2012\projects\gaschedule\gaschedule\algorithm\configuration.cpp(272): error C2275: 'std::string' : illegal use of this type as an expression c:\program files\microsoft visual studio 11.0\vc\include\xstring(2300) : see declaration of 'std::string' c:\users\zahrina\documents\visual studio 2012\projects\gaschedule\gaschedule\algorithm\configuration.cpp(272): error C2228: left of '.npos' must have class/struct/union
string.npos
string::npos
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)