Set cmake produced shared libraries numbering to standard scheme (trunk = 12)

Sync latest Foundation changes from 1.4.2
This commit is contained in:
Marian Krivos
2011-09-15 08:31:51 +00:00
parent 54a7860bff
commit eb266f8a57
25 changed files with 270 additions and 292 deletions

View File

@@ -30,8 +30,6 @@ set( BASE_SRCS
src/DigestEngine.cpp
src/DigestStream.cpp
src/DirectoryIterator.cpp
# src/DynamicAny.cpp
# src/DynamicAnyHolder.cpp
src/Environment.cpp
src/ErrorHandler.cpp
src/Event.cpp
@@ -195,20 +193,14 @@ else (CMAKE_SYSTEM MATCHES "Windows")
endif(CMAKE_SYSTEM MATCHES "Windows")
add_library( ${LIBNAME} ${LIB_MODE} ${SRCS} )
set_target_properties( ${LIBNAME}
PROPERTIES COMPILE_FLAGS ${RELEASE_CXX_FLAGS}
VERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}
SOVERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH})
set_target_properties( ${LIBNAME} PROPERTIES COMPILE_FLAGS ${RELEASE_CXX_FLAGS} VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION} )
if (${CMAKE_CXX_COMPILER_ID} MATCHES "SunPro")
set_target_properties( ${LIBNAME} PROPERTIES LINK_FLAGS "-library=stlport4")
endif (${CMAKE_CXX_COMPILER_ID} MATCHES "SunPro")
target_link_libraries( ${LIBNAME} ${SYSLIBS})
add_library( ${LIBNAMED} ${LIB_MODE} ${SRCS} )
set_target_properties( ${LIBNAMED}
PROPERTIES COMPILE_FLAGS "${DEBUG_CXX_FLAGS}"
VERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}
SOVERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH})
set_target_properties( ${LIBNAMED} PROPERTIES COMPILE_FLAGS ${DEBUG_CXX_FLAGS} VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION} )
if (${CMAKE_CXX_COMPILER_ID} MATCHES "SunPro")
set_target_properties( ${LIBNAMED} PROPERTIES LINK_FLAGS "-library=stlport4")
endif (${CMAKE_CXX_COMPILER_ID} MATCHES "SunPro")

View File

@@ -157,33 +157,33 @@ public:
/// On such platforms, created() returns
/// the time of the last inode modification.
Timestamp getLastModified() const;
/// Returns the modification date of the file.
void setLastModified(const Timestamp& ts);
/// Sets the modification date of the file.
FileSize getSize() const;
/// Returns the size of the file in bytes.
void setSize(FileSize size);
/// Sets the size of the file in bytes. Can be used
/// to truncate a file.
void setWriteable(bool flag = true);
/// Makes the file writeable (if flag is true), or
/// non-writeable (if flag is false) by setting the
/// file's flags in the filesystem accordingly.
void setReadOnly(bool flag = true);
/// Makes the file non-writeable (if flag is true), or
/// writeable (if flag is false) by setting the
/// file's flags in the filesystem accordingly.
void setExecutable(bool flag = true);
/// Makes the file executable (if flag is true), or
/// non-executable (if flag is false) by setting
/// the file's permission bits accordingly.
Timestamp getLastModified() const;
/// Returns the modification date of the file.
File& setLastModified(const Timestamp& ts);
/// Sets the modification date of the file.
FileSize getSize() const;
/// Returns the size of the file in bytes.
File& setSize(FileSize size);
/// Sets the size of the file in bytes. Can be used
/// to truncate a file.
File& setWriteable(bool flag = true);
/// Makes the file writeable (if flag is true), or
/// non-writeable (if flag is false) by setting the
/// file's flags in the filesystem accordingly.
File& setReadOnly(bool flag = true);
/// Makes the file non-writeable (if flag is true), or
/// writeable (if flag is false) by setting the
/// file's flags in the filesystem accordingly.
File& setExecutable(bool flag = true);
/// Makes the file executable (if flag is true), or
/// non-executable (if flag is false) by setting
/// the file's permission bits accordingly.
///
/// Does nothing on Windows and OpenVMS.

View File

