mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-25 10:09:36 +02:00
committed 1.3 release
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
//
|
||||
// Debugger.cpp
|
||||
//
|
||||
// $Id: //poco/Main/Foundation/src/Debugger.cpp#14 $
|
||||
// $Id: //poco/Main/Foundation/src/Debugger.cpp#15 $
|
||||
//
|
||||
// Library: Foundation
|
||||
// Package: Core
|
||||
@@ -91,8 +91,8 @@ void Debugger::message(const std::string& msg)
|
||||
umsg += '\n';
|
||||
OutputDebugStringW(umsg.c_str());
|
||||
#else
|
||||
OutputDebugString(msg.c_str());
|
||||
OutputDebugString("\n");
|
||||
OutputDebugStringA(msg.c_str());
|
||||
OutputDebugStringA("\n");
|
||||
#endif
|
||||
}
|
||||
#elif defined(POCO_OS_FAMILY_UNIX)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//
|
||||
// Environment_WIN32.cpp
|
||||
//
|
||||
// $Id: //poco/Main/Foundation/src/Environment_WIN32.cpp#12 $
|
||||
// $Id: //poco/Main/Foundation/src/Environment_WIN32.cpp#13 $
|
||||
//
|
||||
// Library: Foundation
|
||||
// Package: Core
|
||||
@@ -45,10 +45,10 @@ namespace Poco {
|
||||
|
||||
std::string EnvironmentImpl::getImpl(const std::string& name)
|
||||
{
|
||||
DWORD len = GetEnvironmentVariable(name.c_str(), 0, 0);
|
||||
DWORD len = GetEnvironmentVariableA(name.c_str(), 0, 0);
|
||||
if (len == 0) throw NotFoundException(name);
|
||||
char* buffer = new char[len];
|
||||
GetEnvironmentVariable(name.c_str(), buffer, len);
|
||||
GetEnvironmentVariableA(name.c_str(), buffer, len);
|
||||
std::string result(buffer);
|
||||
delete [] buffer;
|
||||
return result;
|
||||
@@ -57,14 +57,14 @@ std::string EnvironmentImpl::getImpl(const std::string& name)
|
||||
|
||||
bool EnvironmentImpl::hasImpl(const std::string& name)
|
||||
{
|
||||
DWORD len = GetEnvironmentVariable(name.c_str(), 0, 0);
|
||||
DWORD len = GetEnvironmentVariableA(name.c_str(), 0, 0);
|
||||
return len > 0;
|
||||
}
|
||||
|
||||
|
||||
void EnvironmentImpl::setImpl(const std::string& name, const std::string& value)
|
||||
{
|
||||
if (SetEnvironmentVariable(name.c_str(), value.c_str()) == 0)
|
||||
if (SetEnvironmentVariableA(name.c_str(), value.c_str()) == 0)
|
||||
{
|
||||
std::string msg = "cannot set environment variable: ";
|
||||
msg.append(name);
|
||||
@@ -139,7 +139,7 @@ std::string EnvironmentImpl::nodeNameImpl()
|
||||
{
|
||||
char name[MAX_COMPUTERNAME_LENGTH + 1];
|
||||
DWORD size = sizeof(name);
|
||||
if (GetComputerName(name, &size) == 0) throw SystemException("Cannot get computer name");
|
||||
if (GetComputerNameA(name, &size) == 0) throw SystemException("Cannot get computer name");
|
||||
return std::string(name);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//
|
||||
// EventLogChannel.cpp
|
||||
//
|
||||
// $Id: //poco/Main/Foundation/src/EventLogChannel.cpp#13 $
|
||||
// $Id: //poco/Main/Foundation/src/EventLogChannel.cpp#14 $
|
||||
//
|
||||
// Library: Foundation
|
||||
// Package: Logging
|
||||
@@ -69,7 +69,7 @@ EventLogChannel::EventLogChannel():
|
||||
}
|
||||
#else
|
||||
char name[256];
|
||||
int n = GetModuleFileName(NULL, name, sizeof(name));
|
||||
int n = GetModuleFileNameA(NULL, name, sizeof(name));
|
||||
if (n > 0)
|
||||
{
|
||||
char* end = name + n - 1;
|
||||
@@ -299,11 +299,11 @@ std::wstring EventLogChannel::findLibrary(const wchar_t* name)
|
||||
std::string EventLogChannel::findLibrary(const char* name)
|
||||
{
|
||||
std::string path;
|
||||
HMODULE dll = LoadLibrary(name);
|
||||
HMODULE dll = LoadLibraryA(name);
|
||||
if (dll)
|
||||
{
|
||||
char name[MAX_PATH + 1];
|
||||
int n = GetModuleFileName(dll, name, sizeof(name));
|
||||
int n = GetModuleFileNameA(dll, name, sizeof(name));
|
||||
if (n > 0) path = name;
|
||||
FreeLibrary(dll);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//
|
||||
// File_WIN32.cpp
|
||||
//
|
||||
// $Id: //poco/Main/Foundation/src/File_WIN32.cpp#18 $
|
||||
// $Id: //poco/Main/Foundation/src/File_WIN32.cpp#20 $
|
||||
//
|
||||
// Library: Foundation
|
||||
// Package: Filesystem
|
||||
@@ -48,7 +48,7 @@ class FileHandle
|
||||
public:
|
||||
FileHandle(const std::string& path, DWORD access, DWORD share, DWORD disp)
|
||||
{
|
||||
_h = CreateFile(path.c_str(), access, share, 0, disp, 0, 0);
|
||||
_h = CreateFileA(path.c_str(), access, share, 0, disp, 0, 0);
|
||||
if (!_h) FileImpl::handleLastErrorImpl(path);
|
||||
}
|
||||
|
||||
@@ -283,8 +283,12 @@ void FileImpl::copyToImpl(const std::string& path) const
|
||||
{
|
||||
poco_assert (!_path.empty());
|
||||
|
||||
if (CopyFile(_path.c_str(), path.c_str(), FALSE) == 0)
|
||||
handleLastErrorImpl(_path);
|
||||
if (CopyFileA(_path.c_str(), path.c_str(), FALSE) != 0)
|
||||
{
|
||||
FileImpl copy(path);
|
||||
copy.setWriteableImpl(true);
|
||||
}
|
||||
else handleLastErrorImpl(_path);
|
||||
}
|
||||
|
||||
|
||||
@@ -292,7 +296,7 @@ void FileImpl::renameToImpl(const std::string& path)
|
||||
{
|
||||
poco_assert (!_path.empty());
|
||||
|
||||
if (MoveFile(_path.c_str(), path.c_str()) == 0)
|
||||
if (MoveFileA(_path.c_str(), path.c_str()) == 0)
|
||||
handleLastErrorImpl(_path);
|
||||
}
|
||||
|
||||
@@ -303,12 +307,12 @@ void FileImpl::removeImpl()
|
||||
|
||||
if (isDirectoryImpl())
|
||||
{
|
||||
if (RemoveDirectory(_path.c_str()) == 0)
|
||||
if (RemoveDirectoryA(_path.c_str()) == 0)
|
||||
handleLastErrorImpl(_path);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (DeleteFile(_path.c_str()) == 0)
|
||||
if (DeleteFileA(_path.c_str()) == 0)
|
||||
handleLastErrorImpl(_path);
|
||||
}
|
||||
}
|
||||
@@ -318,7 +322,7 @@ bool FileImpl::createFileImpl()
|
||||
{
|
||||
poco_assert (!_path.empty());
|
||||
|
||||
HANDLE hFile = CreateFile(_path.c_str(), GENERIC_WRITE, 0, 0, CREATE_NEW, 0, 0);
|
||||
HANDLE hFile = CreateFileA(_path.c_str(), GENERIC_WRITE, 0, 0, CREATE_NEW, 0, 0);
|
||||
if (hFile != INVALID_HANDLE_VALUE)
|
||||
{
|
||||
CloseHandle(hFile);
|
||||
@@ -338,7 +342,7 @@ bool FileImpl::createDirectoryImpl()
|
||||
|
||||
if (existsImpl() && isDirectoryImpl())
|
||||
return false;
|
||||
if (CreateDirectory(_path.c_str(), 0) == 0)
|
||||
if (CreateDirectoryA(_path.c_str(), 0) == 0)
|
||||
handleLastErrorImpl(_path);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//
|
||||
// File_WIN32U.cpp
|
||||
//
|
||||
// $Id: //poco/Main/Foundation/src/File_WIN32U.cpp#12 $
|
||||
// $Id: //poco/Main/Foundation/src/File_WIN32U.cpp#13 $
|
||||
//
|
||||
// Library: Foundation
|
||||
// Package: Filesystem
|
||||
@@ -289,8 +289,12 @@ void FileImpl::copyToImpl(const std::string& path) const
|
||||
|
||||
std::wstring upath;
|
||||
UnicodeConverter::toUTF16(path, upath);
|
||||
if (CopyFileW(_upath.c_str(), upath.c_str(), FALSE) == 0)
|
||||
handleLastErrorImpl(_path);
|
||||
if (CopyFileW(_upath.c_str(), upath.c_str(), FALSE) != 0)
|
||||
{
|
||||
FileImpl copy(path);
|
||||
copy.setWriteableImpl(true);
|
||||
}
|
||||
else handleLastErrorImpl(_path);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//
|
||||
// LogFile_WIN32.cpp
|
||||
//
|
||||
// $Id: //poco/Main/Foundation/src/LogFile_WIN32.cpp#7 $
|
||||
// $Id: //poco/Main/Foundation/src/LogFile_WIN32.cpp#8 $
|
||||
//
|
||||
// Library: Foundation
|
||||
// Package: Logging
|
||||
@@ -44,7 +44,7 @@ namespace Poco {
|
||||
|
||||
LogFileImpl::LogFileImpl(const std::string& path): _path(path)
|
||||
{
|
||||
_hFile = CreateFile(path.c_str(), GENERIC_WRITE, FILE_SHARE_READ, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||
_hFile = CreateFileA(path.c_str(), GENERIC_WRITE, FILE_SHARE_READ, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||
if (_hFile == INVALID_HANDLE_VALUE) throw OpenFileException(path);
|
||||
SetFilePointer(_hFile, 0, 0, FILE_END);
|
||||
// There seems to be a strange "optimization" in the Windows NTFS
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//
|
||||
// NamedEvent_WIN32.cpp
|
||||
//
|
||||
// $Id: //poco/Main/Foundation/src/NamedEvent_WIN32.cpp#8 $
|
||||
// $Id: //poco/Main/Foundation/src/NamedEvent_WIN32.cpp#9 $
|
||||
//
|
||||
// Library: Foundation
|
||||
// Package: Processes
|
||||
@@ -44,7 +44,7 @@ namespace Poco {
|
||||
NamedEventImpl::NamedEventImpl(const std::string& name):
|
||||
_name(name)
|
||||
{
|
||||
_event = CreateEvent(NULL, FALSE, FALSE, _name.c_str());
|
||||
_event = CreateEventA(NULL, FALSE, FALSE, _name.c_str());
|
||||
if (!_event)
|
||||
throw SystemException("cannot create named event", _name);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//
|
||||
// NamedMutex_WIN32.cpp
|
||||
//
|
||||
// $Id: //poco/Main/Foundation/src/NamedMutex_WIN32.cpp#8 $
|
||||
// $Id: //poco/Main/Foundation/src/NamedMutex_WIN32.cpp#9 $
|
||||
//
|
||||
// Library: Foundation
|
||||
// Package: Processes
|
||||
@@ -44,7 +44,7 @@ namespace Poco {
|
||||
NamedMutexImpl::NamedMutexImpl(const std::string& name):
|
||||
_name(name)
|
||||
{
|
||||
_mutex = CreateMutex(NULL, FALSE, _name.c_str());
|
||||
_mutex = CreateMutexA(NULL, FALSE, _name.c_str());
|
||||
if (!_mutex)
|
||||
throw SystemException("cannot create named mutex", _name);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//
|
||||
// Path_WIN32.cpp
|
||||
//
|
||||
// $Id: //poco/Main/Foundation/src/Path_WIN32.cpp#12 $
|
||||
// $Id: //poco/Main/Foundation/src/Path_WIN32.cpp#13 $
|
||||
//
|
||||
// Library: Foundation
|
||||
// Package: Filesystem
|
||||
@@ -45,7 +45,7 @@ namespace Poco {
|
||||
std::string PathImpl::currentImpl()
|
||||
{
|
||||
char buffer[_MAX_PATH];
|
||||
DWORD n = GetCurrentDirectory(sizeof(buffer), buffer);
|
||||
DWORD n = GetCurrentDirectoryA(sizeof(buffer), buffer);
|
||||
if (n > 0 && n < sizeof(buffer))
|
||||
{
|
||||
std::string result(buffer, n);
|
||||
@@ -71,7 +71,7 @@ std::string PathImpl::homeImpl()
|
||||
std::string PathImpl::tempImpl()
|
||||
{
|
||||
char buffer[_MAX_PATH];
|
||||
DWORD n = GetTempPath(sizeof(buffer), buffer);
|
||||
DWORD n = GetTempPathA(sizeof(buffer), buffer);
|
||||
if (n > 0 && n < sizeof(buffer))
|
||||
{
|
||||
std::string result(buffer, n);
|
||||
@@ -92,7 +92,7 @@ std::string PathImpl::nullImpl()
|
||||
std::string PathImpl::expandImpl(const std::string& path)
|
||||
{
|
||||
char buffer[_MAX_PATH];
|
||||
DWORD n = ExpandEnvironmentStrings(path.c_str(), buffer, sizeof(buffer));
|
||||
DWORD n = ExpandEnvironmentStringsA(path.c_str(), buffer, sizeof(buffer));
|
||||
if (n > 0 && n < sizeof(buffer))
|
||||
return std::string(buffer, n - 1);
|
||||
else
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//
|
||||
// Process_WIN32.cpp
|
||||
//
|
||||
// $Id: //poco/Main/Foundation/src/Process_WIN32.cpp#18 $
|
||||
// $Id: //poco/Main/Foundation/src/Process_WIN32.cpp#19 $
|
||||
//
|
||||
// Library: Foundation
|
||||
// Package: Processes
|
||||
@@ -152,7 +152,7 @@ ProcessHandleImpl* ProcessImpl::launchImpl(const std::string& command, const Arg
|
||||
if (errPipe) errPipe->close(Pipe::CLOSE_WRITE);
|
||||
|
||||
PROCESS_INFORMATION processInfo;
|
||||
BOOL rc = CreateProcess(
|
||||
BOOL rc = CreateProcessA(
|
||||
NULL,
|
||||
const_cast<char*>(commandLine.c_str()),
|
||||
NULL,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//
|
||||
// SharedLibrary_WIN32.cpp
|
||||
//
|
||||
// $Id: //poco/Main/Foundation/src/SharedLibrary_WIN32.cpp#12 $
|
||||
// $Id: //poco/Main/Foundation/src/SharedLibrary_WIN32.cpp#13 $
|
||||
//
|
||||
// Library: Foundation
|
||||
// Package: SharedLibrary
|
||||
@@ -60,7 +60,7 @@ void SharedLibraryImpl::loadImpl(const std::string& path)
|
||||
FastMutex::ScopedLock lock(_mutex);
|
||||
|
||||
if (_handle) throw LibraryAlreadyLoadedException(_path);
|
||||
_handle = LoadLibrary(path.c_str());
|
||||
_handle = LoadLibraryA(path.c_str());
|
||||
if (!_handle) throw LibraryLoadException(path);
|
||||
_path = path;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user