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

@ -6,17 +6,11 @@ include_directories( include ${APACHE_INCLUDE_DIR} ${APRUTIL_INCLUDE_DIR} )
aux_source_directory(src SRCS) aux_source_directory(src SRCS)
add_library( ${LIBNAME} SHARED ${SRCS} ) add_library( ${LIBNAME} SHARED ${SRCS} )
set_target_properties( ${LIBNAME} set_target_properties( ${LIBNAME} PROPERTIES COMPILE_FLAGS ${RELEASE_CXX_FLAGS} VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION} )
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})
target_link_libraries( ${LIBNAME} ) target_link_libraries( ${LIBNAME} )
add_library( ${LIBNAMED} SHARED ${SRCS} ) add_library( ${LIBNAMED} SHARED ${SRCS} )
set_target_properties( ${LIBNAMED} set_target_properties( ${LIBNAMED} PROPERTIES COMPILE_FLAGS ${DEBUG_CXX_FLAGS} VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION} )
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})
target_link_libraries( ${LIBNAMED} ) target_link_libraries( ${LIBNAMED} )
if (ENABLE_TESTS) if (ENABLE_TESTS)

View File

@ -2,6 +2,8 @@ PROJECT(Poco)
cmake_minimum_required(VERSION 2.8.0) cmake_minimum_required(VERSION 2.8.0)
set(SHARED_LIBRARY_VERSION "12")
set(CPACK_PACKAGE_VERSION_MAJOR "1") set(CPACK_PACKAGE_VERSION_MAJOR "1")
set(CPACK_PACKAGE_VERSION_MINOR "4") set(CPACK_PACKAGE_VERSION_MINOR "4")
set(CPACK_PACKAGE_VERSION_PATCH "99") set(CPACK_PACKAGE_VERSION_PATCH "99")

View File

@ -6,13 +6,13 @@ aux_source_directory(src SRCS)
add_library( ${LIBNAME} ${LIB_MODE} ${SRCS} ) add_library( ${LIBNAME} ${LIB_MODE} ${SRCS} )
set_target_properties( ${LIBNAME} set_target_properties( ${LIBNAME}
PROPERTIES COMPILE_FLAGS ${RELEASE_CXX_FLAGS} PROPERTIES COMPILE_FLAGS ${RELEASE_CXX_FLAGS}
VERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH} VERSION "1"
SOVERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}) SOVERSION "1")
target_link_libraries( ${LIBNAME} ) target_link_libraries( ${LIBNAME} )
add_library( ${LIBNAMED} ${LIB_MODE} ${SRCS} ) add_library( ${LIBNAMED} ${LIB_MODE} ${SRCS} )
set_target_properties( ${LIBNAMED} set_target_properties( ${LIBNAMED}
PROPERTIES COMPILE_FLAGS "${DEBUG_CXX_FLAGS}" PROPERTIES COMPILE_FLAGS "${DEBUG_CXX_FLAGS}"
VERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH} VERSION "1"
SOVERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}) SOVERSION "1")
target_link_libraries( ${LIBNAMED} ) target_link_libraries( ${LIBNAMED} )

View File

