Overview
Features
Download
Documentation
Community
Add-Ons & Services

application.configDir

Please post support and help requests here.
hdetter
Posts: 6
Joined: 22 Apr 2008, 09:03
Location: Other

application.configDir

Postby hdetter » 24 Apr 2008, 08:50

Hello,

I'm trying the following:

Code: Select all


void initialize(Application& self)
{
std::string newConfig = config().getString("application.dir");
newConfig+="../";
newConfig+=config().getString("application.name");
newConfig+=".properties";
      
std::cout << "NewConfig: " << newConfig << std::endl;
loadConfiguration(newConfig); // load configuration file, if present
std::cout << "application.configDir: " << config().getString("application.configDir") << std::endl;
   
ServerApplication::initialize(self);
}


According to the docu of class Application I would not expect the following output:

Code: Select all


newConfig: /home/ce/eclipse-workspace/daqenginesrv/Debug/../daqenginesrv.properties
application.configDir: /home/ce/eclipse-workspace/daqenginesrv/Debug/

However I would expect, that newConfig==application.configDir

Do I misunderstand the docu or do I something wrong here?

Thanks

Hans

guenter
Posts: 1170
Joined: 11 Jul 2006, 16:27
Location: Austria

Re: application.configDir

Postby guenter » 25 Apr 2008, 11:06

application.configDir is set to the directory containing the application executable by default. When you call loadConfiguration() (without a path argument), then application.configDir is set to the directory where the configuration file has been found. If no config file has been found, application.configDir remains unchanged (and thus still points to the executable directory). loadConfiguration() with a path argument does not change the application.configDir property.


Return to “Support”

Who is online

Users browsing this forum: No registered users and 3 guests