mirror of
https://github.com/pocoproject/poco.git
synced 2025-11-02 14:03:41 +01:00
synced with main repository
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
//
|
||||
// AbstractConfiguration.cpp
|
||||
//
|
||||
// $Id: //poco/Main/Util/src/AbstractConfiguration.cpp#7 $
|
||||
// $Id: //poco/svn/Util/src/AbstractConfiguration.cpp#1 $
|
||||
//
|
||||
// Library: Util
|
||||
// Package: Configuration
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//
|
||||
// Application.cpp
|
||||
//
|
||||
// $Id: //poco/Main/Util/src/Application.cpp#28 $
|
||||
// $Id: //poco/svn/Util/src/Application.cpp#1 $
|
||||
//
|
||||
// Library: Util
|
||||
// Package: Application
|
||||
@@ -58,7 +58,7 @@
|
||||
#if defined(POCO_OS_FAMILY_UNIX)
|
||||
#include "Poco/SignalHandler.h"
|
||||
#endif
|
||||
#if defined(POCO_WIN32_UTF8)
|
||||
#if defined(POCO_WIN32_UTF8) && !defined(POCO_NO_WSTRING)
|
||||
#include "Poco/UnicodeConverter.h"
|
||||
#endif
|
||||
|
||||
@@ -156,7 +156,7 @@ void Application::init(int argc, char* argv[])
|
||||
}
|
||||
|
||||
|
||||
#if defined(POCO_WIN32_UTF8)
|
||||
#if defined(POCO_WIN32_UTF8) && !defined(POCO_NO_WSTRING)
|
||||
void Application::init(int argc, wchar_t* argv[])
|
||||
{
|
||||
std::vector<std::string> args;
|
||||
@@ -398,7 +398,7 @@ void Application::getApplicationPath(Poco::Path& appPath) const
|
||||
appPath = Path(Path::current(), _command);
|
||||
}
|
||||
#elif defined(POCO_OS_FAMILY_WINDOWS)
|
||||
#if defined(POCO_WIN32_UTF8)
|
||||
#if defined(POCO_WIN32_UTF8) && !defined(POCO_NO_WSTRING)
|
||||
wchar_t path[1024];
|
||||
int n = GetModuleFileNameW(0, path, sizeof(path)/sizeof(wchar_t));
|
||||
if (n > 0)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//
|
||||
// ConfigurationMapper.cpp
|
||||
//
|
||||
// $Id: //poco/Main/Util/src/ConfigurationMapper.cpp#6 $
|
||||
// $Id: //poco/svn/Util/src/ConfigurationMapper.cpp#1 $
|
||||
//
|
||||
// Library: Util
|
||||
// Package: Configuration
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//
|
||||
// ConfigurationView.cpp
|
||||
//
|
||||
// $Id: //poco/Main/Util/src/ConfigurationView.cpp#7 $
|
||||
// $Id: //poco/svn/Util/src/ConfigurationView.cpp#1 $
|
||||
//
|
||||
// Library: Util
|
||||
// Package: Configuration
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//
|
||||
// FilesystemConfiguration.cpp
|
||||
//
|
||||
// $Id: //poco/Main/Util/src/FilesystemConfiguration.cpp#8 $
|
||||
// $Id: //poco/svn/Util/src/FilesystemConfiguration.cpp#1 $
|
||||
//
|
||||
// Library: Util
|
||||
// Package: Configuration
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//
|
||||
// HelpFormatter.cpp
|
||||
//
|
||||
// $Id: //poco/Main/Util/src/HelpFormatter.cpp#8 $
|
||||
// $Id: //poco/svn/Util/src/HelpFormatter.cpp#1 $
|
||||
//
|
||||
// Library: Util
|
||||
// Package: Options
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//
|
||||
// IniFileConfiguration.cpp
|
||||
//
|
||||
// $Id: //poco/Main/Util/src/IniFileConfiguration.cpp#9 $
|
||||
// $Id: //poco/svn/Util/src/IniFileConfiguration.cpp#1 $
|
||||
//
|
||||
// Library: Util
|
||||
// Package: Configuration
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//
|
||||
// IntValidator.cpp
|
||||
//
|
||||
// $Id: //poco/Main/Util/src/IntValidator.cpp#1 $
|
||||
// $Id: //poco/svn/Util/src/IntValidator.cpp#1 $
|
||||
//
|
||||
// Library: Util
|
||||
// Package: Options
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//
|
||||
// LayeredConfiguration.cpp
|
||||
//
|
||||
// $Id: //poco/Main/Util/src/LayeredConfiguration.cpp#8 $
|
||||
// $Id: //poco/svn/Util/src/LayeredConfiguration.cpp#1 $
|
||||
//
|
||||
// Library: Util
|
||||
// Package: Configuration
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//
|
||||
// LoggingConfigurator.cpp
|
||||
//
|
||||
// $Id: //poco/Main/Util/src/LoggingConfigurator.cpp#12 $
|
||||
// $Id: //poco/svn/Util/src/LoggingConfigurator.cpp#1 $
|
||||
//
|
||||
// Library: Util
|
||||
// Package: Configuration
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//
|
||||
// LoggingSubsystem.cpp
|
||||
//
|
||||
// $Id: //poco/Main/Util/src/LoggingSubsystem.cpp#8 $
|
||||
// $Id: //poco/svn/Util/src/LoggingSubsystem.cpp#1 $
|
||||
//
|
||||
// Library: Util
|
||||
// Package: Application
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//
|
||||
// MapConfiguration.cpp
|
||||
//
|
||||
// $Id: //poco/Main/Util/src/MapConfiguration.cpp#6 $
|
||||
// $Id: //poco/svn/Util/src/MapConfiguration.cpp#1 $
|
||||
//
|
||||
// Library: Util
|
||||
// Package: Configuration
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//
|
||||
// Option.cpp
|
||||
//
|
||||
// $Id: //poco/Main/Util/src/Option.cpp#10 $
|
||||
// $Id: //poco/svn/Util/src/Option.cpp#2 $
|
||||
//
|
||||
// Library: Util
|
||||
// Package: Options
|
||||
@@ -107,14 +107,14 @@ Option::Option(const std::string& fullName, const std::string& shortName, const
|
||||
}
|
||||
|
||||
|
||||
Option::Option(const std::string& fullName, const std::string& shortName, const std::string& description, bool required, const std::string& argName, bool argOptional):
|
||||
Option::Option(const std::string& fullName, const std::string& shortName, const std::string& description, bool required, const std::string& argName, bool argRequired):
|
||||
_shortName(shortName),
|
||||
_fullName(fullName),
|
||||
_description(description),
|
||||
_required(required),
|
||||
_repeatable(false),
|
||||
_argName(argName),
|
||||
_argRequired(argOptional),
|
||||
_argRequired(argRequired),
|
||||
_pValidator(0),
|
||||
_pCallback(0),
|
||||
_pConfig(0)
|
||||
@@ -243,7 +243,6 @@ Option& Option::validator(Validator* pValidator)
|
||||
{
|
||||
if (_pValidator) _pValidator->release();
|
||||
_pValidator = pValidator;
|
||||
if (_pValidator) _pValidator->duplicate();
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//
|
||||
// OptionCallback.cpp
|
||||
//
|
||||
// $Id: //poco/Main/Util/src/OptionCallback.cpp#2 $
|
||||
// $Id: //poco/svn/Util/src/OptionCallback.cpp#1 $
|
||||
//
|
||||
// Library: Util
|
||||
// Package: Options
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//
|
||||
// OptionException.cpp
|
||||
//
|
||||
// $Id: //poco/Main/Util/src/OptionException.cpp#8 $
|
||||
// $Id: //poco/svn/Util/src/OptionException.cpp#1 $
|
||||
//
|
||||
// Library: Util
|
||||
// Package: Options
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//
|
||||
// OptionProcessor.cpp
|
||||
//
|
||||
// $Id: //poco/Main/Util/src/OptionProcessor.cpp#8 $
|
||||
// $Id: //poco/svn/Util/src/OptionProcessor.cpp#1 $
|
||||
//
|
||||
// Library: Util
|
||||
// Package: Options
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//
|
||||
// OptionSet.cpp
|
||||
//
|
||||
// $Id: //poco/Main/Util/src/OptionSet.cpp#8 $
|
||||
// $Id: //poco/svn/Util/src/OptionSet.cpp#1 $
|
||||
//
|
||||
// Library: Util
|
||||
// Package: Options
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//
|
||||
// PropertyFileConfiguration.cpp
|
||||
//
|
||||
// $Id: //poco/Main/Util/src/PropertyFileConfiguration.cpp#9 $
|
||||
// $Id: //poco/svn/Util/src/PropertyFileConfiguration.cpp#2 $
|
||||
//
|
||||
// Library: Util
|
||||
// Package: Configuration
|
||||
@@ -39,6 +39,7 @@
|
||||
#include "Poco/String.h"
|
||||
#include "Poco/Path.h"
|
||||
#include "Poco/FileStream.h"
|
||||
#include "Poco/LineEndingConverter.h"
|
||||
#include <cctype>
|
||||
|
||||
|
||||
@@ -109,7 +110,9 @@ void PropertyFileConfiguration::save(const std::string& path) const
|
||||
Poco::FileOutputStream ostr(path);
|
||||
if (ostr.good())
|
||||
{
|
||||
save(ostr);
|
||||
Poco::OutputLineEndingConverter lec(ostr);
|
||||
save(lec);
|
||||
lec.flush();
|
||||
ostr.flush();
|
||||
if (!ostr.good()) throw Poco::WriteFileException(path);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//
|
||||
// RegExpValidator.cpp
|
||||
//
|
||||
// $Id: //poco/Main/Util/src/RegExpValidator.cpp#2 $
|
||||
// $Id: //poco/svn/Util/src/RegExpValidator.cpp#1 $
|
||||
//
|
||||
// Library: Util
|
||||
// Package: Options
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//
|
||||
// ServerApplication.cpp
|
||||
//
|
||||
// $Id: //poco/Main/Util/src/ServerApplication.cpp#22 $
|
||||
// $Id: //poco/svn/Util/src/ServerApplication.cpp#2 $
|
||||
//
|
||||
// Library: Util
|
||||
// Package: Application
|
||||
@@ -53,7 +53,7 @@
|
||||
#include "Poco/UnWindows.h"
|
||||
#include <cstring>
|
||||
#endif
|
||||
#if defined(POCO_WIN32_UTF8)
|
||||
#if defined(POCO_WIN32_UTF8) && !defined(POCO_NO_WSTRING)
|
||||
#include "Poco/UnicodeConverter.h"
|
||||
#endif
|
||||
|
||||
@@ -146,7 +146,7 @@ void ServerApplication::ServiceControlHandler(DWORD control)
|
||||
}
|
||||
|
||||
|
||||
#if defined(POCO_WIN32_UTF8)
|
||||
#if defined(POCO_WIN32_UTF8) && !defined(POCO_NO_WSTRING)
|
||||
void ServerApplication::ServiceMain(DWORD argc, LPWSTR* argv)
|
||||
#else
|
||||
void ServerApplication::ServiceMain(DWORD argc, LPTSTR* argv)
|
||||
@@ -154,7 +154,9 @@ void ServerApplication::ServiceMain(DWORD argc, LPTSTR* argv)
|
||||
{
|
||||
ServerApplication& app = static_cast<ServerApplication&>(Application::instance());
|
||||
|
||||
#if defined(POCO_WIN32_UTF8)
|
||||
app.config().setBool("application.runAsService", true);
|
||||
|
||||
#if defined(POCO_WIN32_UTF8) && !defined(POCO_NO_WSTRING)
|
||||
_serviceStatusHandle = RegisterServiceCtrlHandlerW(L"", ServiceControlHandler);
|
||||
#else
|
||||
_serviceStatusHandle = RegisterServiceCtrlHandler("", ServiceControlHandler);
|
||||
@@ -173,7 +175,7 @@ void ServerApplication::ServiceMain(DWORD argc, LPTSTR* argv)
|
||||
|
||||
try
|
||||
{
|
||||
#if defined(POCO_WIN32_UTF8)
|
||||
#if defined(POCO_WIN32_UTF8) && !defined(POCO_NO_WSTRING)
|
||||
std::vector<std::string> args;
|
||||
for (DWORD i = 0; i < argc; ++i)
|
||||
{
|
||||
@@ -230,7 +232,6 @@ int ServerApplication::run(int argc, char** argv)
|
||||
{
|
||||
if (!hasConsole() && isService())
|
||||
{
|
||||
config().setBool("application.runAsService", true);
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
@@ -264,12 +265,11 @@ int ServerApplication::run(int argc, char** argv)
|
||||
}
|
||||
|
||||
|
||||
#if defined(POCO_WIN32_UTF8)
|
||||
#if defined(POCO_WIN32_UTF8) && !defined(POCO_NO_WSTRING)
|
||||
int ServerApplication::run(int argc, wchar_t** argv)
|
||||
{
|
||||
if (!hasConsole() && isService())
|
||||
{
|
||||
config().setBool("application.runAsService", true);
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
@@ -306,7 +306,7 @@ int ServerApplication::run(int argc, wchar_t** argv)
|
||||
|
||||
bool ServerApplication::isService()
|
||||
{
|
||||
#if defined(POCO_WIN32_UTF8)
|
||||
#if defined(POCO_WIN32_UTF8) && !defined(POCO_NO_WSTRING)
|
||||
SERVICE_TABLE_ENTRYW svcDispatchTable[2];
|
||||
svcDispatchTable[0].lpServiceName = L"";
|
||||
svcDispatchTable[0].lpServiceProc = ServiceMain;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//
|
||||
// Subsystem.cpp
|
||||
//
|
||||
// $Id: //poco/Main/Util/src/Subsystem.cpp#8 $
|
||||
// $Id: //poco/svn/Util/src/Subsystem.cpp#1 $
|
||||
//
|
||||
// Library: Util
|
||||
// Package: Application
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//
|
||||
// SystemConfiguration.cpp
|
||||
//
|
||||
// $Id: //poco/Main/Util/src/SystemConfiguration.cpp#6 $
|
||||
// $Id: //poco/svn/Util/src/SystemConfiguration.cpp#1 $
|
||||
//
|
||||
// Library: Util
|
||||
// Package: Configuration
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//
|
||||
// Validator.cpp
|
||||
//
|
||||
// $Id: //poco/Main/Util/src/Validator.cpp#1 $
|
||||
// $Id: //poco/svn/Util/src/Validator.cpp#1 $
|
||||
//
|
||||
// Library: Util
|
||||
// Package: Options
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//
|
||||
// WinRegistryConfiguration.cpp
|
||||
//
|
||||
// $Id: //poco/Main/Util/src/WinRegistryConfiguration.cpp#7 $
|
||||
// $Id: //poco/svn/Util/src/WinRegistryConfiguration.cpp#1 $
|
||||
//
|
||||
// Library: Util
|
||||
// Package: Windows
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//
|
||||
// WinRegistryKey.cpp
|
||||
//
|
||||
// $Id: //poco/Main/Util/src/WinRegistryKey.cpp#13 $
|
||||
// $Id: //poco/svn/Util/src/WinRegistryKey.cpp#1 $
|
||||
//
|
||||
// Library: Util
|
||||
// Package: Windows
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//
|
||||
// WinService.cpp
|
||||
//
|
||||
// $Id: //poco/Main/Util/src/WinService.cpp#10 $
|
||||
// $Id: //poco/svn/Util/src/WinService.cpp#1 $
|
||||
//
|
||||
// Library: Util
|
||||
// Package: Windows
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//
|
||||
// XMLConfiguration.cpp
|
||||
//
|
||||
// $Id: //poco/Main/Util/src/XMLConfiguration.cpp#6 $
|
||||
// $Id: //poco/svn/Util/src/XMLConfiguration.cpp#1 $
|
||||
//
|
||||
// Library: Util
|
||||
// Package: Configuration
|
||||
|
||||
Reference in New Issue
Block a user