GH #134: Fixed problem in Util::Application with xml or inifile no config

GH #134: Fixed problem in Util::Application with xml or inifile no
config
This commit is contained in:
Aleksandar Fabijanic
2013-03-24 00:18:35 -05:00
parent 3abf1cc73c
commit 4c593dba7a
7 changed files with 42 additions and 20 deletions

View File

@@ -41,6 +41,11 @@
#include "Poco/Util/Util.h" #include "Poco/Util/Util.h"
#ifndef POCO_UTIL_NO_INIFILECONFIGURATION
#include "Poco/Util/AbstractConfiguration.h" #include "Poco/Util/AbstractConfiguration.h"
#include <map> #include <map>
#include <istream> #include <istream>
@@ -110,4 +115,7 @@ private:
} } // namespace Poco::Util } } // namespace Poco::Util
#endif // POCO_UTIL_NO_INIFILECONFIGURATION
#endif // Util_IniFileConfiguration_INCLUDED #endif // Util_IniFileConfiguration_INCLUDED

View File

@@ -36,15 +36,16 @@
// //
// Avoid accidental linking of JSON library when JSONConfiguration
// is not desired.
#ifndef POCO_UTIL_NO_JSONCONFIGURATION
#ifndef Util_JSONConfiguration_INCLUDED #ifndef Util_JSONConfiguration_INCLUDED
#define Util_JSONConfiguration_INCLUDED #define Util_JSONConfiguration_INCLUDED
#include "Poco/Util/Util.h"
#ifndef POCO_UTIL_NO_JSONCONFIGURATION
#include "Poco/Util/AbstractConfiguration.h" #include "Poco/Util/AbstractConfiguration.h"
#include "Poco/JSON/Object.h" #include "Poco/JSON/Object.h"
#include <istream> #include <istream>
@@ -164,6 +165,8 @@ private:
} } // namespace Poco::Util } } // namespace Poco::Util
#endif // POCO_UTIL_NO_JSONCONFIGURATION
#endif // Util_JSONConfiguration_INCLUDED #endif // Util_JSONConfiguration_INCLUDED
#endif // POCO_UTIL_NO_JSONCONFIGURATION

View File

@@ -36,16 +36,16 @@
// //
// Avoid accidental linking of XML library when XMLConfiguration
// is not desired.
#ifndef POCO_UTIL_NO_XMLCONFIGURATION
#ifndef Util_XMLConfiguration_INCLUDED #ifndef Util_XMLConfiguration_INCLUDED
#define Util_XMLConfiguration_INCLUDED #define Util_XMLConfiguration_INCLUDED
#include "Poco/Util/Util.h" #include "Poco/Util/Util.h"
#ifndef POCO_UTIL_NO_XMLCONFIGURATION
#include "Poco/Util/MapConfiguration.h" #include "Poco/Util/MapConfiguration.h"
#include "Poco/DOM/Document.h" #include "Poco/DOM/Document.h"
#include "Poco/DOM/AutoPtr.h" #include "Poco/DOM/AutoPtr.h"
@@ -219,6 +219,7 @@ private:
} } // namespace Poco::Util } } // namespace Poco::Util
#endif // Util_XMLConfiguration_INCLUDED
#endif // POCO_UTIL_NO_XMLCONFIGURATION #endif // POCO_UTIL_NO_XMLCONFIGURATION
#endif // Util_XMLConfiguration_INCLUDED

View File

@@ -284,7 +284,7 @@ void Application::loadConfiguration(const std::string& path, int priority)
else if (icompare(ext, "ini") == 0) else if (icompare(ext, "ini") == 0)
_pConfig->add(new IniFileConfiguration(confPath.toString()), priority, false, false); _pConfig->add(new IniFileConfiguration(confPath.toString()), priority, false, false);
#endif #endif
#ifndef POCO_UTIL_NO_JSONONFIGURATION #ifndef POCO_UTIL_NO_JSONCONFIGURATION
else if (icompare(ext, "json") == 0) else if (icompare(ext, "json") == 0)
_pConfig->add(new JSONConfiguration(confPath.toString()), priority, false, false); _pConfig->add(new JSONConfiguration(confPath.toString()), priority, false, false);
#endif #endif

View File

@@ -35,6 +35,11 @@
#include "Poco/Util/IniFileConfiguration.h" #include "Poco/Util/IniFileConfiguration.h"
#ifndef POCO_UTIL_NO_INIFILECONFIGURATION
#include "Poco/Exception.h" #include "Poco/Exception.h"
#include "Poco/String.h" #include "Poco/String.h"
#include "Poco/Path.h" #include "Poco/Path.h"
@@ -202,3 +207,6 @@ void IniFileConfiguration::parseLine(std::istream& istr)
} } // namespace Poco::Util } } // namespace Poco::Util
#endif // POCO_UTIL_NO_INIFILECONFIGURATION

View File

@@ -34,14 +34,15 @@
// //
// Avoid accidental linking of JSON library when JSONConfiguration
// is not desired. #include "Poco/Util/JSONConfiguration.h"
#ifndef POCO_UTIL_NO_JSONCONFIGURATION #ifndef POCO_UTIL_NO_JSONCONFIGURATION
#include "Poco/FileStream.h" #include "Poco/FileStream.h"
#include "Poco/StringTokenizer.h" #include "Poco/StringTokenizer.h"
#include "Poco/Util/JSONConfiguration.h"
#include "Poco/JSON/Parser.h" #include "Poco/JSON/Parser.h"
#include "Poco/JSON/Query.h" #include "Poco/JSON/Query.h"
#include "Poco/JSON/DefaultHandler.h" #include "Poco/JSON/DefaultHandler.h"
@@ -410,4 +411,5 @@ void JSONConfiguration::removeRaw(const std::string& key)
} } // namespace Poco::Util } } // namespace Poco::Util
#endif // POCO_UTIL_NO_JSONCONFIGURATION #endif // POCO_UTIL_NO_JSONCONFIGURATION

View File

@@ -34,12 +34,12 @@
// //
// Avoid accidental linking of XML library when XMLConfiguration #include "Poco/Util/XMLConfiguration.h"
// is not desired.
#ifndef POCO_UTIL_NO_XMLCONFIGURATION #ifndef POCO_UTIL_NO_XMLCONFIGURATION
#include "Poco/Util/XMLConfiguration.h"
#include "Poco/SAX/InputSource.h" #include "Poco/SAX/InputSource.h"
#include "Poco/DOM/DOMParser.h" #include "Poco/DOM/DOMParser.h"
#include "Poco/DOM/Element.h" #include "Poco/DOM/Element.h"