@ -6,17 +6,13 @@ aux_source_directory(src SRCS)
include_directories( include) include_directories( include)
add_library( ${LIBNAME} ${LIB_MODE} ${SRCS} ) add_library( ${LIBNAME} ${LIB_MODE} ${SRCS} )
set_target_properties( ${LIBNAME} set_target_properties( ${LIBNAME} PROPERTIES COMPILE_FLAGS ${RELEASE_CXX_FLAGS} VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION} )
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})
target_link_libraries( ${LIBNAME} PocoNetSSL PocoNet ssl crypto) target_link_libraries( ${LIBNAME} PocoNetSSL PocoNet ssl crypto)
add_library( ${LIBNAMED} ${LIB_MODE} ${SRCS} ) add_library( ${LIBNAMED} ${LIB_MODE} ${SRCS} )
set_target_properties( ${LIBNAMED} set_target_properties( ${LIBNAMED}
PROPERTIES COMPILE_FLAGS "${DEBUG_CXX_FLAGS}" PROPERTIES COMPILE_FLAGS "${DEBUG_CXX_FLAGS}"
VERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH} VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION} )
SOVERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH})
target_link_libraries( ${LIBNAMED} PocoNetSSLd PocoNetd ssl crypto) target_link_libraries( ${LIBNAMED} PocoNetSSLd PocoNetd ssl crypto)
install( install(

View File

@ -8,15 +8,13 @@ include_directories( SQLite/include )
add_library( ${LIBNAME} ${LIB_MODE} ${SRCS} ) add_library( ${LIBNAME} ${LIB_MODE} ${SRCS} )
set_target_properties( ${LIBNAME} set_target_properties( ${LIBNAME}
PROPERTIES COMPILE_FLAGS ${RELEASE_CXX_FLAGS} PROPERTIES COMPILE_FLAGS ${RELEASE_CXX_FLAGS}
VERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH} VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION} )
SOVERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH})
target_link_libraries( ${LIBNAME} PocoFoundation ) target_link_libraries( ${LIBNAME} PocoFoundation )
add_library( ${LIBNAMED} ${LIB_MODE} ${SRCS} ) add_library( ${LIBNAMED} ${LIB_MODE} ${SRCS} )
set_target_properties( ${LIBNAMED} set_target_properties( ${LIBNAMED}
PROPERTIES COMPILE_FLAGS "${DEBUG_CXX_FLAGS}" PROPERTIES COMPILE_FLAGS "${DEBUG_CXX_FLAGS}"
VERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH} VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION} )
SOVERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH})
target_link_libraries( ${LIBNAMED} PocoFoundationd ) target_link_libraries( ${LIBNAMED} PocoFoundationd )
install( install(

View File

@ -12,15 +12,13 @@ include_directories( include ${MYSQL_INCLUDE_DIR})
add_library( ${LIBNAME} ${LIB_MODE} ${SRCS} ) add_library( ${LIBNAME} ${LIB_MODE} ${SRCS} )
set_target_properties( ${LIBNAME} set_target_properties( ${LIBNAME}
PROPERTIES COMPILE_FLAGS ${RELEASE_CXX_FLAGS} PROPERTIES COMPILE_FLAGS ${RELEASE_CXX_FLAGS}
VERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH} VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION} )
SOVERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH})
target_link_libraries( ${LIBNAME} PocoData PocoFoundation ${MYSQL_LIB}) target_link_libraries( ${LIBNAME} PocoData PocoFoundation ${MYSQL_LIB})
add_library( ${LIBNAMED} ${LIB_MODE} ${SRCS} ) add_library( ${LIBNAMED} ${LIB_MODE} ${SRCS} )
set_target_properties( ${LIBNAMED} set_target_properties( ${LIBNAMED}
PROPERTIES COMPILE_FLAGS "${DEBUG_CXX_FLAGS}" PROPERTIES COMPILE_FLAGS "${DEBUG_CXX_FLAGS}"
VERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH} VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION} )
SOVERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH})
target_link_libraries( ${LIBNAMED} PocoDatad PocoFoundationd ${MYSQL_LIB}) target_link_libraries( ${LIBNAMED} PocoDatad PocoFoundationd ${MYSQL_LIB})
install( install(

View File

@ -25,15 +25,13 @@ include_directories( include )
add_library( ${LIBNAME} ${LIB_MODE} ${SRCS} ) add_library( ${LIBNAME} ${LIB_MODE} ${SRCS} )
set_target_properties( ${LIBNAME} set_target_properties( ${LIBNAME}
PROPERTIES COMPILE_FLAGS ${RELEASE_CXX_FLAGS} PROPERTIES COMPILE_FLAGS ${RELEASE_CXX_FLAGS}
VERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH} VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION} )
SOVERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH})
target_link_libraries( ${LIBNAME} PocoData PocoFoundation ${ODBC_LINK_FLAGS}) target_link_libraries( ${LIBNAME} PocoData PocoFoundation ${ODBC_LINK_FLAGS})
add_library( ${LIBNAMED} ${LIB_MODE} ${SRCS} ) add_library( ${LIBNAMED} ${LIB_MODE} ${SRCS} )
set_target_properties( ${LIBNAMED} set_target_properties( ${LIBNAMED}
PROPERTIES COMPILE_FLAGS "${DEBUG_CXX_FLAGS}" PROPERTIES COMPILE_FLAGS "${DEBUG_CXX_FLAGS}"
VERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH} VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION} )
SOVERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH})
target_link_libraries( ${LIBNAMED} PocoDatad PocoFoundationd ${ODBC_LINK_FLAGS}) target_link_libraries( ${LIBNAMED} PocoDatad PocoFoundationd ${ODBC_LINK_FLAGS})
install( install(

View File

@ -11,15 +11,13 @@ add_definitions(-DSQLITE_THREADSAFE=1 -DSQLITE_DISABLE_LFS -DSQLITE_OMIT_UTF16 -
add_library( ${LIBNAME} ${LIB_MODE} ${SRCS} ) add_library( ${LIBNAME} ${LIB_MODE} ${SRCS} )
set_target_properties( ${LIBNAME} set_target_properties( ${LIBNAME}
PROPERTIES COMPILE_FLAGS ${RELEASE_CXX_FLAGS} PROPERTIES COMPILE_FLAGS ${RELEASE_CXX_FLAGS}
VERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH} VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION} )
SOVERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH})
target_link_libraries( ${LIBNAME} PocoData PocoFoundation) target_link_libraries( ${LIBNAME} PocoData PocoFoundation)
add_library( ${LIBNAMED} ${LIB_MODE} ${SRCS} ) add_library( ${LIBNAMED} ${LIB_MODE} ${SRCS} )
set_target_properties( ${LIBNAMED} set_target_properties( ${LIBNAMED}
PROPERTIES COMPILE_FLAGS "${DEBUG_CXX_FLAGS}" PROPERTIES COMPILE_FLAGS "${DEBUG_CXX_FLAGS}"
VERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH} VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION} )
SOVERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH})
target_link_libraries( ${LIBNAMED} PocoDatad PocoFoundationd ) target_link_libraries( ${LIBNAMED} PocoDatad PocoFoundationd )
install( install(

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -23,15 +23,13 @@ endif (NOT POCO_STATIC)
add_library( ${LIBNAME} ${LIB_MODE} ${SRCS} ) add_library( ${LIBNAME} ${LIB_MODE} ${SRCS} )
set_target_properties( ${LIBNAME} set_target_properties( ${LIBNAME}
PROPERTIES COMPILE_FLAGS ${RELEASE_CXX_FLAGS} PROPERTIES COMPILE_FLAGS ${RELEASE_CXX_FLAGS}
VERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH} VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION} )
SOVERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH})
target_link_libraries( ${LIBNAME} PocoFoundation ${SYSLIBS}) target_link_libraries( ${LIBNAME} PocoFoundation ${SYSLIBS})
add_library( ${LIBNAMED} ${LIB_MODE} ${SRCS} ) add_library( ${LIBNAMED} ${LIB_MODE} ${SRCS} )
set_target_properties( ${LIBNAMED} set_target_properties( ${LIBNAMED}
PROPERTIES COMPILE_FLAGS "${DEBUG_CXX_FLAGS}" PROPERTIES COMPILE_FLAGS "${DEBUG_CXX_FLAGS}"
VERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH} VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION} )
SOVERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH})
target_link_libraries( ${LIBNAMED} PocoFoundationd ${SYSLIBS}) target_link_libraries( ${LIBNAMED} PocoFoundationd ${SYSLIBS})
install( install(

View File

@ -6,15 +6,13 @@ aux_source_directory(src SRCS)
add_library( ${LIBNAME} ${LIB_MODE} ${SRCS} ) add_library( ${LIBNAME} ${LIB_MODE} ${SRCS} )
set_target_properties( ${LIBNAME} set_target_properties( ${LIBNAME}
PROPERTIES COMPILE_FLAGS ${RELEASE_CXX_FLAGS} PROPERTIES COMPILE_FLAGS ${RELEASE_CXX_FLAGS}
VERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH} VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION} )
SOVERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH})
target_link_libraries( ${LIBNAME} ssl crypto) target_link_libraries( ${LIBNAME} ssl crypto)
add_library( ${LIBNAMED} ${LIB_MODE} ${SRCS} ) add_library( ${LIBNAMED} ${LIB_MODE} ${SRCS} )
set_target_properties( ${LIBNAMED} set_target_properties( ${LIBNAMED}
PROPERTIES COMPILE_FLAGS "${DEBUG_CXX_FLAGS}" PROPERTIES COMPILE_FLAGS "${DEBUG_CXX_FLAGS}"
VERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH} VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION} )
SOVERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH})
target_link_libraries( ${LIBNAMED} ssl crypto) target_link_libraries( ${LIBNAMED} ssl crypto)
install( install(

View File

@ -45,15 +45,13 @@ endif(CMAKE_SYSTEM MATCHES "Windows")
add_library( ${LIBNAME} ${LIB_MODE} ${SRCS} ) add_library( ${LIBNAME} ${LIB_MODE} ${SRCS} )
set_target_properties( ${LIBNAME} set_target_properties( ${LIBNAME}
PROPERTIES COMPILE_FLAGS ${RELEASE_CXX_FLAGS} PROPERTIES COMPILE_FLAGS ${RELEASE_CXX_FLAGS}
VERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH} VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION} )
SOVERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH})
target_link_libraries( ${LIBNAME} PocoXML PocoFoundation) target_link_libraries( ${LIBNAME} PocoXML PocoFoundation)
add_library( ${LIBNAMED} ${LIB_MODE} ${SRCS} ) add_library( ${LIBNAMED} ${LIB_MODE} ${SRCS} )
set_target_properties( ${LIBNAMED} set_target_properties( ${LIBNAMED}
PROPERTIES COMPILE_FLAGS "${DEBUG_CXX_FLAGS}" PROPERTIES COMPILE_FLAGS "${DEBUG_CXX_FLAGS}"
VERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH} VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION} )
SOVERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH})
target_link_libraries( ${LIBNAMED} PocoXMLd PocoFoundationd ) target_link_libraries( ${LIBNAMED} PocoXMLd PocoFoundationd )
install( install(

View File

@ -7,15 +7,13 @@ aux_source_directory(src SRCS)
add_library( ${LIBNAME} ${LIB_MODE} ${SRCS} ) add_library( ${LIBNAME} ${LIB_MODE} ${SRCS} )
set_target_properties( ${LIBNAME} set_target_properties( ${LIBNAME}
PROPERTIES COMPILE_FLAGS ${RELEASE_CXX_FLAGS} PROPERTIES COMPILE_FLAGS ${RELEASE_CXX_FLAGS}
VERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH} VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION} )
SOVERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH})
target_link_libraries( ${LIBNAME} PocoNet PocoUtil PocoXML PocoFoundation ) target_link_libraries( ${LIBNAME} PocoNet PocoUtil PocoXML PocoFoundation )
add_library( ${LIBNAMED} ${LIB_MODE} ${SRCS} ) add_library( ${LIBNAMED} ${LIB_MODE} ${SRCS} )
set_target_properties( ${LIBNAMED} set_target_properties( ${LIBNAMED}
PROPERTIES COMPILE_FLAGS "${DEBUG_CXX_FLAGS}" PROPERTIES COMPILE_FLAGS "${DEBUG_CXX_FLAGS}"
VERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH} VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION} )
SOVERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH})
target_link_libraries( ${LIBNAMED} PocoNetd PocoUtild PocoXMLd PocoFoundationd ) target_link_libraries( ${LIBNAMED} PocoNetd PocoUtild PocoXMLd PocoFoundationd )
install( install(

View File

@ -8,15 +8,13 @@ add_definitions(-DXML_NS -DXML_DTD -DHAVE_EXPAT_CONFIG_H)
add_library( ${LIBNAME} ${LIB_MODE} ${SRCS} ) add_library( ${LIBNAME} ${LIB_MODE} ${SRCS} )
set_target_properties( ${LIBNAME} set_target_properties( ${LIBNAME}
PROPERTIES COMPILE_FLAGS ${RELEASE_CXX_FLAGS} PROPERTIES COMPILE_FLAGS ${RELEASE_CXX_FLAGS}
VERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH} VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION} )
SOVERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH})
target_link_libraries( ${LIBNAME} PocoFoundation) target_link_libraries( ${LIBNAME} PocoFoundation)
add_library( ${LIBNAMED} ${LIB_MODE} ${SRCS} ) add_library( ${LIBNAMED} ${LIB_MODE} ${SRCS} )
set_target_properties( ${LIBNAMED} set_target_properties( ${LIBNAMED}
PROPERTIES COMPILE_FLAGS "${DEBUG_CXX_FLAGS}" PROPERTIES COMPILE_FLAGS "${DEBUG_CXX_FLAGS}"
VERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH} VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION} )
SOVERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH})
target_link_libraries( ${LIBNAMED} PocoFoundationd) target_link_libraries( ${LIBNAMED} PocoFoundationd)
install( install(

View File

@ -68,20 +68,20 @@ void XMLWriterTest::testTrivial()
void XMLWriterTest::testTrivialCanonical() void XMLWriterTest::testTrivialCanonical()
{ {
std::ostringstream str; std::ostringstream str;
XMLWriter writer(str, XMLWriter::CANONICAL_XML); XMLWriter writer(str, XMLWriter::CANONICAL_XML);
writer.startDocument(); writer.startDocument();
writer.startElement("", "", "foo"); writer.startElement("", "", "foo");
writer.endElement("", "", "foo"); writer.endElement("", "", "foo");
writer.endDocument(); writer.endDocument();
std::string xml = str.str(); std::string xml = str.str();
assert (xml == "<foo></foo>"); assert (xml == "<foo></foo>");
} }
void XMLWriterTest::testTrivialDecl() void XMLWriterTest::testTrivialDecl()
{ {
std::ostringstream str; std::ostringstream str;
XMLWriter writer(str, XMLWriter::WRITE_XML_DECLARATION); XMLWriter writer(str, XMLWriter::WRITE_XML_DECLARATION);
writer.startDocument(); writer.startDocument();
writer.startElement("", "", "foo"); writer.startElement("", "", "foo");
@ -237,18 +237,18 @@ void XMLWriterTest::testAttributes()
void XMLWriterTest::testAttributesPretty() void XMLWriterTest::testAttributesPretty()
{ {
std::ostringstream str; std::ostringstream str;
XMLWriter writer(str, XMLWriter::PRETTY_PRINT | XMLWriter::PRETTY_PRINT_ATTRIBUTES); XMLWriter writer(str, XMLWriter::PRETTY_PRINT | XMLWriter::PRETTY_PRINT_ATTRIBUTES);
writer.setNewLine(XMLWriter::NEWLINE_LF); writer.setNewLine(XMLWriter::NEWLINE_LF);
writer.startDocument(); writer.startDocument();
AttributesImpl attrs; AttributesImpl attrs;
attrs.addAttribute("", "", "a1", "CDATA", "v1"); attrs.addAttribute("", "", "a1", "CDATA", "v1");
attrs.addAttribute("", "", "a2", "CDATA", "v2"); attrs.addAttribute("", "", "a2", "CDATA", "v2");
writer.startElement("", "", "el", attrs); writer.startElement("", "", "el", attrs);
writer.endElement("", "", "el"); writer.endElement("", "", "el");
writer.endDocument(); writer.endDocument();
std::string xml = str.str(); std::string xml = str.str();
assert (xml == "<el\n\ta1=\"v1\"\n\ta2=\"v2\"/>\n"); assert (xml == "<el\n\ta1=\"v1\"\n\ta2=\"v2\"/>\n");
} }
@ -402,17 +402,17 @@ void XMLWriterTest::testRawCharacters()
void XMLWriterTest::testAttributeCharacters() void XMLWriterTest::testAttributeCharacters()
{ {
std::ostringstream str; std::ostringstream str;
XMLWriter writer(str, 0); XMLWriter writer(str, 0);
writer.startDocument(); writer.startDocument();
AttributesImpl attrs; AttributesImpl attrs;
attrs.addAttribute("", "", "a1", "CDATA", "a b c\n\td"); attrs.addAttribute("", "", "a1", "CDATA", "a b c\n\td");
attrs.addAttribute("", "", "a2", "CDATA", "a b c\r\nd"); attrs.addAttribute("", "", "a2", "CDATA", "a b c\r\nd");
writer.startElement("", "", "el", attrs); writer.startElement("", "", "el", attrs);
writer.endElement("", "", "el"); writer.endElement("", "", "el");
writer.endDocument(); writer.endDocument();
std::string xml = str.str(); std::string xml = str.str();
assert (xml == "<el a1=\"a b c&#xA;&#x9;d\" a2=\"a b c&#xD;&#xA;d\"/>"); assert (xml == "<el a1=\"a b c&#xA;&#x9;d\" a2=\"a b c&#xD;&#xA;d\"/>");
} }
@ -487,7 +487,7 @@ void XMLWriterTest::testAttributeNamespaces()
writer.endElement("urn:ns", "r", ""); writer.endElement("urn:ns", "r", "");
writer.endDocument(); writer.endDocument();
std::string xml = str.str(); std::string xml = str.str();
assert (xml == "<ns1:r myattr2=\"attrValue2\" ns2:myattr=\"attrValue\" xmlns:ns1=\"urn:ns\" xmlns:ns2=\"urn:other\">data</ns1:r>"); assert (xml == "<ns2:r ns1:myattr=\"attrValue\" ns2:myattr2=\"attrValue2\" xmlns:ns1=\"urn:other\" xmlns:ns2=\"urn:ns\">data</ns2:r>");
} }
@ -611,34 +611,34 @@ void XMLWriterTest::tearDown()
CppUnit::Test* XMLWriterTest::suite() CppUnit::Test* XMLWriterTest::suite()
{ {
CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("XMLWriterTest"); CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("XMLWriterTest");
CppUnit_addTest(pSuite, XMLWriterTest, testTrivial); CppUnit_addTest(pSuite, XMLWriterTest, testTrivial);
CppUnit_addTest(pSuite, XMLWriterTest, testTrivialCanonical); CppUnit_addTest(pSuite, XMLWriterTest, testTrivialCanonical);
CppUnit_addTest(pSuite, XMLWriterTest, testTrivialDecl); CppUnit_addTest(pSuite, XMLWriterTest, testTrivialDecl);
CppUnit_addTest(pSuite, XMLWriterTest, testTrivialDeclPretty); CppUnit_addTest(pSuite, XMLWriterTest, testTrivialDeclPretty);
CppUnit_addTest(pSuite, XMLWriterTest, testTrivialFragment); CppUnit_addTest(pSuite, XMLWriterTest, testTrivialFragment);
CppUnit_addTest(pSuite, XMLWriterTest, testTrivialFragmentPretty); CppUnit_addTest(pSuite, XMLWriterTest, testTrivialFragmentPretty);
CppUnit_addTest(pSuite, XMLWriterTest, testDTDPretty); CppUnit_addTest(pSuite, XMLWriterTest, testDTDPretty);
CppUnit_addTest(pSuite, XMLWriterTest, testDTD); CppUnit_addTest(pSuite, XMLWriterTest, testDTD);
CppUnit_addTest(pSuite, XMLWriterTest, testDTDNotation); CppUnit_addTest(pSuite, XMLWriterTest, testDTDNotation);
CppUnit_addTest(pSuite, XMLWriterTest, testDTDEntity); CppUnit_addTest(pSuite, XMLWriterTest, testDTDEntity);
CppUnit_addTest(pSuite, XMLWriterTest, testAttributes); CppUnit_addTest(pSuite, XMLWriterTest, testAttributes);
CppUnit_addTest(pSuite, XMLWriterTest, testAttributesPretty); CppUnit_addTest(pSuite, XMLWriterTest, testAttributesPretty);
CppUnit_addTest(pSuite, XMLWriterTest, testData); CppUnit_addTest(pSuite, XMLWriterTest, testData);
CppUnit_addTest(pSuite, XMLWriterTest, testEmptyData); CppUnit_addTest(pSuite, XMLWriterTest, testEmptyData);
CppUnit_addTest(pSuite, XMLWriterTest, testDataPretty); CppUnit_addTest(pSuite, XMLWriterTest, testDataPretty);
CppUnit_addTest(pSuite, XMLWriterTest, testEmptyDataPretty); CppUnit_addTest(pSuite, XMLWriterTest, testEmptyDataPretty);
CppUnit_addTest(pSuite, XMLWriterTest, testComment); CppUnit_addTest(pSuite, XMLWriterTest, testComment);
CppUnit_addTest(pSuite, XMLWriterTest, testPI); CppUnit_addTest(pSuite, XMLWriterTest, testPI);
CppUnit_addTest(pSuite, XMLWriterTest, testCharacters); CppUnit_addTest(pSuite, XMLWriterTest, testCharacters);
CppUnit_addTest(pSuite, XMLWriterTest, testEmptyCharacters); CppUnit_addTest(pSuite, XMLWriterTest, testEmptyCharacters);
CppUnit_addTest(pSuite, XMLWriterTest, testCDATA); CppUnit_addTest(pSuite, XMLWriterTest, testCDATA);
CppUnit_addTest(pSuite, XMLWriterTest, testRawCharacters); CppUnit_addTest(pSuite, XMLWriterTest, testRawCharacters);
CppUnit_addTest(pSuite, XMLWriterTest, testAttributeCharacters); CppUnit_addTest(pSuite, XMLWriterTest, testAttributeCharacters);
CppUnit_addTest(pSuite, XMLWriterTest, testDefaultNamespace); CppUnit_addTest(pSuite, XMLWriterTest, testDefaultNamespace);
CppUnit_addTest(pSuite, XMLWriterTest, testQNamespaces); CppUnit_addTest(pSuite, XMLWriterTest, testQNamespaces);
CppUnit_addTest(pSuite, XMLWriterTest, testQNamespacesNested); CppUnit_addTest(pSuite, XMLWriterTest, testQNamespacesNested);
CppUnit_addTest(pSuite, XMLWriterTest, testNamespaces); CppUnit_addTest(pSuite, XMLWriterTest, testNamespaces);
CppUnit_addTest(pSuite, XMLWriterTest, testAttributeNamespaces); CppUnit_addTest(pSuite, XMLWriterTest, testAttributeNamespaces);
CppUnit_addTest(pSuite, XMLWriterTest, testNamespacesNested); CppUnit_addTest(pSuite, XMLWriterTest, testNamespacesNested);

View File

@ -6,15 +6,13 @@ aux_source_directory(src SRCS)
add_library( ${LIBNAME} ${LIB_MODE} ${SRCS} ) add_library( ${LIBNAME} ${LIB_MODE} ${SRCS} )
set_target_properties( ${LIBNAME} set_target_properties( ${LIBNAME}
PROPERTIES COMPILE_FLAGS ${RELEASE_CXX_FLAGS} PROPERTIES COMPILE_FLAGS ${RELEASE_CXX_FLAGS}
VERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH} VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION} )
SOVERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH})
target_link_libraries( ${LIBNAME} PocoUtil PocoXML PocoFoundation) target_link_libraries( ${LIBNAME} PocoUtil PocoXML PocoFoundation)
add_library( ${LIBNAMED} ${LIB_MODE} ${SRCS} ) add_library( ${LIBNAMED} ${LIB_MODE} ${SRCS} )
set_target_properties( ${LIBNAMED} set_target_properties( ${LIBNAMED}
PROPERTIES COMPILE_FLAGS "${DEBUG_CXX_FLAGS}" PROPERTIES COMPILE_FLAGS "${DEBUG_CXX_FLAGS}"
VERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH} VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION} )
SOVERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH})
target_link_libraries( ${LIBNAMED} PocoUtild PocoXMLd PocoFoundationd) target_link_libraries( ${LIBNAMED} PocoUtild PocoXMLd PocoFoundationd)
install( install(