Пример #1
0
std::ostream& ConfigFile::DebugPrint( std::ostream& pOut )
{
    ConfigSection*                          section = NULL;
    Map<String,ConfigSection*>::iterator    itMap;

    for( itMap = mSections.begin(); itMap != mSections.end(); itMap++ )
    {
        section = (*itMap).second;

        pOut << "[" << (*itMap).first.c_str() << "]" << std::endl;
        section->Save( pOut );
        pOut << std::endl;
    }

    return pOut;
}
Пример #2
0
void ConfigFile::Save()
{
    std::ofstream   outFile( mFileName.c_str() );

    if( outFile.fail() )
    {
        outFile.close();
        throw FileNotFoundException( mFileName, Here );
    }

    ConfigSection*                          section = NULL;
    Map<String,ConfigSection*>::iterator    itMap;

    for( itMap = mSections.begin(); itMap != mSections.end(); itMap++ )
    {
        section = (*itMap).second;

        outFile << "[" << (*itMap).first.c_str() << "]" << std::endl;
        section->Save( outFile );
        outFile << std::endl;
    }

    outFile.close();
}