mirror of
https://github.com/pocoproject/poco.git
synced 2025-02-20 22:31:23 +01:00
committed latest 1.3 snapshot
This commit is contained in:
parent
b60344ddcd
commit
965b9458d5
@ -1,7 +1,7 @@
|
||||
//
|
||||
// Application.h
|
||||
//
|
||||
// $Id: //poco/Main/Util/include/Poco/Util/Application.h#12 $
|
||||
// $Id: //poco/Main/Util/include/Poco/Util/Application.h#14 $
|
||||
//
|
||||
// Library: Util
|
||||
// Package: Application
|
||||
@ -299,7 +299,8 @@ protected:
|
||||
/// Called before command line processing begins.
|
||||
/// If a subclass wants to support command line arguments,
|
||||
/// it must override this method.
|
||||
/// The default implementation does not define any options.
|
||||
/// The default implementation does not define any options itself,
|
||||
/// but calls defineOptions() on all registered subsystems.
|
||||
///
|
||||
/// Overriding implementations should call the base class implementation.
|
||||
|
||||
@ -441,7 +442,7 @@ inline Poco::Timespan Application::uptime() const
|
||||
//
|
||||
// Macro to implement main()
|
||||
//
|
||||
#if defined(POCO_WIN32_UTF8)
|
||||
#if defined(_WIN32) && defined(POCO_WIN32_UTF8)
|
||||
#define POCO_APP_MAIN(App) \
|
||||
int wmain(int argc, wchar_t** argv) \
|
||||
{ \
|
||||
|
@ -1,7 +1,7 @@
|
||||
//
|
||||
// ServerApplication.h
|
||||
//
|
||||
// $Id: //poco/Main/Util/include/Poco/Util/ServerApplication.h#3 $
|
||||
// $Id: //poco/Main/Util/include/Poco/Util/ServerApplication.h#4 $
|
||||
//
|
||||
// Library: Util
|
||||
// Package: Application
|
||||
@ -194,7 +194,7 @@ private:
|
||||
//
|
||||
// Macro to implement main()
|
||||
//
|
||||
#if defined(POCO_WIN32_UTF8)
|
||||
#if defined(_WIN32) && defined(POCO_WIN32_UTF8)
|
||||
#define POCO_SERVER_MAIN(App) \
|
||||
int wmain(int argc, wchar_t** argv) \
|
||||
{ \
|
||||
|
@ -1,7 +1,7 @@
|
||||
//
|
||||
// Subsystem.h
|
||||
//
|
||||
// $Id: //poco/Main/Util/include/Poco/Util/Subsystem.h#2 $
|
||||
// $Id: //poco/Main/Util/include/Poco/Util/Subsystem.h#3 $
|
||||
//
|
||||
// Library: Util
|
||||
// Package: Application
|
||||
@ -49,6 +49,7 @@ namespace Util {
|
||||
|
||||
|
||||
class Application;
|
||||
class OptionSet;
|
||||
|
||||
|
||||
class Util_API Subsystem: public Poco::RefCountedObject
|
||||
@ -92,6 +93,16 @@ protected:
|
||||
/// less radical and possibly more performant
|
||||
/// approach.
|
||||
|
||||
virtual void defineOptions(OptionSet& options);
|
||||
/// Called before the Application's command line processing begins.
|
||||
/// If a subsystem wants to support command line arguments,
|
||||
/// it must override this method.
|
||||
/// The default implementation does not define any options.
|
||||
///
|
||||
/// To effectively handle options, a subsystem should either bind
|
||||
/// the option to a configuration property or specify a callback
|
||||
/// to handle the option.
|
||||
|
||||
virtual ~Subsystem();
|
||||
/// Destroys the Subsystem.
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
//
|
||||
// SystemConfiguration.h
|
||||
//
|
||||
// $Id: //poco/Main/Util/include/Poco/Util/SystemConfiguration.h#2 $
|
||||
// $Id: //poco/Main/Util/include/Poco/Util/SystemConfiguration.h#3 $
|
||||
//
|
||||
// Library: Util
|
||||
// Package: Configuration
|
||||
@ -66,7 +66,7 @@ class Util_API SystemConfiguration: public AbstractConfiguration
|
||||
/// InvalidAccessException being thrown.
|
||||
///
|
||||
/// Enumerating environment variables is not supported.
|
||||
/// An attemp to call keys("system.env") will return an empty range.
|
||||
/// An attempt to call keys("system.env") will return an empty range.
|
||||
{
|
||||
public:
|
||||
SystemConfiguration();
|
||||
|
@ -1,7 +1,7 @@
|
||||
//
|
||||
// Application.cpp
|
||||
//
|
||||
// $Id: //poco/Main/Util/src/Application.cpp#25 $
|
||||
// $Id: //poco/Main/Util/src/Application.cpp#26 $
|
||||
//
|
||||
// Library: Util
|
||||
// Package: Application
|
||||
@ -469,6 +469,10 @@ bool Application::findAppConfigFile(const std::string& appName, const std::strin
|
||||
|
||||
void Application::defineOptions(OptionSet& options)
|
||||
{
|
||||
for (SubsystemVec::iterator it = _subsystems.begin(); it != _subsystems.end(); ++it)
|
||||
{
|
||||
(*it)->defineOptions(options);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
//
|
||||
// FilesystemConfiguration.cpp
|
||||
//
|
||||
// $Id: //poco/Main/Util/src/FilesystemConfiguration.cpp#7 $
|
||||
// $Id: //poco/Main/Util/src/FilesystemConfiguration.cpp#8 $
|
||||
//
|
||||
// Library: Util
|
||||
// Package: Configuration
|
||||
@ -40,7 +40,7 @@
|
||||
#include "Poco/DirectoryIterator.h"
|
||||
#include "Poco/StringTokenizer.h"
|
||||
#include "Poco/Exception.h"
|
||||
#include <fstream>
|
||||
#include "Poco/FileStream.h"
|
||||
|
||||
|
||||
using Poco::Path;
|
||||
@ -81,7 +81,7 @@ bool FilesystemConfiguration::getRaw(const std::string& key, std::string& value)
|
||||
if (f.exists())
|
||||
{
|
||||
value.reserve((std::string::size_type) f.getSize());
|
||||
std::ifstream istr(Path::transcode(p.toString()).c_str());
|
||||
Poco::FileInputStream istr(p.toString());
|
||||
int c = istr.get();
|
||||
while (c != std::char_traits<char>::eof())
|
||||
{
|
||||
@ -100,7 +100,7 @@ void FilesystemConfiguration::setRaw(const std::string& key, const std::string&
|
||||
File dir(p);
|
||||
dir.createDirectories();
|
||||
p.setFileName("data");
|
||||
std::ofstream ostr(Path::transcode(p.toString()).c_str());
|
||||
Poco::FileOutputStream ostr(p.toString());
|
||||
ostr.write(value.data(), (std::streamsize) value.length());
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
//
|
||||
// IniFileConfiguration.cpp
|
||||
//
|
||||
// $Id: //poco/Main/Util/src/IniFileConfiguration.cpp#7 $
|
||||
// $Id: //poco/Main/Util/src/IniFileConfiguration.cpp#8 $
|
||||
//
|
||||
// Library: Util
|
||||
// Package: Configuration
|
||||
@ -38,7 +38,7 @@
|
||||
#include "Poco/Exception.h"
|
||||
#include "Poco/String.h"
|
||||
#include "Poco/Path.h"
|
||||
#include <fstream>
|
||||
#include "Poco/FileStream.h"
|
||||
#include <locale>
|
||||
#include <set>
|
||||
|
||||
@ -87,7 +87,7 @@ void IniFileConfiguration::load(std::istream& istr)
|
||||
|
||||
void IniFileConfiguration::load(const std::string& path)
|
||||
{
|
||||
std::ifstream istr(Path::transcode(path).c_str());
|
||||
Poco::FileInputStream istr(path);
|
||||
if (istr.good())
|
||||
load(istr);
|
||||
else
|
||||
|
@ -1,7 +1,7 @@
|
||||
//
|
||||
// PropertyFileConfiguration.cpp
|
||||
//
|
||||
// $Id: //poco/Main/Util/src/PropertyFileConfiguration.cpp#7 $
|
||||
// $Id: //poco/Main/Util/src/PropertyFileConfiguration.cpp#8 $
|
||||
//
|
||||
// Library: Util
|
||||
// Package: Configuration
|
||||
@ -38,7 +38,7 @@
|
||||
#include "Poco/Exception.h"
|
||||
#include "Poco/String.h"
|
||||
#include "Poco/Path.h"
|
||||
#include <fstream>
|
||||
#include "Poco/FileStream.h"
|
||||
#include <locale>
|
||||
|
||||
|
||||
@ -84,7 +84,7 @@ void PropertyFileConfiguration::load(std::istream& istr)
|
||||
|
||||
void PropertyFileConfiguration::load(const std::string& path)
|
||||
{
|
||||
std::ifstream istr(Path::transcode(path).c_str());
|
||||
Poco::FileInputStream istr(path);
|
||||
if (istr.good())
|
||||
load(istr);
|
||||
else
|
||||
@ -106,7 +106,7 @@ void PropertyFileConfiguration::save(std::ostream& ostr) const
|
||||
|
||||
void PropertyFileConfiguration::save(const std::string& path) const
|
||||
{
|
||||
std::ofstream ostr(Path::transcode(path).c_str());
|
||||
Poco::FileOutputStream ostr(path);
|
||||
if (ostr.good())
|
||||
{
|
||||
save(ostr);
|
||||
|
@ -1,7 +1,7 @@
|
||||
//
|
||||
// ServerApplication.cpp
|
||||
//
|
||||
// $Id: //poco/Main/Util/src/ServerApplication.cpp#18 $
|
||||
// $Id: //poco/Main/Util/src/ServerApplication.cpp#19 $
|
||||
//
|
||||
// Library: Util
|
||||
// Package: Application
|
||||
@ -70,7 +70,7 @@ namespace Util {
|
||||
|
||||
|
||||
#if defined(POCO_OS_FAMILY_WINDOWS)
|
||||
Poco::Event ServerApplication::_terminated;
|
||||
Poco::Event ServerApplication::_terminated;
|
||||
SERVICE_STATUS ServerApplication::_serviceStatus;
|
||||
SERVICE_STATUS_HANDLE ServerApplication::_serviceStatusHandle = 0;
|
||||
#endif
|
||||
|
@ -1,7 +1,7 @@
|
||||
//
|
||||
// Subsystem.cpp
|
||||
//
|
||||
// $Id: //poco/Main/Util/src/Subsystem.cpp#7 $
|
||||
// $Id: //poco/Main/Util/src/Subsystem.cpp#8 $
|
||||
//
|
||||
// Library: Util
|
||||
// Package: Application
|
||||
@ -58,4 +58,9 @@ void Subsystem::reinitialize(Application& app)
|
||||
}
|
||||
|
||||
|
||||
void Subsystem::defineOptions(OptionSet& options)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
} } // namespace Poco::Util
|
||||
|
Loading…
x
Reference in New Issue
Block a user