Overview
Features
Download
Documentation
Community
Add-Ons & Services

IniFileConfiguration Class

Please post support and help requests here.

IniFileConfiguration Class

Postby batori » 13 Dec 2007, 17:07

Hi,

I'm having a little problem with IniFileConfiguration Class, when using setString from AbstractConfiguration.

From my class, the following code works without problem:

From header file:
string File = "/etc/my.config";
AutoPtr< IniFileConfiguration > _ifc;

construction {
_ifc = new IniFileConfiguration;

try {
_ifc->load( File );
} catch( FileNotFoundException &fnte ) {
std::cerr << "File Not Found: " << File << std::endl;
} catch( FileAccessDeniedException &fade ) {
std::cerr << "No access or permission: " << File << std::endl;
}
}

bool getKey( const string Section, const string Key, string Ret ) {
try {
Ret = _ifc->getString( Section + "." + Key );
} catch( NotFoundException &nfe ) {
std::cerr << "Could not load " << Key << " in section " << Section << std::endl;
return false;
}
}



But the following function from same class works with a problem:

bool setKey( const string Section, const string Key, string Value ) {
try {
_ifc->setString( Section + "." + Key, Value );
} catch( Exception& e ) {
std::cerr << "Error: " << e.what() << "
Could not set " << Value << " in section " << Section << "." << Key << std::endl;
return false;
}

return true;
}

The return is:
Error: Not implemented
Could not set Value in section Sectio.Key


What means the return, Not Implemented? Did I compile without something?

My Poco version is: poco-1.3.1-ssl.tar.bz2

Any Idea?

Thanks.
batori
 
Posts: 4
Joined: 12 Dec 2007, 21:18

Re: IniFileConfiguration Class

Postby alex » 13 Dec 2007, 18:09

> What means the return, Not Implemented? Did I compile without something?

Well, it means exactly what it says - it is not implemented. We've had a discussion about the same thing for XML configuration recently.

Contributions are welcome.

Alex
alex
 
Posts: 1122
Joined: 11 Jul 2006, 16:27
Location: United_States


Return to Support

Who is online

Users browsing this forum: No registered users and 4 guests

cron