@@ -36,8 +36,8 @@
//
#ifndef Foundation_LRUCache_INCLUDED
#define Foundation_LRUCache_INCLUDED
#ifndef Foundation_LRUCache_INCLUDED
#define Foundation_LRUCache_INCLUDED
#include "Poco/AbstractCache.h"
@@ -51,13 +51,13 @@ template <
class TKey,
class TValue,
class TMutex = FastMutex,
class TEventMutex = FastMutex
class TEventMutex = FastMutex
>
class LRUCache: public AbstractCache<TKey, TValue, LRUStrategy<TKey, TValue>, TMutex, TEventMutex >
/// An LRUCache implements Least Recently Used caching. The default size for a cache is 1024 entries
class LRUCache: public AbstractCache<TKey, TValue, LRUStrategy<TKey, TValue>, TMutex, TEventMutex>
/// An LRUCache implements Least Recently Used caching. The default size for a cache is 1024 entries.
{
public:
LRUCache(long size = 1024):
LRUCache(long size = 1024):
AbstractCache<TKey, TValue, LRUStrategy<TKey, TValue>, TMutex, TEventMutex>(LRUStrategy<TKey, TValue>(size))
{
}
@@ -75,4 +75,4 @@ private:
} // namespace Poco
#endif
#endif // Foundation_LRUCache_INCLUDED

View File

@@ -206,21 +206,21 @@ public:
/// (the filename part is empty).
bool isFile() const;
/// Returns true iff the path references a file
/// (the filename part is not empty).
void setNode(const std::string& node);
/// Sets the node name.
/// Setting a non-empty node automatically makes
/// the path an absolute one.
/// Returns true iff the path references a file
/// (the filename part is not empty).
Path& setNode(const std::string& node);
/// Sets the node name.
/// Setting a non-empty node automatically makes
/// the path an absolute one.
const std::string& getNode() const;
/// Returns the node name.
void setDevice(const std::string& device);
/// Sets the device name.
/// Setting a non-empty device automatically makes
/// the path an absolute one.
const std::string& getNode() const;
/// Returns the node name.
Path& setDevice(const std::string& device);
/// Sets the device name.
/// Setting a non-empty device automatically makes
/// the path an absolute one.
const std::string& getDevice() const;
/// Returns the device name.
@@ -233,45 +233,45 @@ public:
/// If n == depth(), returns the filename.
const std::string& operator [] (int n) const;
/// Returns the n'th directory in the directory list.
/// If n == depth(), returns the filename.
void pushDirectory(const std::string& dir);
/// Adds a directory to the directory list.
void popDirectory();
/// Returns the n'th directory in the directory list.
/// If n == depth(), returns the filename.
Path& pushDirectory(const std::string& dir);
/// Adds a directory to the directory list.
Path& popDirectory();
/// Removes the last directory from the directory list.
void popFrontDirectory();
Path& popFrontDirectory();
/// Removes the first directory from the directory list.
void setFileName(const std::string& name);
Path& setFileName(const std::string& name);
/// Sets the filename.
const std::string& getFileName() const;
/// Returns the filename.
const std::string& getFileName() const;
/// Returns the filename.
void setBaseName(const std::string& name);
/// Sets the basename part of the filename and
/// does not change the extension.
Path& setBaseName(const std::string& name);
/// Sets the basename part of the filename and
/// does not change the extension.
std::string getBaseName() const;
/// Returns the basename (the filename sans
/// extension) of the path.
/// Returns the basename (the filename sans
/// extension) of the path.
void setExtension(const std::string& extension);
/// Sets the filename extension.
std::string getExtension() const;
Path& setExtension(const std::string& extension);
/// Sets the filename extension.
std::string getExtension() const;
/// Returns the filename extension.
const std::string& version() const;
/// Returns the file version. VMS only.
void clear();
/// Clears all components.
const std::string& version() const;
/// Returns the file version. VMS only.
Path& clear();
/// Clears all components.
Path parent() const;
Path parent() const;
/// Returns a path referring to the path's
/// directory.

View File

