Skip to content

Commit 4d80e24

Browse files
committed
latest changes from main repository
1 parent 5caf218 commit 4d80e24

28 files changed

Lines changed: 242 additions & 163 deletions

‎Foundation/Foundation_vs71.vcproj‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -635,6 +635,9 @@
635635
<File
636636
RelativePath=".\include\Poco\MetaProgramming.h">
637637
</File>
638+
<File
639+
RelativePath=".\include\Poco\NamedTuple.h">
640+
</File>
638641
<File
639642
RelativePath=".\include\Poco\NestedDiagnosticContext.h">
640643
</File>

‎Foundation/include/Poco/ClassLibrary.h‎

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// ClassLibrary.h
33
//
4-
// $Id: //poco/Main/Foundation/include/Poco/ClassLibrary.h#3 $
4+
// $Id: //poco/Main/Foundation/include/Poco/ClassLibrary.h#4 $
55
//
66
// Library: Foundation
77
// Package: SharedLibrary
@@ -63,6 +63,16 @@ extern "C"
6363
}
6464

6565

66+
//
67+
// additional support for named manifests
68+
//
69+
#define POCO_DECLARE_NAMED_MANIFEST(name) \
70+
extern "C" \
71+
{ \
72+
void POCO_LIBRARY_API POCO_JOIN(pocoBuildManifest, name)(Poco::ManifestBase* pManifest); \
73+
}
74+
75+
6676
//
6777
// Macros to automatically implement pocoBuildManifest
6878
//
@@ -74,8 +84,8 @@ extern "C"
7484
// ...
7585
// POCO_END_MANIFEST
7686
//
77-
#define POCO_BEGIN_MANIFEST(base) \
78-
bool pocoBuildManifest(Poco::ManifestBase* pManifest_) \
87+
#define POCO_BEGIN_MANIFEST_IMPL(fnName, base) \
88+
bool fnName(Poco::ManifestBase* pManifest_) \
7989
{ \
8090
typedef base _Base; \
8191
typedef Poco::Manifest<_Base> _Manifest; \
@@ -86,6 +96,14 @@ extern "C"
8696
Poco::Manifest<_Base>* pManifest = static_cast<_Manifest*>(pManifest_);
8797

8898

99+
#define POCO_BEGIN_MANIFEST(base) \
100+
POCO_BEGIN_MANIFEST_IMPL(pocoBuildManifest, base)
101+
102+
103+
#define POCO_BEGIN_NAMED_MANIFEST(name, base) \
104+
POCO_BEGIN_MANIFEST_IMPL(POCO_JOIN(pocoBuildManifest, name), base)
105+
106+
89107
#define POCO_END_MANIFEST \
90108
return true; \
91109
} \

‎Foundation/include/Poco/ClassLoader.h‎

Lines changed: 35 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// ClassLoader.h
33
//
4-
// $Id: //poco/Main/Foundation/include/Poco/ClassLoader.h#2 $
4+
// $Id: //poco/Main/Foundation/include/Poco/ClassLoader.h#3 $
55
//
66
// Library: Foundation
77
// Package: SharedLibrary
@@ -62,6 +62,15 @@ class ClassLoader
6262
/// The Manifest for a shared library can be easily built
6363
/// with the help of the macros in the header file
6464
/// "Foundation/ClassLibrary.h".
65+
///
66+
/// Starting with POCO release 1.3, a class library can
67+
/// export multiple manifests. In addition to the default
68+
/// (unnamed) manifest, multiple named manifests can
69+
/// be exported, each having a different base class.
70+
///
71+
/// There is one important restriction: one instance of
72+
/// ClassLoader can only load one manifest from a class
73+
/// library.
6574
{
6675
public:
6776
typedef AbstractMetaObject<Base> Meta;
@@ -152,9 +161,9 @@ class ClassLoader
152161
}
153162
}
154163

