XML: complete merge from 1.4.2

This commit is contained in:
Marian Krivos
2011-09-14 14:55:17 +00:00
parent 16ff8caf6b
commit 7e5c3a13d6
80 changed files with 9847 additions and 2282 deletions

View File

@@ -35,6 +35,7 @@
#include "Poco/Util/WinService.h"
#include "Poco/Util/WinRegistryKey.h"
#include "Poco/Thread.h"
#include "Poco/Exception.h"
#if defined(POCO_WIN32_UTF8)
@@ -53,6 +54,8 @@ namespace Util {
const int WinService::STARTUP_TIMEOUT = 30000;
const std::string WinService::REGISTRY_KEY("SYSTEM\\CurrentControlSet\\Services\\");
const std::string WinService::REGISTRY_DESCRIPTION("Description");
WinService::WinService(const std::string& name):
@@ -256,9 +259,27 @@ WinService::Startup WinService::getStartup() const
}
void WinService::setDescription(const std::string& description)
{
std::string key(REGISTRY_KEY);
key += _name;
WinRegistryKey regKey(HKEY_LOCAL_MACHINE, key);
regKey.setString(REGISTRY_DESCRIPTION, description);
}
std::string WinService::getDescription() const
{
std::string key(REGISTRY_KEY);
key += _name;
WinRegistryKey regKey(HKEY_LOCAL_MACHINE, key, true);
return regKey.getString(REGISTRY_DESCRIPTION);
}
void WinService::open() const
{
if (!tryOpen())
if (!tryOpen())
throw NotFoundException("service does not exist", _name);
}