@@ -47,7 +47,7 @@
namespace Poco {
#if defined(POCO_OS_FAMILY_WINDOWS) && !defined(MINGW32)
#if defined(_MSC_VER)
#define POCO_TYPEWRAPPER_DEFAULTVALUE(T) TypeWrapper<T>::TYPE()
#else
#define POCO_TYPEWRAPPER_DEFAULTVALUE(T) typename TypeWrapper<T>::TYPE()

View File

@@ -90,4 +90,4 @@ private:
} // namespace Poco
#endif
#endif // Foundation_UniqueAccessExpireLRUCache_INCLUDED

View File

@@ -54,7 +54,7 @@
// Ax are alpha releases
// Bx are beta releases
//
#define POCO_VERSION 0x01040101
#define POCO_VERSION 0x010500D0
#endif // Foundation_Version_INCLUDED

View File

@@ -189,43 +189,48 @@ Timestamp File::getLastModified() const
return getLastModifiedImpl();
}
void File::setLastModified(const Timestamp& ts)
File& File::setLastModified(const Timestamp& ts)
{
setLastModifiedImpl(ts);
setLastModifiedImpl(ts);
return *this;
}
File::FileSize File::getSize() const
{
return getSizeImpl();
}
void File::setSize(FileSizeImpl size)
File& File::setSize(FileSizeImpl size)
{
setSizeImpl(size);
setSizeImpl(size);
return *this;
}
void File::setWriteable(bool flag)
File& File::setWriteable(bool flag)
{
setWriteableImpl(flag);
setWriteableImpl(flag);
return *this;
}
void File::setReadOnly(bool flag)
File& File::setReadOnly(bool flag)
{
setWriteableImpl(!flag);
setWriteableImpl(!flag);
return *this;
}
void File::setExecutable(bool flag)
File& File::setExecutable(bool flag)
{
setExecutableImpl(flag);
setExecutableImpl(flag);
return *this;
}
void File::copyTo(const std::string& path) const
{
Path src(getPathImpl());

View File

@@ -454,20 +454,22 @@ Path& Path::resolve(const Path& path)
}
void Path::setNode(const std::string& node)
Path& Path::setNode(const std::string& node)
{
_node = node;
_absolute = _absolute || !node.empty();
_node = node;
_absolute = _absolute || !node.empty();
return *this;
}
void Path::setDevice(const std::string& device)
Path& Path::setDevice(const std::string& device)
{
_device = device;
_absolute = _absolute || !device.empty();
_device = device;
_absolute = _absolute || !device.empty();
return *this;
}
const std::string& Path::directory(int n) const
{
poco_assert (0 <= n && n <= _dirs.size());
@@ -489,11 +491,11 @@ const std::string& Path::operator [] (int n) const
return _name;
}
void Path::pushDirectory(const std::string& dir)
Path& Path::pushDirectory(const std::string& dir)
{
if (!dir.empty() && dir != ".")
{
if (!dir.empty() && dir != ".")
{
#if defined(POCO_OS_FAMILY_VMS)
if (dir == ".." || dir == "-")
{
@@ -511,44 +513,49 @@ void Path::pushDirectory(const std::string& dir)
else if (!_absolute)
_dirs.push_back(dir);
}
else _dirs.push_back(dir);
else _dirs.push_back(dir);
#endif
}
}
return *this;
}
void Path::popDirectory()
Path& Path::popDirectory()
{
poco_assert (!_dirs.empty());
_dirs.pop_back();
poco_assert (!_dirs.empty());
_dirs.pop_back();
return *this;
}
void Path::popFrontDirectory()
Path& Path::popFrontDirectory()
{
poco_assert (!_dirs.empty());
StringVec::iterator it = _dirs.begin();
_dirs.erase(it);
return *this;
}
void Path::setFileName(const std::string& name)
Path& Path::setFileName(const std::string& name)
{
_name = name;
return *this;
}
void Path::setBaseName(const std::string& name)
Path& Path::setBaseName(const std::string& name)
{
std::string ext = getExtension();
_name = name;
std::string ext = getExtension();
_name = name;
if (!ext.empty())
{
_name.append(".");
_name.append(ext);
}
_name.append(".");
_name.append(ext);
}
return *this;
}
@@ -562,17 +569,18 @@ std::string Path::getBaseName() const
}
void Path::setExtension(const std::string& extension)
Path& Path::setExtension(const std::string& extension)
{
_name = getBaseName();
if (!extension.empty())
_name = getBaseName();
if (!extension.empty())
{
_name.append(".");
_name.append(extension);
}
_name.append(".");
_name.append(extension);
}
return *this;
}
std::string Path::getExtension() const
{
std::string::size_type pos = _name.rfind('.');
@@ -583,14 +591,15 @@ std::string Path::getExtension() const
}
void Path::clear()
Path& Path::clear()
{
_node.clear();
_device.clear();
_node.clear();
_device.clear();
_name.clear();
_dirs.clear();
_version.clear();
_absolute = false;
_dirs.clear();
_version.clear();
_absolute = false;
return *this;
}
@@ -688,20 +697,20 @@ void Path::parseUnix(const std::string& path)
if (it != end)
{
if (_dirs.empty())
{
if (!name.empty() && *(name.rbegin()) == ':')
{
_absolute = true;
_device.assign(name, 0, name.length() - 1);
}
else
{
pushDirectory(name);
}
}
else pushDirectory(name);
}
else _name = name;
{
if (!name.empty() && *(name.rbegin()) == ':')
{
_absolute = true;
_device.assign(name, 0, name.length() - 1);
}
else
{
pushDirectory(name);
}
}
else pushDirectory(name);
}
else _name = name;
if (it != end) ++it;
}
}
@@ -726,17 +735,17 @@ void Path::parseWindows(const std::string& path)
}
else if (it != end)
{
char d = *it++;
if (it != end && *it == ':') // drive letter
{
if (_absolute || !((d >= 'a' && d <= 'z') || (d >= 'A' && d <= 'Z'))) throw PathSyntaxException(path);
_absolute = true;
_device += d;
++it;
if (it == end || (*it != '\\' && *it != '/')) throw PathSyntaxException(path);
++it;
}
else --it;
char d = *it++;
if (it != end && *it == ':') // drive letter
{
if (_absolute || !((d >= 'a' && d <= 'z') || (d >= 'A' && d <= 'Z'))) throw PathSyntaxException(path);
_absolute = true;
_device += d;
++it;
if (it == end || (*it != '\\' && *it != '/')) throw PathSyntaxException(path);
++it;
}
else --it;
}
while (it != end)
{

View File

@@ -44,10 +44,10 @@ namespace Poco {
std::string PathImpl::currentImpl()
{
char buffer[MAX_PATH];
DWORD n = GetCurrentDirectoryA(sizeof(buffer), buffer);
if (n > 0 && n < sizeof(buffer))
{
char buffer[MAX_PATH];
DWORD n = GetCurrentDirectoryA(sizeof(buffer), buffer);
if (n > 0 && n < sizeof(buffer))
{
std::string result(buffer, n);
if (result[n - 1] != '\\')
result.append("\\");
@@ -70,18 +70,18 @@ std::string PathImpl::homeImpl()
std::string PathImpl::tempImpl()
{
char buffer[MAX_PATH];
char buffer[MAX_PATH];
DWORD n = GetTempPathA(sizeof(buffer), buffer);
if (n > 0 && n < sizeof(buffer))
{
n = GetLongPathNameA(buffer.begin(), buffer.begin(), static_cast<DWORD>(buffer.size()));
n = GetLongPathNameA(buffer, buffer, static_cast<DWORD>(sizeof buffer));
if (n <= 0) throw SystemException("Cannot get temporary directory long path name");
std::string result(buffer, n);
if (result[n - 1] != '\\')
result.append("\\");
return result;
}
else throw SystemException("Cannot get temporary directory");
result.append("\\");
return result;
}
else throw SystemException("Cannot get temporary directory");
}
@@ -93,10 +93,10 @@ std::string PathImpl::nullImpl()
std::string PathImpl::expandImpl(const std::string& path)
{
char buffer[MAX_PATH];
DWORD n = ExpandEnvironmentStringsA(path.c_str(), buffer, sizeof(buffer));
if (n > 0 && n < sizeof(buffer))
return std::string(buffer, n - 1);
char buffer[MAX_PATH];
DWORD n = ExpandEnvironmentStringsA(path.c_str(), buffer, sizeof(buffer));
if (n > 0 && n < sizeof(buffer))
return std::string(buffer, n - 1);
else
return path;
}