155-
void loadLibrary(const std::string& path)
156-
/// Loads a library from the given path. Does nothing
157-
/// if the library is already loaded.
164+
void loadLibrary(const std::string& path, const std::string& manifest)
165+
/// Loads a library from the given path, using the given manifest.
166+
/// Does nothing if the library is already loaded.
158167
/// Throws a LibraryLoadException if the library
159168
/// cannot be loaded or does not have a Manifest.
160169
/// If the library exports a function named "pocoInitializeLibrary",
@@ -174,20 +183,22 @@ class ClassLoader
174183
li.refCount = 1;
175184
try
176185
{
186+
std::string pocoBuildManifestSymbol("pocoBuildManifest");
187+
pocoBuildManifestSymbol.append(manifest);
177188
if (li.pLibrary->hasSymbol("pocoInitializeLibrary"))
178189
{
179190
InitializeLibraryFunc initializeLibrary = (InitializeLibraryFunc) li.pLibrary->getSymbol("pocoInitializeLibrary");
180191
initializeLibrary();
181192
}
182-
if (li.pLibrary->hasSymbol("pocoBuildManifest"))
193+
if (li.pLibrary->hasSymbol(pocoBuildManifestSymbol))
183194
{
184-
BuildManifestFunc buildManifest = (BuildManifestFunc) li.pLibrary->getSymbol("pocoBuildManifest");
195+
BuildManifestFunc buildManifest = (BuildManifestFunc) li.pLibrary->getSymbol(pocoBuildManifestSymbol);
185196
if (buildManifest(const_cast<Manif*>(li.pManifest)))
186197
_map[path] = li;
187198
else
188-
throw LibraryLoadException(std::string("Manifest class mismatch in ") + path);
199+
throw LibraryLoadException(std::string("Manifest class mismatch in ") + path, manifest);
189200
}
190-
else throw LibraryLoadException(std::string("No manifest in ") + path);
201+
else throw LibraryLoadException(std::string("No manifest in ") + path, manifest);
191202
}
192203
catch (...)
193204
{
@@ -202,6 +213,22 @@ class ClassLoader
202213
}
203214
}
204215

216+
void loadLibrary(const std::string& path)
217+
/// Loads a library from the given path. Does nothing
218+
/// if the library is already loaded.
219+
/// Throws a LibraryLoadException if the library
220+
/// cannot be loaded or does not have a Manifest.
221+
/// If the library exports a function named "pocoInitializeLibrary",
222+
/// this function is executed.
223+
/// If called multiple times for the same library,
224+
/// the number of calls to unloadLibrary() must be the same
225+
/// for the library to become unloaded.
226+
///
227+
/// Equivalent to loadLibrary(path, "").
228+
{
229+
loadLibrary(path, "");
230+
}
231+
205232
void unloadLibrary(const std::string& path)
206233
/// Unloads the given library.
207234
/// Be extremely cautious when unloading shared libraries.

‎Foundation/include/Poco/DynamicAny.h‎

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// DynamicAny.h
33
//
4-
// $Id: //poco/Main/Foundation/include/Poco/DynamicAny.h#6 $
4+
// $Id: //poco/Main/Foundation/include/Poco/DynamicAny.h#8 $
55
//
66
// Library: Foundation
77
// Package: Core
@@ -175,17 +175,34 @@ class Foundation_API DynamicAny
175175
bool operator == (const T& other)
176176
/// Equality operator
177177
{
178-
T result;
179-
_pHolder->convert(result);
180-
return result == other;
178+
T value;
179+
_pHolder->convert(value);
180+
return value == other;
181181
}
182182

183183
bool operator == (const char* other)
184184
/// Equality operator
185185
{
186-
std::string result;
187-
_pHolder->convert(result);
188-
return result == other;
186+
std::string value;
187+
_pHolder->convert(value);
188+
return value == other;
189+
}
190+
191+
template <typename T>
192+
bool operator != (const T& other)
193+
/// Inequality operator
194+
{
195+
T value;
196+
_pHolder->convert(value);
197+
return value != other;
198+
}
199+
200+
bool operator != (const char* other)
201+
/// Inequality operator
202+
{
203+
std::string value;
204+
_pHolder->convert(value);
205+
return value != other;
189206
}
190207

191208
const std::type_info& type() const;

‎Foundation/include/Poco/DynamicAnyHolder.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// DynamicAnyHolder.h
33
//
4-
// $Id: //poco/Main/Foundation/include/Poco/DynamicAnyHolder.h#6 $
4+
// $Id: //poco/Main/Foundation/include/Poco/DynamicAnyHolder.h#7 $
55
//
66
// Library: Foundation
77
// Package: Core

