devel/framework/configfile.cpp
/**
	returns true and option and value and comment if option and value found
    returns false otherwise ( comment in comment if found )
*/
returns true and option and value and comment if option and value found
returns false otherwise ( comment in comment if found )
returns true and option and value and comment if option and value found returns false otherwise ( comment in comment if found )
bool CConfigFile::extractOptionValue( std::string line, std::string& option, std::string& value, std::string& comment ) {
	std::size_t pos;
	pos=line.find_first_of( ';' );   
	if( pos != std::string::npos ) {
		comment=line.substr( pos, line.size() );
		line.erase( pos );
		trim( line );
	}
	if( !line.empty() ) {
		pos=line.find_first_of( '=' );
		if( pos == std::string::npos ) return( false ); 
		option=line.substr( 0, pos );
		value=line.substr( pos+1, line.size() );
		trim( option );
		trim( value );
	}
	else return( false );
	return( true );
}
bool CConfigFile :: extractOptionValue ( std :: string line , std :: string & option , std :: string & value , std :: string & comment ) { std :: size_t pos ; pos = line . find_first_of ( ' ' ) ; if ( pos != std :: string :: npos ) { comment = line . substr ( pos , line . size ( ) ) ; line . erase ( pos ) ; trim ( line ) ; } if ( ! line . empty ( ) ) { pos = line . find_first_of ( ' ' ) ; if ( pos == std :: string :: npos ) return ( false ) ; option = line . substr ( 0 , pos ) ; value = line . substr ( pos + 1 , line . size ( ) ) ; trim ( option ) ; trim ( value ) ; } else return ( false ) ; return ( true ) ; }
returns true and option and value and comment if option and value found
returns false otherwise ( comment in comment if found )
returns true and option and value and comment if option and value found returns false otherwise ( comment in comment if found )
// manage comments // ignore lines with no '='