You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(622) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(303) |
Feb
(64) |
Mar
(5) |
Apr
(63) |
May
(82) |
Jun
(53) |
Jul
(50) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: stephan b. <sg...@us...> - 2004-12-27 19:20:30
|
Update of /cvsroot/pclasses/pclasses2/toc/bin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8802 Removed Files: tocCreateMakefileStubs Log Message: uhralt: create_makefile_stubs.sh is much more useful --- tocCreateMakefileStubs DELETED --- |
From: stephan b. <sg...@us...> - 2004-12-27 19:18:40
|
Update of /cvsroot/pclasses/pclasses2/toc/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8425 Removed Files: boost.sh flex.sh qt.sh toc_config_h.sh Log Message: removed: not needed in this tree --- qt.sh DELETED --- --- boost.sh DELETED --- --- toc_config_h.sh DELETED --- --- flex.sh DELETED --- |
From: stephan b. <sg...@us...> - 2004-12-27 19:06:11
|
Update of /cvsroot/pclasses/pclasses2/toc/make In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5823 Removed Files: makerules.QT_MOC_DEPS makerules.QMAKE2MAKE NAMESPACE.make flex.make Log Message: removed: not needed in this tree --- makerules.QMAKE2MAKE DELETED --- --- flex.make DELETED --- --- NAMESPACE.make DELETED --- --- makerules.QT_MOC_DEPS DELETED --- |
From: stephan b. <sg...@us...> - 2004-12-27 19:02:04
|
Update of /cvsroot/pclasses/pclasses2/toc/make In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4882 Removed Files: deps.make c_bins.make cpp_bins.make cpp_static_libs.make cpp_helper.make INSTALL_XXX.make lyxport.make PCH.make qmake2make.make QMAKE2MAKE.make QT_MOC_DEPS.make qt_moc.make qt.sh symlink_headers.make toc.qmake.at Log Message: removed: not needed in this tree --- cpp_helper.make DELETED --- --- QT_MOC_DEPS.make DELETED --- --- c_bins.make DELETED --- --- qt_moc.make DELETED --- --- qt.sh DELETED --- --- INSTALL_XXX.make DELETED --- --- lyxport.make DELETED --- --- deps.make DELETED --- --- QMAKE2MAKE.make DELETED --- --- cpp_static_libs.make DELETED --- --- cpp_bins.make DELETED --- --- qmake2make.make DELETED --- --- symlink_headers.make DELETED --- --- toc.qmake.at DELETED --- --- PCH.make DELETED --- |
From: stephan b. <sg...@us...> - 2004-12-27 18:24:42
|
Update of /cvsroot/pclasses/pclasses2/src/s11n In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29703/src/s11n Modified Files: data_node_serialize.h Log Message: Removed the 3-args versions of de/serialize(). They are never used, provide nothing, and can potentially Cause Grief and Confusion. Index: data_node_serialize.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/s11n/data_node_serialize.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- data_node_serialize.h 26 Dec 2004 00:55:20 -0000 1.2 +++ data_node_serialize.h 27 Dec 2004 18:24:30 -0000 1.3 @@ -167,52 +167,6 @@ namespace s11n { - - /** - Returns func( target, src ). Note that using this function - bypasses internal API marshalling for src. This is, - however, useful in some cases. Note that if src initiates - recursive serialization on objects of it's own type the - framework will revert to using it's API marshalling, - bypassing SerializerFunctorT. A solution is sought for this - problem, but none exists yet. - */ - template <typename DataNodeType,typename SerializableT, typename SerializerFunctorT> - bool serialize( DataNodeType & target, const SerializableT & src, const SerializerFunctorT & func ) - { - try - { - return func( target, src ); - } - catch(...) - { - CERR << "Unknown exception during serialize<>(DataNode,SerializableT,SerializerFunctorT)!\n"; - return false; - } - } - - /** - Returns func( src, target ). Note that using this function - bypasses internal API marshalling for the target. This is, - however, useful in some cases. - - See the complementary form of serialize() for important - information regarding recursive deserialization. - */ - template <typename DataNodeType, typename DeserializableT, typename DeserializerFunctorT> - bool deserialize( const DataNodeType & src, DeserializableT & target, const DeserializerFunctorT & func ) - { - try - { - return func( src, target ); - } - catch(...) - { - CERR << "Unknown exception during deserialize<>(DataNode,DeserializableT,DeserializerFunctorT)!\n"; - return false; - } - } - /** Serializes src to target using the default API marshaling mechanism. |
From: stephan b. <sg...@us...> - 2004-12-27 18:08:59
|
Update of /cvsroot/pclasses/pclasses2/src/s11n/io/parens In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26819/src/s11n/io/parens Modified Files: parens_serializer.cpp Log Message: Added \n ==> \\\n entity translation. Index: parens_serializer.cpp =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/s11n/io/parens/parens_serializer.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- parens_serializer.cpp 26 Dec 2004 17:28:57 -0000 1.1 +++ parens_serializer.cpp 27 Dec 2004 18:08:48 -0000 1.2 @@ -15,17 +15,17 @@ template <typename MapT> void operator()( MapT & map ) { - // The order of these escapes is - // signifant. We only do + // We only do // double-backslashes to accomodate // the case that the final chars in a // property is a backslash (yes, this // has happened, and it hosed the // data, because it inadvertently // escaped a control token.). - map["\\"] = "\\\\"; + //map["\\"] = "\\\\"; map[")"] = "\\)"; map["("] = "\\("; + map["\n"] = "\\\n"; // It is not strictly necessary to escape \(, // but we do so because Parens is intended to // be easy for hand-editing, and not escaping @@ -54,7 +54,6 @@ #define SERINST(NodeT) \ register_serializer< parens_serializer< NodeT > > \ ( "s11n::io::parens_serializer", "parens" ); - /// ^^^ WTF does gcc make me qualify those namespaces? SERINST(::P::s11n::data_node); SERINST(::P::s11n::s11n_node); |
From: stephan b. <sg...@us...> - 2004-12-27 18:08:13
|
Update of /cvsroot/pclasses/pclasses2/src/s11n/io In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26678/src/s11n/io Modified Files: data_node_format.h Log Message: Moved child_node_simple_formatter into the core algos, as deps allowed me to. Index: data_node_format.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/s11n/io/data_node_format.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- data_node_format.h 26 Dec 2004 12:30:06 -0000 1.2 +++ data_node_format.h 27 Dec 2004 18:07:54 -0000 1.3 @@ -199,7 +199,7 @@ ? 0 : this->m_nodestack.back() ); typedef ::P::s11n::node_traits<node_type> NTR; - node_type * newnode = new node_type(); + node_type * newnode = new node_type; if ( m_node ) { // if we're in a node, add new node as a child to that one: NTR::children( *m_node ).push_back( newnode ); @@ -215,6 +215,7 @@ { CERR << "open_node("<<classname<<","<<nodename<<") WARNING: deleting extra root node!\n"; delete( m_node ); + m_node = 0; ret = false; } else @@ -327,6 +328,8 @@ /** Deletes this object's root_node() if auto_delete() is true. + + After calling this, root_node() returns 0. */ void reset() { @@ -342,58 +345,6 @@ node_stack m_nodestack; }; - /** - A helper functor to loop over serializable children - of a node from within a Serializer implementation. - - Designed for use with std::for_each(). - - SerializerT must be compatible with - <code>data_node_serializer<></code>. - - */ - template <typename SerializerT> - struct node_child_simple_formatter - { - typedef SerializerT serializer_type; -// typedef typename SerializerT::node_type node_type; - /** - Preconditions: - - - Ser must be valid references. - - - Both ser and os must outlive this - object. More correctly, this object's - operator() must not be called after either - ser or os are destroyed. - - */ - node_child_simple_formatter( serializer_type & ser, std::ostream & os, - const std::string & prefix = "", const std::string & suffix = "\n" ) - : m_ser(ser), m_os(&os), m_pre(prefix), m_suf(suffix) - { - } - - /** - Serializes src into this object's target - container, using this object's serializer. - */ - template <typename NodeType> - bool operator()( const NodeType * src ) const - { - if( ! src ) return false; - if( ! this->m_pre.empty() ) *(this->m_os) << this->m_pre; - bool b = this->m_ser.serialize( *src, *(this->m_os) ); - if( ! this->m_suf.empty() ) *(this->m_os) << this->m_suf; - return b; - } - - private: - serializer_type & m_ser; - std::ostream * m_os; - std::string m_pre; - std::string m_suf; - }; } // namespace io }} // namespace P::s11n |
From: stephan b. <sg...@us...> - 2004-12-27 18:06:57
|
Update of /cvsroot/pclasses/pclasses2/src/s11n/io In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26406/src/s11n/io Modified Files: data_node_io.h Log Message: Re-added a couple helper classes i removed when porting from the s11n.net tree - parens_serializer uses them :/. Index: data_node_io.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/s11n/io/data_node_io.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- data_node_io.h 26 Dec 2004 14:35:13 -0000 1.4 +++ data_node_io.h 27 Dec 2004 18:06:46 -0000 1.5 @@ -26,6 +26,7 @@ #include <pclasses/Phoenix.h> // phoenix class #include <pclasses/Plugin/Plugin.h> #include <pclasses/System/SharedLib.h> // openSharedLib() +#include <pclasses/Util/StringTool.h> #include <pclasses/s11n/s11n_debuggering_macros.h> // COUT/CERR #include <pclasses/s11n/classload.h> // classloader() #include <pclasses/s11n/data_node_serialize.h> // unfortunately dep @@ -434,6 +435,136 @@ return load_serializable<NodeT,SerializableT>( is ); } + + /** + A helper for serializing properties to a + stream. Intended for use by Serializers, not + Serializables. + + NodeType is the container type used for data + serialization (e.g. s11n::data_node). + + */ + template <typename NodeType> + class key_value_serializer + { + public: + typedef NodeType node_type; + typedef typename node_type::value_type pair_type; + + typedef std::map<std::string,std::string> entity_translation_map; + + /** + map: needed so we can do entity translation + in a unified manner here. It must outlive + this object. Pass it 0 for no translation. + Translations are only applied on VALUES, + not KEYS. + + prefix: inserted before each property. + + separator: inserted between the key and value. + + suffix: appended after each entry. + + + */ + key_value_serializer( const entity_translation_map & map, + std::ostream & dest, + const std::string & prefix, + const std::string & separator, + const std::string & suffix + ) + : m_pre(prefix), m_sep(separator), m_suf(suffix), m_os(dest), m_map(&map) + { + } + + /** + Sends the following formatted string to os: + + {prefix}{src.first}{separator}{src.second}{suffix} + + */ + void operator()( const pair_type & src ) const + { + using ::P::StringTool; + static const std::string errval = ""; + std::string key = StringTool::to( src.first ); + std::string val = StringTool::to( src.second ); + // should we xlate the key as well? + if( this->m_map ) + { + StringTool::translateEntities( val, *(this->m_map) ); + } + this->m_os << this->m_pre; + this->m_os << key; + this->m_os << this->m_sep; + this->m_os << val; + this->m_os << this->m_suf; + } + private: + std::string m_pre; + std::string m_sep; + std::string m_suf; + std::ostream & m_os; + const entity_translation_map * m_map; + }; + + + /** + A helper functor to loop over serializable children + of a node from within a Serializer implementation. + + Designed for use with std::for_each(). + + SerializerT must be compatible with + <code>data_node_serializer<></code>. + + */ + template <typename SerializerT> + struct node_child_simple_formatter + { + typedef SerializerT serializer_type; +// typedef typename SerializerT::node_type node_type; + /** + Preconditions: + + - Ser must be valid references. + + - Both ser and os must outlive this + object. More correctly, this object's + operator() must not be called after either + ser or os are destroyed. + + */ + node_child_simple_formatter( serializer_type & ser, std::ostream & os, + const std::string & prefix = "", const std::string & suffix = "\n" ) + : m_ser(ser), m_os(&os), m_pre(prefix), m_suf(suffix) + { + } + + /** + Serializes src into this object's target + container, using this object's serializer. + */ + template <typename NodeType> + bool operator()( const NodeType * src ) const + { + if( ! src ) return false; + if( ! this->m_os ) return false; + if( ! this->m_pre.empty() ) *(this->m_os) << this->m_pre; + bool b = this->m_ser.serialize( *src, *(this->m_os) ); + if( ! this->m_suf.empty() ) *(this->m_os) << this->m_suf; + return b; + } + + private: + serializer_type & m_ser; + std::ostream * m_os; + std::string m_pre; + std::string m_suf; + }; + } // namespace io |
From: stephan b. <sg...@us...> - 2004-12-27 18:06:15
|
Update of /cvsroot/pclasses/pclasses2/src/s11n/io In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26254/src/s11n/io Modified Files: Makefile.toc Log Message: Added parens_serializer. Index: Makefile.toc =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/s11n/io/Makefile.toc,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Makefile.toc 26 Dec 2004 04:44:58 -0000 1.2 +++ Makefile.toc 27 Dec 2004 18:06:00 -0000 1.3 @@ -2,7 +2,7 @@ include toc.make -SUBDIRS = expat +SUBDIRS = expat parens HEADERS = \ data_node_format.h \ |
From: stephan b. <sg...@us...> - 2004-12-27 18:04:45
|
Update of /cvsroot/pclasses/pclasses2/src/s11n In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26031/src/s11n Modified Files: Makefile.toc Log Message: Added parens_serializer. Index: Makefile.toc =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/s11n/Makefile.toc,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- Makefile.toc 26 Dec 2004 14:41:53 -0000 1.8 +++ Makefile.toc 27 Dec 2004 18:04:35 -0000 1.9 @@ -38,6 +38,7 @@ ifeq (1,$(PCLASSES_HAVE_LIBEXPAT)) SUBDIR_OBJECTS += io/expat/expat_serializer.o endif + SUBDIR_OBJECTS += io/parens/parens_serializer.o # odd: always causes the .o to be rebuilt: |
From: stephan b. <sg...@us...> - 2004-12-27 18:03:32
|
Update of /cvsroot/pclasses/pclasses2/src/System In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25847/src/System Modified Files: Makefile.toc Log Message: Corrected: Semaphore.posix.cpp was listed under the WIN32 sources, and wasn't being compiled. Index: Makefile.toc =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/System/Makefile.toc,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- Makefile.toc 27 Dec 2004 18:00:00 -0000 1.11 +++ Makefile.toc 27 Dec 2004 18:03:15 -0000 1.12 @@ -54,21 +54,21 @@ File.posix.cpp \ Mutex.posix.cpp \ Pipe.posix.cpp \ + Semaphore.posix.cpp \ SharedMemory.posix.cpp \ - Thread.posix.cpp \ + Thread.posix.cpp SOURCES_WIN32 = Condition.win32.cpp \ CriticalSection.win32.cpp \ Mutex.win32.cpp \ - Semaphore.posix.cpp \ Semaphore.win32.cpp \ SharedLib.win32.cpp - ############################################## # TODO: use the config-mandated BUILD_SOURCES! +SOURCES_PLATFORM = POSIX BUILD_SOURCES = $(SOURCES_COMMON) -BUILD_SOURCES += $(SOURCES_POSIX) +BUILD_SOURCES += $(SOURCES_$(SOURCES_PLATFORM)) BUILD_SOURCES += $(SOURCES_SHAREDLIB) ############################################## |
From: stephan b. <sg...@us...> - 2004-12-27 18:00:10
|
Update of /cvsroot/pclasses/pclasses2/src/System In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25238/src/System Modified Files: Makefile.toc Log Message: Added FileInfo, Directory, Condition. Index: Makefile.toc =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/System/Makefile.toc,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- Makefile.toc 26 Dec 2004 15:19:06 -0000 1.10 +++ Makefile.toc 27 Dec 2004 18:00:00 -0000 1.11 @@ -13,6 +13,7 @@ SOURCES_COMMON = \ CriticalSection.cpp \ CriticalSection.generic.cpp \ + FileInfo.common.cpp \ Mime.cpp \ Mutex.cpp \ PathFinder.cpp \ @@ -47,7 +48,9 @@ Condition.solaris.cpp \ Mutex.solaris.cpp -SOURCES_POSIX = Condition.posix.cpp \ +SOURCES_POSIX = \ + Condition.posix.cpp \ + Directory.posix.cpp \ File.posix.cpp \ Mutex.posix.cpp \ Pipe.posix.cpp \ |
From: stephan b. <sg...@us...> - 2004-12-27 17:58:05
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses/System In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24848/include/pclasses/System Modified Files: Makefile.toc Log Message: Added Directory, FileInfo. Index: Makefile.toc =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/System/Makefile.toc,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Makefile.toc 24 Dec 2004 04:52:04 -0000 1.2 +++ Makefile.toc 27 Dec 2004 17:57:55 -0000 1.3 @@ -11,7 +11,9 @@ ############## FLEXES: HEADERS = Condition.h \ CriticalSection.h \ + Directory.h \ File.h \ + FileInfo.h \ Mutex.h \ PathFinder.h \ Pipe.h \ |
From: stephan b. <sg...@us...> - 2004-12-27 17:09:06
|
Update of /cvsroot/pclasses/pclasses2/src/s11n/io/expat In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14938/src/s11n/io/expat Modified Files: expat_serializer.cpp Log Message: Changed the magic cookie, so it will be data-compatible with s11n.net's parser. Index: expat_serializer.cpp =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/s11n/io/expat/expat_serializer.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- expat_serializer.cpp 26 Dec 2004 04:04:31 -0000 1.1 +++ expat_serializer.cpp 27 Dec 2004 17:08:53 -0000 1.2 @@ -46,7 +46,7 @@ { #define SERINST(NodeT) \ - ::P::s11n::io::register_serializer< ::P::s11n::io::expat_serializer< NodeT > >( "P::s11n::io::expat_serializer", "expat" ); + ::P::s11n::io::register_serializer< ::P::s11n::io::expat_serializer< NodeT > >( "s11n::io::expat_serializer", "expat" ); SERINST(::P::s11n::data_node); SERINST(::P::s11n::s11n_node); |
From: Christian P. <cp...@us...> - 2004-12-27 07:07:30
|
Update of /cvsroot/pclasses/pclasses2/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11007/src Modified Files: Makefile.am Log Message: Index: Makefile.am =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/Makefile.am,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Makefile.am 23 Dec 2004 04:32:17 -0000 1.2 +++ Makefile.am 27 Dec 2004 07:07:20 -0000 1.3 @@ -7,6 +7,7 @@ lib_LTLIBRARIES = libpclasses.la libpclasses_la_SOURCES = Alloc.cpp Exception.cpp AtomicInt.gcc-x86.cpp \ - ByteOrderTraits.cpp LinkedItem.cpp + ByteOrderTraits.cpp LinkedItem.cpp Time.cpp Date.cpp DateTime.cpp \ + TimeSpan.cpp SUBDIRS = . Unicode IO System Net Util |
From: Christian P. <cp...@us...> - 2004-12-27 07:07:30
|
Update of /cvsroot/pclasses/pclasses2/src/System In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11007/src/System Modified Files: Makefile.am Log Message: Index: Makefile.am =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/System/Makefile.am,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Makefile.am 23 Dec 2004 04:32:18 -0000 1.2 +++ Makefile.am 27 Dec 2004 07:07:20 -0000 1.3 @@ -58,11 +58,11 @@ endif if WITH_POSIX_IO -IO_Sources = Pipe.posix.cpp File.posix.cpp +IO_Sources = Pipe.posix.cpp File.posix.cpp FileInfo.posix.cpp Directory.posix.cpp endif if WITH_WIN32_IO -IO_Sources = Pipe.win32.cpp File.win32.cpp +IO_Sources = Pipe.win32.cpp File.win32.cpp FileInfo.win32.cpp Directory.win32.cpp endif INCLUDES = -I$(top_srcdir)/include -I$(top_builddir)/include $(all_includes) @@ -73,7 +73,7 @@ libpclasses_system_la_SOURCES = timeout.cpp SystemError.cpp \ CriticalSection.cpp Mutex.cpp $(Thread_Sources) \ $(Semaphore_Sources) $(SharedMem_Sources) $(SharedLib_Sources) \ - $(IO_Sources) + SharedLib.generic.cpp FileInfo.common.cpp $(IO_Sources) libpclasses_system_la_LDFLAGS = -no-undefined libpclasses_system_la_LIBADD = $(top_builddir)/src/libpclasses.la \ @@ -81,4 +81,4 @@ $(top_builddir)/src/IO/libpclasses_io.la \ $(DL_LIBS) -noinst_HEADERS = timeout.h +noinst_HEADERS = timeout.h SharedLibCache.h |
From: Christian P. <cp...@us...> - 2004-12-27 07:07:29
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses/System In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11007/include/pclasses/System Modified Files: Makefile.am Log Message: Index: Makefile.am =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/System/Makefile.am,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- Makefile.am 22 Dec 2004 17:54:42 -0000 1.1.1.1 +++ Makefile.am 27 Dec 2004 07:07:20 -0000 1.2 @@ -1,4 +1,5 @@ INCLUDES = METASOURCES = AUTO pkginclude_HEADERS = SystemError.h SharedMemory.h CriticalSection.h Mutex.h \ - Condition.h Semaphore.h Thread.h SharedLib.h File.h + Condition.h Semaphore.h Thread.h SharedLib.h File.h FileInfo.h \ + Directory.h |
From: Christian P. <cp...@us...> - 2004-12-27 07:07:28
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11007/include/pclasses Modified Files: Makefile.am Log Message: Index: Makefile.am =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/Makefile.am,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Makefile.am 23 Dec 2004 04:32:15 -0000 1.2 +++ Makefile.am 27 Dec 2004 07:07:19 -0000 1.3 @@ -5,4 +5,5 @@ SharedPtr.h Alloc.h SourceInfo.h Atomic.h AtomicTraits.h ValueType.h LockTraits.h \ ByteOrderTraits.h BasicTypes.h Vector.h Algorithm.h TypeTraits.h \ Stack.h LinkedItem.h Pair.h IntTypeLimits.h Queue.h IntrusivePtr.h \ - CircularQueue.h List.h NonCopyable.h + CircularQueue.h List.h NonCopyable.h Phoenix.h Factory.h \ + Time.h Date.h DateTime.h TimeSpan.h |
From: Christian P. <cp...@us...> - 2004-12-27 07:06:01
|
Update of /cvsroot/pclasses/pclasses2/src/System In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10778/src/System Added Files: FileInfo.common.cpp FileInfo.posix.cpp Log Message: Added P::System::FileInfo class. --- NEW FILE: FileInfo.common.cpp --- /*************************************************************************** * Copyright (C) 2004 by Christian Prochnow * * cp...@se... * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU Library General Public License as * * published by the Free Software Foundation; either version 2 of the * * License, or (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU Library General Public * * License along with this program; if not, write to the * * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ #include "pclasses/System/FileInfo.h" namespace P { namespace System { FileInfo::FileInfo(const FileInfo& fi) : _path(fi._path), _size(fi._size), _type(fi.type()), _ctime(fi._ctime), _mtime(fi._mtime), _atime(fi._atime) { } FileInfo::FileInfo(const Unicode::String& path) throw(SystemError) : _path(path) { refresh(); } FileInfo::~FileInfo() throw() { } const Unicode::String& FileInfo::path() const throw() { return _path; } FileInfo::fsize_t FileInfo::size() const throw() { return _size; } FileInfo::FileType FileInfo::type() const throw() { return _type; } const DateTime& FileInfo::ctime() const throw() { return _ctime; } const DateTime& FileInfo::mtime() const throw() { return _mtime; } const DateTime& FileInfo::atime() const throw() { return _atime; } FileInfo& FileInfo::operator=(const FileInfo& fi) throw() { _path = fi._path; _size = fi._size; _type = fi._type; _ctime = fi._ctime; _mtime = fi._mtime; _atime = fi._atime; return *this; } } // !namespace System } // !namespace P --- NEW FILE: FileInfo.posix.cpp --- /*************************************************************************** * Copyright (C) 2004 by Christian Prochnow * * cp...@se... * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU Library General Public License as * * published by the Free Software Foundation; either version 2 of the * * License, or (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU Library General Public * * License along with this program; if not, write to the * * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ #include "pclasses/pclasses-config.h" #include "pclasses/System/FileInfo.h" #include <sys/types.h> #include <sys/stat.h> #include <unistd.h> #include <errno.h> namespace P { namespace System { void FileInfo::refresh() throw(SystemError) { struct stat st; if(stat(_path.utf8().c_str(), &st)) throw SystemError(errno, "Could not stat file", P_SOURCEINFO); _size = st.st_size; if(S_ISREG(st.st_mode)) _type = File; else if(S_ISDIR(st.st_mode)) _type = Directory; else if(S_ISCHR(st.st_mode)) _type = CharDevice; else if(S_ISBLK(st.st_mode)) _type = BlockDevice; else if(S_ISFIFO(st.st_mode)) _type = Pipe; #ifdef S_ISSOCK else if(S_ISSOCK(st.st_mode)) _type = Pipe; #endif #ifdef S_ISLNK else if(S_ISLNK(st.st_mode)) _type = Link; #endif else _type = Unknown; _ctime = DateTime(st.st_ctime); _mtime = DateTime(st.st_mtime); _atime = DateTime(st.st_atime); } } // !namespace System } // !namespace P |
From: Christian P. <cp...@us...> - 2004-12-27 07:06:00
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses/System In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10778/include/pclasses/System Added Files: FileInfo.h Log Message: Added P::System::FileInfo class. --- NEW FILE: FileInfo.h --- /*************************************************************************** * Copyright (C) 2004 by Christian Prochnow * * cp...@se... * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU Library General Public License as * * published by the Free Software Foundation; either version 2 of the * * License, or (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU Library General Public * * License along with this program; if not, write to the * * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ #ifndef P_System_FileInfo_h #define P_System_FileInfo_h #include <pclasses/BasicTypes.h> #include <pclasses/DateTime.h> #include <pclasses/Unicode/String.h> #include <pclasses/System/SystemError.h> #include <string> namespace P { namespace System { class FileInfo { public: typedef size_t fsize_t; //! Filesystem object type enum FileType { Unknown, /*!< Unknown file type */ File, /*!< Regular file */ Directory, /*!< Directory */ CharDevice, /*!< Character device */ BlockDevice, /*!< Block device */ Link, /*!< Filesystem link */ Pipe /*!< Anonymous-/Namedpipe */ }; FileInfo(const Unicode::String& path) throw(SystemError); FileInfo(const FileInfo& fi); ~FileInfo() throw(); const Unicode::String& path() const throw(); void refresh() throw(SystemError); //! Returns the size of the filesystem object fsize_t size() const throw(); //! Returns the type of the filesystem object FileType type() const throw(); //! Returns the creation time const DateTime& ctime() const throw(); //! Returns the last-modified time const DateTime& mtime() const throw(); //! Returns the last-accessed time const DateTime& atime() const throw(); FileInfo& operator=(const FileInfo& fi) throw(); private: Unicode::String _path; fsize_t _size; FileType _type; DateTime _ctime, _mtime, _atime; }; } // !namespace System } // !namespace P #endif |
From: Christian P. <cp...@us...> - 2004-12-27 07:04:58
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses/System In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10557/include/pclasses/System Modified Files: Directory.h Log Message: Moved to std::list, fixed change(), current(), create() and remove(). Index: Directory.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/System/Directory.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Directory.h 24 Dec 2004 16:50:49 -0000 1.1 +++ Directory.h 27 Dec 2004 07:04:48 -0000 1.2 @@ -22,10 +22,11 @@ #define P_System_Directory_h #include <pclasses/pclasses-config.h> -#include <pclasses/List.h> #include <pclasses/Unicode/String.h> #include <pclasses/IO/IOError.h> + #include <string> +#include <list> namespace P { @@ -34,11 +35,10 @@ //! Filesystem Directory class class Directory { public: - typedef List<Unicode::String> EntryList; - typedef EntryList::ConstIterator Iterator; - + typedef std::list<Unicode::String> EntryList; + typedef EntryList::const_iterator Iterator; + Directory(const Unicode::String& path) throw(IO::IOError); - Directory(const std::string& path) throw(IO::IOError); ~Directory() throw(); const Unicode::String& path() const throw(); @@ -57,9 +57,9 @@ static void remove(const Unicode::String& path) throw(IO::IOError); private: - unsigned long _handle; - Unicode::String _path; - List<Unicode::String> _entries; + unsigned long _handle; + Unicode::String _path; + EntryList _entries; }; } // !namespace System |
From: Christian P. <cp...@us...> - 2004-12-27 07:04:57
|
Update of /cvsroot/pclasses/pclasses2/src/System In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10557/src/System Modified Files: Directory.posix.cpp Log Message: Moved to std::list, fixed change(), current(), create() and remove(). Index: Directory.posix.cpp =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/System/Directory.posix.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Directory.posix.cpp 24 Dec 2004 16:50:49 -0000 1.1 +++ Directory.posix.cpp 27 Dec 2004 07:04:49 -0000 1.2 @@ -29,21 +29,11 @@ namespace P { namespace System { - + Directory::Directory(const Unicode::String& path) throw(IO::IOError) : _path(path) { - /*@fixme DIR* d = opendir(_path.utf8()); - if(!d) - throw IOError(errno, "Could not open directory", P_SOURCEINFO); - - _handle = (unsigned long)d;*/ -} - -Directory::Directory(const std::string& path) throw(IO::IOError) -: _path(path.c_str()) -{ - DIR* d = opendir(path.c_str()); + DIR* d = opendir(path.utf8().c_str()); if(!d) throw IO::IOError(errno, "Could not open directory", P_SOURCEINFO); @@ -67,7 +57,7 @@ struct dirent* de; while((de = readdir((DIR*)_handle))) - _entries.append(Unicode::String(de->d_name)); + _entries.push_back(Unicode::String(de->d_name)); } Directory::Iterator Directory::begin() const @@ -92,23 +82,22 @@ void Directory::change(const Unicode::String& path) throw(IO::IOError) { - /*@fixme if(chdir(path.utf8()) == -1) - throw IO::IOError(errno, "Could not change working directory", P_SOURCEINFO);*/ + if(chdir(path.utf8().c_str()) == -1) + throw IO::IOError(errno, "Could not change working directory", P_SOURCEINFO); } void Directory::create(const Unicode::String& path) throw(IO::IOError) { - /*@fixme if(mkdir(path.utf8(), 0777) == -1) - throw IO::IOError(errno, "Could not change working directory", P_SOURCEINFO); */ + if(mkdir(path.utf8().c_str(), 0777) == -1) + throw IO::IOError(errno, "Could not change working directory", P_SOURCEINFO); } void Directory::remove(const Unicode::String& path) throw(IO::IOError) { - /*@fixme if(rmdir(path.utf8()) == -1) - throw IO::IOError(errno, "Could not remove directory", P_SOURCEINFO); */ + if(rmdir(path.utf8().c_str()) == -1) + throw IO::IOError(errno, "Could not remove directory", P_SOURCEINFO); } - } // !namespace System } // !namespace P |
From: Christian P. <cp...@us...> - 2004-12-27 07:00:40
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses/Unicode In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9925/include/pclasses/Unicode Modified Files: String.h Log Message: Added String::utf8(), added String::ConstIterator, added std::string support. Index: String.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/Unicode/String.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- String.h 23 Dec 2004 04:32:17 -0000 1.1 +++ String.h 27 Dec 2004 07:00:31 -0000 1.2 @@ -27,6 +27,8 @@ #include <pclasses/ScopedArrayPtr.h> #include <pclasses/Unicode/Char.h> +#include <string> + namespace P { namespace Unicode { @@ -41,6 +43,7 @@ String(const String& str) throw(OutOfMemory); String(const char* str, size_t count = npos) throw(OutOfMemory); String(const wchar_t* str, size_t count = npos) throw(OutOfMemory); + String(const std::string& str); ~String() throw(); void swap(String& b); @@ -82,8 +85,34 @@ Char* _current; }; + class ConstIterator { + public: + ConstIterator(const Char* current); + ConstIterator(const ConstIterator& iter); + ~ConstIterator(); + + const Char& operator*() const; + + ConstIterator& operator++(); + ConstIterator operator++(int); + + ConstIterator& operator--(); + ConstIterator operator--(int); + + ConstIterator& operator=(const ConstIterator& iter); + + bool operator==(const ConstIterator& iter) const; + bool operator!=(const ConstIterator& iter) const; + + private: + const Char* _current; + }; + Iterator begin(); + ConstIterator begin() const; + Iterator end(); + ConstIterator end() const; void insert(const Iterator& pos, const Char& ch); void insert(size_t pos, const Char& ch); @@ -100,9 +129,14 @@ void prepend(const Char& ch); void prepend(const String& str); + std::string utf8() const; + + String deepCopy() const; + String& operator=(const String& str); String& operator=(const char* str); String& operator=(const wchar_t* str); + String& operator=(const std::string& str); Char& operator[](ptrdiff_t pos) throw(OutOfMemory, OutOfBounds); @@ -131,8 +165,6 @@ String(const String& str, size_t offset, size_t length) throw(OutOfMemory); - //! Make string unique (not shared) - void makeUnique() const throw(OutOfMemory); Char* data() const throw(); void resize(size_t sz, size_t holeOffset, size_t holeLen) throw(OutOfMemory); |
From: Christian P. <cp...@us...> - 2004-12-27 07:00:40
|
Update of /cvsroot/pclasses/pclasses2/src/Unicode In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9925/src/Unicode Modified Files: String.cpp Log Message: Added String::utf8(), added String::ConstIterator, added std::string support. Index: String.cpp =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/Unicode/String.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- String.cpp 23 Dec 2004 05:51:19 -0000 1.2 +++ String.cpp 27 Dec 2004 07:00:31 -0000 1.3 @@ -24,6 +24,7 @@ #include "pclasses/Algorithm.h" #include <cstring> +#include <sstream> namespace P { @@ -59,6 +60,11 @@ { } +String::String(const std::string& str) +{ + *this = fromLatin1(str.c_str()); +} + String::~String() throw() { } @@ -98,10 +104,19 @@ newLength = length; } -// else -// { -// size_t len1; -// } + else + { + size_t len1 = holeOffset - length; + size_t off2 = holeOffset; + size_t len2 = length - off2; + + newStr = new char[sizeof(Char) * sz]; + copy_construct((Char*)newStr, data(), len1); + construct((Char*)newStr + holeOffset, holeLen); + copy_construct((Char*)newStr + off2, data(), len2); + + newLength = length + holeLen; + } newData->str = (Char*)newStr; newData->size = sz; @@ -115,6 +130,19 @@ return _length; } +std::string String::utf8() const +{ + std::ostringstream os; + ConstIterator i = begin(); + while(i != end()) + { + os << (*i).latin1(); + ++i; + } + + return os.str(); +} + String String::part(size_t offset, size_t length) const throw(OutOfMemory, OutOfBounds) { @@ -134,24 +162,11 @@ return part(_length - length, length); } -void String::makeUnique() const throw(OutOfMemory) +String String::deepCopy() const { - if(_data.useCount() > 1) - { - // allocate new data structure - SharedPtr<Data> newData(new Data); - - // allocate and copy-construct string data - char* newStr = new char[sizeof(Char) * (_length + 8)]; - copy_construct((Char*)newStr, data(), _length); - - // set the copied string data - newData->str = (Char*)newStr; - newData->size = _length + 8; - _data = newData; - _offset = 0; - _length = _length; - } + String str(_length + 8); + copy_construct(str.data(), data(), _length); + return str; } const Char& String::at(size_t pos) const throw(OutOfBounds) @@ -176,7 +191,8 @@ >= _length) throw OutOfBounds("Index is out of bounds", P_SOURCEINFO); - makeUnique(); + if(_data.useCount() > 1) + *this = deepCopy(); // construct Char's that were not yet constructed, but allocated /*if(pos >= _length) @@ -214,6 +230,12 @@ return *this; } +String& String::operator=(const std::string& str) +{ + *this = fromLatin1(str.c_str()); + return *this; +} + bool String::operator==(const String& str) const throw() { if(&str == this || (str.data() == data() && str._length == _length)) @@ -316,22 +338,38 @@ String::Iterator String::begin() { - makeUnique(); + if(_data.useCount() > 1) + *this = deepCopy(); + return Iterator(data()); } String::Iterator String::end() { - makeUnique(); + if(_data.useCount() > 1) + *this = deepCopy(); + return Iterator(data() + _length); } +String::ConstIterator String::begin() const +{ + return ConstIterator(data()); +} + +String::ConstIterator String::end() const +{ + return ConstIterator(data() + _length); +} + void String::insert(const Iterator& pos, const Char& ch) { -/* if(_data.useCount() > 1 || _length + 1 > _data->size) - resize(_data->size + 8);*/ + if(_data.useCount() > 1 || _length + 1 > _data->size) + resize(size() + 1, &(*pos) - data(), 1); + else + { /* @todo */ } - + *pos = ch; } void String::insert(const Iterator& pos, const String& str) @@ -440,6 +478,68 @@ return (_current != iter._current); } + +String::ConstIterator::ConstIterator(const String::ConstIterator& iter) +: _current(iter._current) +{ +} + +String::ConstIterator::ConstIterator(const Char* current) +: _current(current) +{ +} + +String::ConstIterator::~ConstIterator() +{ +} + +const Char& String::ConstIterator::operator*() const +{ + return *_current; +} + +String::ConstIterator& String::ConstIterator::operator++() +{ + ++_current; + return *this; +} + +String::ConstIterator String::ConstIterator::operator++(int) +{ + ConstIterator tmp = *this; + ++_current; + return tmp; +} + +String::ConstIterator& String::ConstIterator::operator--() +{ + --_current; + return *this; +} + +String::ConstIterator String::ConstIterator::operator--(int) +{ + ConstIterator tmp = *this; + --_current; + return tmp; +} + +String::ConstIterator& String::ConstIterator::operator=(const String::ConstIterator& iter) +{ + _current = iter._current; + return *this; +} + +bool String::ConstIterator::operator==(const String::ConstIterator& iter) const +{ + return (_current == iter._current); +} + +bool String::ConstIterator::operator!=(const String::ConstIterator& iter) const +{ + return (_current != iter._current); +} + } // !namespace Unicode } // !namespace P |
From: Christian P. <cp...@us...> - 2004-12-27 06:57:15
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9296/include/pclasses Modified Files: DateTime.h Log Message: Added time_t support Index: DateTime.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/DateTime.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- DateTime.h 27 Dec 2004 05:33:16 -0000 1.2 +++ DateTime.h 27 Dec 2004 06:57:05 -0000 1.3 @@ -26,6 +26,7 @@ #include <string> #include <iostream> +#include <time.h> namespace P { @@ -34,6 +35,7 @@ public: DateTime(); DateTime(const Date& d, const Time& t, const std::string& tzname = ""); + DateTime(time_t t); DateTime(const DateTime& dt); ~DateTime(); @@ -44,6 +46,7 @@ void setTimeZone(const std::string& tzname); DateTime& operator=(const DateTime& dt); + DateTime& operator=(time_t t); bool operator>(const DateTime& dt) const throw(); bool operator<(const DateTime& dt) const throw(); @@ -52,6 +55,8 @@ bool operator==(const DateTime& dt) const throw(); bool operator!=(const DateTime& dt) const throw(); + static DateTime fromTime_t(time_t t) throw(); + friend std::ostream& operator << (std::ostream& os, const DateTime& dt); private: |