‎Foundation/include/Poco/Foundation.h‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// Foundation.h
33
//
4-
// $Id: //poco/Main/Foundation/include/Poco/Foundation.h#7 $
4+
// $Id: //poco/Main/Foundation/include/Poco/Foundation.h#8 $
55
//
66
// Library: Foundation
77
// Package: Core
@@ -102,8 +102,8 @@
102102
// is that macro expansion of macro arguments does not
103103
// occur in POCO_DO_JOIN2 but does in POCO_DO_JOIN.
104104
//
105-
#define POCO_JOIN(X, Y) POCO_DO_JOIN( X, Y )
106-
#define POCO_DO_JOIN(X, Y) POCO_DO_JOIN2(X,Y)
105+
#define POCO_JOIN(X, Y) POCO_DO_JOIN(X, Y)
106+
#define POCO_DO_JOIN(X, Y) POCO_DO_JOIN2(X, Y)
107107
#define POCO_DO_JOIN2(X, Y) X##Y
108108

109109

‎Foundation/include/Poco/NamedTuple.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
//
22
// NamedTuple.h
33
//
4-
// $Id: //poco/Main/Foundation/include/Poco/NamedTuple.h#6 $
4+
// $Id: //poco/Main/Foundation/include/Poco/NamedTuple.h#1 $
55
//
66
// Library: Foundation
77
// Package: Core
88
// Module: NamedTuple
99
//
1010
// Definition of the NamedTuple class.
1111
//
12-
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
12+
// Copyright (c) 2007, Applied Informatics Software Engineering GmbH.
1313
// and Contributors.
1414
//
1515
// Permission is hereby granted, free of charge, to any person or organization

‎Foundation/include/Poco/Platform_WIN32.h‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// Platform_WIN32.h
33
//
4-
// $Id: //poco/Main/Foundation/include/Poco/Platform_WIN32.h#3 $
4+
// $Id: //poco/Main/Foundation/include/Poco/Platform_WIN32.h#4 $
55
//
66
// Library: Foundation
77
// Package: Core
@@ -69,9 +69,6 @@
6969
#if defined(UNICODE) && !defined(POCO_WIN32_UTF8)
7070
#define POCO_WIN32_UTF8
7171
#endif
72-
#if defined(POCO_WIN32_UTF8) && !defined(UNICODE)
73-
#define UNICODE
74-
#endif
7572

7673

7774
// Turn off some annoying warnings

‎Foundation/include/Poco/RegularExpression.h‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// RegularExpression.h
33
//
4-
// $Id: //poco/Main/Foundation/include/Poco/RegularExpression.h#4 $
4+
// $Id: //poco/Main/Foundation/include/Poco/RegularExpression.h#5 $
55
//
66
// Library: Foundation
77
// Package: RegExp
@@ -77,9 +77,9 @@ class Foundation_API RegularExpression
7777
/// some can be passed only to matching functions, and some can be used
7878
/// everywhere.
7979
///
80-
/// * Options marked [ctor] can be passed to the constructor.
81-
/// * Options marked [match] can be passed to match, extract, split and subst.
82-
/// * Options marked [subst] can be passed to subst.
80+
/// * Options marked [ctor] can be passed to the constructor.
81+
/// * Options marked [match] can be passed to match, extract, split and subst.
82+
/// * Options marked [subst] can be passed to subst.
8383
///
8484
/// See the PCRE documentation for more information.
8585
{

‎Foundation/src/Environment_WIN32U.cpp‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// Environment_WIN32U.cpp
33
//
4-
// $Id: //poco/Main/Foundation/src/Environment_WIN32U.cpp#6 $
4+
// $Id: //poco/Main/Foundation/src/Environment_WIN32U.cpp#7 $
55
//
66
// Library: Foundation
77
// Package: Core
@@ -105,9 +105,9 @@ std::string EnvironmentImpl::osNameImpl()
105105

106106
std::string EnvironmentImpl::osVersionImpl()
107107
{
108-
OSVERSIONINFO vi;
108+
OSVERSIONINFOW vi;
109109
vi.dwOSVersionInfoSize = sizeof(vi);
110-
if (GetVersionEx(&vi) == 0) throw SystemException("Cannot get OS version information");
110+
if (GetVersionExW(&vi) == 0) throw SystemException("Cannot get OS version information");
111111
std::ostringstream str;
112112
str << vi.dwMajorVersion << "." << vi.dwMinorVersion << " (Build " << (vi.dwBuildNumber & 0xFFFF);
113113
std::string version;

0 commit comments

Comments
 (0)