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: Christian P. <cp...@us...> - 2004-12-27 06:57:14
|
Update of /cvsroot/pclasses/pclasses2/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9296/src Modified Files: DateTime.cpp Log Message: Added time_t support Index: DateTime.cpp =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/DateTime.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- DateTime.cpp 27 Dec 2004 05:33:15 -0000 1.2 +++ DateTime.cpp 27 Dec 2004 06:57:05 -0000 1.3 @@ -18,7 +18,9 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ +#include "pclasses/pclasses-config.h" #include "pclasses/DateTime.h" +#include <time.h> namespace P { @@ -37,6 +39,12 @@ { } +DateTime::DateTime(time_t t) +: Date(1970, 1, 1), Time(0, 0, 0, 0) +{ + *this = fromTime_t(t); +} + DateTime::~DateTime() { } @@ -59,6 +67,12 @@ return *this; } +DateTime& DateTime::operator=(time_t t) +{ + *this = fromTime_t(t); + return *this; +} + bool DateTime::operator>(const DateTime& dt) const throw() { return (Date::operator>(dt) || (Date::operator==(dt) && Time::operator>(dt))); @@ -89,6 +103,22 @@ return (!operator==(dt)); } +DateTime DateTime::fromTime_t(time_t t) throw() +{ + struct tm* ltm; + +#ifdef PCLASSES_HAVE_LOCALTIME_R + struct tm ltm_r; + ltm = localtime_r(&t, <m_r); +#else + ltm = localtime(&t); +#endif + + return DateTime( + Date(ltm->tm_year + 1900, ltm->tm_mon + 1, ltm->tm_mday), + Time(ltm->tm_hour, ltm->tm_min, ltm->tm_sec)); +} + std::ostream& operator << (std::ostream& os, const DateTime& dt) { os << (Date&)dt << ' ' << (Time&)dt << ' ' << dt.timeZone(); |
From: Christian P. <cp...@us...> - 2004-12-27 05:33:27
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29200/include/pclasses Modified Files: Date.h DateTime.h Time.h Log Message: Added copy & assign operators Index: Date.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/Date.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Date.h 26 Dec 2004 17:02:55 -0000 1.1 +++ Date.h 27 Dec 2004 05:33:16 -0000 1.2 @@ -66,6 +66,8 @@ Date(unsigned int year = 1970, unsigned int month = 1, unsigned int day = 1) throw(InvalidDate); + Date(const Date& d) throw(); + ~Date() throw(); double julianDayNumber() const throw(); @@ -89,6 +91,8 @@ //! Test if date is in a leap year bool isInLeapYear() const throw(); + Date& operator=(const Date& d) throw(); + bool operator>(const Date& d) const throw(); bool operator<(const Date& d) const throw(); bool operator>=(const Date& d) const throw(); Index: Time.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/Time.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Time.h 26 Dec 2004 16:45:49 -0000 1.1 +++ Time.h 27 Dec 2004 05:33:16 -0000 1.2 @@ -28,44 +28,49 @@ //! Invalid time error class InvalidTime: public RuntimeError { - public: - InvalidTime(const char* _what, const SourceInfo& si) - : RuntimeError(_what, si) {} + public: + InvalidTime(const char* _what, const SourceInfo& si) + : RuntimeError(_what, si) {} }; //! Time class class Time { public: - Time(unsigned int hour = 0, unsigned int minute = 0, - unsigned int second = 0, unsigned int usec = 0) throw(InvalidTime); - ~Time() throw(); + Time(unsigned int hour = 0, unsigned int minute = 0, + unsigned int second = 0, unsigned int usec = 0) throw(InvalidTime); + + Time(const Time& t) throw(); - void setHour(unsigned int hour) throw(InvalidTime); - unsigned int hour() const throw(); + ~Time() throw(); - void setMinute(unsigned int minute) throw(InvalidTime); - unsigned int minute() const throw(); + void setHour(unsigned int hour) throw(InvalidTime); + unsigned int hour() const throw(); - void setSecond(unsigned int second) throw(InvalidTime); - unsigned int second() const throw(); + void setMinute(unsigned int minute) throw(InvalidTime); + unsigned int minute() const throw(); - void setUsec(unsigned int usec) throw(InvalidTime); - unsigned int usec() const throw(); + void setSecond(unsigned int second) throw(InvalidTime); + unsigned int second() const throw(); - bool operator>(const Time& t) const throw(); - bool operator<(const Time& t) const throw(); - bool operator>=(const Time& t) const throw(); - bool operator<=(const Time& t) const throw(); - bool operator==(const Time& t) const throw(); - bool operator!=(const Time& t) const throw(); + void setUsec(unsigned int usec) throw(InvalidTime); + unsigned int usec() const throw(); - friend std::ostream& operator << (std::ostream& os, const Time& t); + bool operator>(const Time& t) const throw(); + bool operator<(const Time& t) const throw(); + bool operator>=(const Time& t) const throw(); + bool operator<=(const Time& t) const throw(); + bool operator==(const Time& t) const throw(); + bool operator!=(const Time& t) const throw(); - private: - unsigned char _hour; - unsigned char _minute; - unsigned char _second; - unsigned int _usec; + Time& operator=(const Time& t) throw(); + + friend std::ostream& operator << (std::ostream& os, const Time& t); + + private: + unsigned char _hour; + unsigned char _minute; + unsigned char _second; + unsigned int _usec; }; } // !namespace P Index: DateTime.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/DateTime.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- DateTime.h 27 Dec 2004 05:21:53 -0000 1.1 +++ DateTime.h 27 Dec 2004 05:33:16 -0000 1.2 @@ -34,6 +34,7 @@ public: DateTime(); DateTime(const Date& d, const Time& t, const std::string& tzname = ""); + DateTime(const DateTime& dt); ~DateTime(); //! Returns the name of the timezone @@ -42,6 +43,8 @@ //! Set the timezone void setTimeZone(const std::string& tzname); + DateTime& operator=(const DateTime& dt); + bool operator>(const DateTime& dt) const throw(); bool operator<(const DateTime& dt) const throw(); bool operator>=(const DateTime& dt) const throw(); |
From: Christian P. <cp...@us...> - 2004-12-27 05:33:26
|
Update of /cvsroot/pclasses/pclasses2/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29200/src Modified Files: Date.cpp DateTime.cpp Time.cpp Log Message: Added copy & assign operators Index: DateTime.cpp =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/DateTime.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- DateTime.cpp 27 Dec 2004 05:21:53 -0000 1.1 +++ DateTime.cpp 27 Dec 2004 05:33:15 -0000 1.2 @@ -32,6 +32,11 @@ { } +DateTime::DateTime(const DateTime& dt) +: Date(dt), Time(dt), _tzname(dt._tzname) +{ +} + DateTime::~DateTime() { } @@ -46,6 +51,14 @@ _tzname = tzname; } +DateTime& DateTime::operator=(const DateTime& dt) +{ + Date::operator=(dt); + Time::operator=(dt); + _tzname = dt._tzname; + return *this; +} + bool DateTime::operator>(const DateTime& dt) const throw() { return (Date::operator>(dt) || (Date::operator==(dt) && Time::operator>(dt))); Index: Time.cpp =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/Time.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Time.cpp 26 Dec 2004 16:45:48 -0000 1.1 +++ Time.cpp 27 Dec 2004 05:33:15 -0000 1.2 @@ -31,6 +31,11 @@ throw InvalidTime("Invalid time", P_SOURCEINFO); } +Time::Time(const Time& t) throw() +: _hour(t._hour), _minute(t._minute), _second(t._second), _usec(t._usec) +{ +} + Time::~Time() throw() { } @@ -87,6 +92,15 @@ return _usec; } +Time& Time::operator=(const Time& t) throw() +{ + _hour = t._hour; + _minute = t._minute; + _second = t._second; + _usec = t._usec; + return *this; +} + bool Time::operator>(const Time& t) const throw() { return (_hour > t._hour || Index: Date.cpp =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/Date.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Date.cpp 26 Dec 2004 17:02:54 -0000 1.1 +++ Date.cpp 27 Dec 2004 05:33:15 -0000 1.2 @@ -30,18 +30,23 @@ throw InvalidDate("Invalid date", P_SOURCEINFO); } +Date::Date(const Date& d) throw() +: _year(d._year), _month(d._month), _day(d._day) +{ +} + Date::~Date() throw() { } void Date::setYear(unsigned int year) { - _year = year; + _year = year; } unsigned int Date::year() const throw() { - return _year; + return _year; } void Date::setMonth(unsigned int month) throw(InvalidDate) @@ -53,12 +58,12 @@ unsigned int Date::month() const throw() { - return _month; + return _month; } unsigned int Date::daysInMonth() throw() { - return daysInMonth(_month, _year); + return daysInMonth(_month, _year); } void Date::setDay(unsigned int day) throw(InvalidDate) @@ -69,13 +74,13 @@ _day = day; return; } - + throw InvalidDate("Invalid day in month", P_SOURCEINFO); } unsigned int Date::day() const throw() { - return _day; + return _day; } double Date::julianDayNumber() const throw() @@ -106,12 +111,12 @@ bool Date::isInLeapYear() const throw() { - return isLeapYear(_year); + return isLeapYear(_year); } bool Date::isLeapYear(unsigned int year) throw() { - return (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0)); + return (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0)); } unsigned int Date::daysInMonth(unsigned int month, unsigned int year) @@ -124,40 +129,46 @@ return dim; } +Date& Date::operator=(const Date& d) throw() +{ + _year = d._year; + _month = d._month; + _day = d._day; + return *this; +} + bool Date::operator>(const Date& d) const throw() { - return (_year > d._year || - (_year == d._year && _month > d._month) || - (_month == d._month && _day > d._day)); + return (_year > d._year || + (_year == d._year && _month > d._month) || + (_month == d._month && _day > d._day)); } bool Date::operator<(const Date& d) const throw() { - return (_year < d._year || - (_year == d._year && _month < d._month) || - (_month == d._month && _day < d._day)); + return (_year < d._year || + (_year == d._year && _month < d._month) || + (_month == d._month && _day < d._day)); } bool Date::operator>=(const Date& d) const throw() { - return (operator>(d) || operator==(d)); + return (operator>(d) || operator==(d)); } bool Date::operator<=(const Date& d) const throw() { - return (operator<(d) || operator==(d)); + return (operator<(d) || operator==(d)); } bool Date::operator==(const Date& d) const throw() { - return (_year == d._year && - _month == d._month && - _day == d._day); + return (_year == d._year && _month == d._month && _day == d._day); } bool Date::operator!=(const Date& d) const throw() { - return (!operator==(d)); + return (!operator==(d)); } std::ostream& operator << (std::ostream& os, const Date& d) |
From: Christian P. <cp...@us...> - 2004-12-27 05:22:04
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27697/include/pclasses Added Files: DateTime.h Log Message: Added DateTime class --- NEW FILE: DateTime.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_DateTime_h #define P_DateTime_h #include <pclasses/Date.h> #include <pclasses/Time.h> #include <string> #include <iostream> namespace P { //! Date/time class class DateTime: public Date, public Time { public: DateTime(); DateTime(const Date& d, const Time& t, const std::string& tzname = ""); ~DateTime(); //! Returns the name of the timezone const std::string& timeZone() const throw(); //! Set the timezone void setTimeZone(const std::string& tzname); bool operator>(const DateTime& dt) const throw(); bool operator<(const DateTime& dt) const throw(); bool operator>=(const DateTime& dt) const throw(); bool operator<=(const DateTime& dt) const throw(); bool operator==(const DateTime& dt) const throw(); bool operator!=(const DateTime& dt) const throw(); friend std::ostream& operator << (std::ostream& os, const DateTime& dt); private: std::string _tzname; }; } // !namespace P #endif |
From: Christian P. <cp...@us...> - 2004-12-27 05:22:02
|
Update of /cvsroot/pclasses/pclasses2/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27697/src Added Files: DateTime.cpp Log Message: Added DateTime class --- NEW FILE: DateTime.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/DateTime.h" namespace P { DateTime::DateTime() : Date(), Time(), _tzname() { } DateTime::DateTime(const Date& d, const Time& t, const std::string& tzname) : Date(d), Time(t), _tzname(tzname) { } DateTime::~DateTime() { } const std::string& DateTime::timeZone() const throw() { return _tzname; } void DateTime::setTimeZone(const std::string& tzname) { _tzname = tzname; } bool DateTime::operator>(const DateTime& dt) const throw() { return (Date::operator>(dt) || (Date::operator==(dt) && Time::operator>(dt))); } bool DateTime::operator<(const DateTime& dt) const throw() { return (Date::operator<(dt) || (Date::operator==(dt) && Time::operator<(dt))); } bool DateTime::operator>=(const DateTime& dt) const throw() { return (operator>(dt) || operator==(dt)); } bool DateTime::operator<=(const DateTime& dt) const throw() { return (operator<(dt) || operator==(dt)); } bool DateTime::operator==(const DateTime& dt) const throw() { return (Date::operator==(dt) && Time::operator==(dt)); } bool DateTime::operator!=(const DateTime& dt) const throw() { return (!operator==(dt)); } std::ostream& operator << (std::ostream& os, const DateTime& dt) { os << (Date&)dt << ' ' << (Time&)dt << ' ' << dt.timeZone(); return os; } } // !namespace P |
From: stephan b. <sg...@us...> - 2004-12-26 18:46:51
|
Update of /cvsroot/pclasses/pclasses2/src/Util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18463/src/Util Modified Files: StringTool.cpp Log Message: i believe i fixed an endless loop involving a "too long search". Index: StringTool.cpp =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/Util/StringTool.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- StringTool.cpp 26 Dec 2004 13:11:02 -0000 1.5 +++ StringTool.cpp 26 Dec 2004 18:46:43 -0000 1.6 @@ -1,5 +1,5 @@ #include <pclasses/Util/StringTool.h> -// #include <pclasses/s11n/s11n_debuggering_macros.h> // CERR +#include <pclasses/s11n/s11n_debuggering_macros.h> // CERR namespace P { namespace StringTool { @@ -9,6 +9,7 @@ if( str.empty() || ( 0 == map.size() ) ) return 0; size_t count = 0; std::string::size_type pos = str.npos; + std::string::size_type pos2 = str.npos; EntityMap::const_iterator mit; EntityMap::const_iterator met = map.end(); std::string key; @@ -22,11 +23,14 @@ { key = (*mit).second; val = (*mit).first; - while( str.npos != (pos = str.rfind( key )) ) + //CERR << "reverse-map key=["<<key<<"] val=["<<val<<"]\n"; + while( str.npos != (pos = str.rfind( key, pos2 )) ) { ++count; + pos2 = pos-1; str.replace( pos, key.size(), val ); } + pos2 = str.size() - 1; } } else @@ -34,15 +38,21 @@ // CERR << "Translating entities in ["<<str<<"]...\n"; // treat KEY=VAL as KEY=VAL mit = map.begin(); + pos = 0; + pos2 = str.size()-1; for( ; mit != met; ++mit ) { key = (*mit).first; val = (*mit).second; - while( str.npos != (pos = str.rfind( key )) ) + //CERR << "forward-map key=["<<key<<"] val=["<<val<<"]\n"; + while( str.npos != (pos = str.rfind( key, pos2 )) ) { + //CERR << "forward-map key=["<<key<<"] val=["<<val<<"]\n"; ++count; + pos2 = pos-1; str.replace( pos, key.size(), val ); } + pos2 = str.size()-1; } // this code works, and is much more efficient, but only accepts keys with length of 1: // pos = str.size() - 1; |
From: stephan b. <sg...@us...> - 2004-12-26 17:34:18
|
Update of /cvsroot/pclasses/pclasses2/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4879/src Modified Files: Makefile.toc Log Message: added Time*.cpp, Date.cpp Index: Makefile.toc =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/Makefile.toc,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- Makefile.toc 26 Dec 2004 04:43:51 -0000 1.10 +++ Makefile.toc 26 Dec 2004 17:34:08 -0000 1.11 @@ -8,8 +8,11 @@ SOURCES = Alloc.cpp \ AtomicInt.gcc-x86.cpp \ ByteOrderTraits.cpp \ + Date.cpp \ Exception.cpp \ - LinkedItem.cpp + LinkedItem.cpp \ + Time.cpp \ + TimeSpan.cpp # will move to IO: IODevice.cpp # will move to Unicode: Char.cpp String.cpp TextStream.cpp |
From: stephan b. <sg...@us...> - 2004-12-26 17:29:07
|
Update of /cvsroot/pclasses/pclasses2/src/s11n/io/parens In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3758/src/s11n/io/parens Added Files: Makefile.toc parens_serializer.cpp parens_serializer.h Log Message: egg. write support works, but for reading i need to hand-implement the (previously lex-based) parser :(. --- NEW FILE: parens_serializer.cpp --- #include "parens_serializer.h" #include <pclasses/s11n/io/serializers.h> // register_serializer() #include <pclasses/Phoenix.h> namespace P { namespace s11n { namespace io { /** Internal-use initializer for setting up a Serializer translation map. */ struct paren_serializer_translations_initializer { template <typename MapT> void operator()( MapT & map ) { // The order of these escapes is // signifant. 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["("] = "\\("; // It is not strictly necessary to escape \(, // but we do so because Parens is intended to // be easy for hand-editing, and not escaping // them confuses emacs when we have escaped // closing parens. :) } }; /** Returns the translations map for parens_serializer. */ entity_translation_map & parens_serializer_translations() { typedef P::Phoenix< entity_translation_map, sharing::parens_sharing_context, paren_serializer_translations_initializer > TheMap; return TheMap::instance(); } void parens_serializer_registration_init() { #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); #undef SERINST } int parens_reg_placeholder = ( parens_serializer_registration_init(), 1 ); } } } // namespace P::s11n::io --- NEW FILE: Makefile.toc --- #!/usr/bin/make -f include toc.make HEADERS = parens_serializer.h DIST_FILES += $(HEADERS) # INSTALL_PACKAGE_HEADERS_DEST = $(INSTALL_PACKAGE_HEADERS_BASE)/s11n/io # INSTALL_PACKAGE_HEADERS += $(HEADERS) SOURCES = parens_serializer.cpp DIST_FILES += $(SOURCES) OBJECTS = parens_serializer.o CLEAN_FILES += $(OBJECTS) build_libs = 1 LIBNAME = parens_serializer ifeq (1,$(build_libs)) SHARED_LIBS = $(LIBNAME) $(LIBNAME)_so_OBJECTS = $(OBJECTS) include $(TOC_MAKESDIR)/SHARED_LIBS.make endif build_bins = 0 BINNAME = mybin ifeq (1,$(build_bins)) BIN_PROGRAMS = $(BINNAME) $(BINNAME)_bin_OBJECTS = $(OBJECTS) # $(BINNAME)_bin_LDADD = include $(TOC_MAKESDIR)/BIN_PROGRAMS.make INSTALL_BINS += $(BIN_PROGRAMS) # Run target BIN_PROGRAMS to build these. endif all: SHARED_LIBS --- NEW FILE: parens_serializer.h --- #ifndef parens_SERIALIZER_H_INCLUDED #define parens_SERIALIZER_H_INCLUDED 1 //////////////////////////////////////////////////////////////////////// // data_node_serializers.hpp: some file parsers for the s11n framework // // License: Public Domain // Author: st...@s1... //////////////////////////////////////////////////////////////////////// #include <pclasses/s11n/s11n.h> #include <pclasses/s11n/io/data_node_io.h> // #include <pclasses/s11n/io/serializers.h> #include <map> #include <string> #define PARENS_VERSION "$Revision: 1.1 $" #define MAGIC_COOKIE_PARENS "(s11n::parens)" #define PARENS_INDENT(LEVEL,ECHO) indent = ""; for( size_t i = 0; i < depth + LEVEL; i++ ) { indent += '\t'; if(ECHO) dest << '\t'; } namespace P { namespace s11n { namespace io { namespace sharing { /** Sharing context used by parens_serializer. */ struct parens_sharing_context {}; } typedef std::map<std::string,std::string> entity_translation_map; /** The entity translations map used by parens_serializer. */ entity_translation_map & parens_serializer_translations(); /** De/serializes objects from/to a lisp-like grammar. */ template <typename NodeType> class parens_serializer : public data_node_serializer<NodeType> { public: typedef NodeType node_type; typedef parens_serializer<node_type> this_type; // convenience typedef typedef data_node_serializer<node_type> parent_type; // convenience typedef parens_serializer() : m_depth(0) { this->magic_cookie( MAGIC_COOKIE_PARENS ); } virtual ~parens_serializer() {} typedef entity_translation_map translation_map; /** Reimplemented to return this type's entity translation map. */ virtual const translation_map & entity_translations() const { return parens_serializer_translations(); } virtual node_type * deserialize( std::ostream & dest ) { // NYI! return 0; } /** Writes src out to dest. */ virtual bool serialize( const node_type & src, std::ostream & dest ) { typedef ::P::s11n::node_traits<node_type> NT; size_t depth = this->m_depth++; if( 0 == depth ) { dest << this->magic_cookie() // << "\n(* serializer info: " // << "\n\t" << PARENS_VERSION // << "\n\tBuilt " << __TIME__ << " on " __DATE__ // << "\n*)" << "\n"; } std::string indent; std::string implclass = NT::class_name(src); // i know this quote check is fairly expensive, but 2 bytes per // object adds up. Consider: 10k objects would take up // 20k bytes just in classname quotes! std::string quote = (std::string::npos != implclass.find('<')) ? "\"" : ""; dest << NT::name(src) << "=" << this->m_open << quote << implclass << quote; typename NT::const_iterator beg = NT::begin(src), end = NT::end(src); if( end != beg ) { //PARENS_INDENT(1,0); std::for_each(beg, end, key_value_serializer<node_type>( this->entity_translations(), dest, /* indent + */ ' ' + this->m_open , " ", this->m_close ) ); } typename NT::child_const_iterator chbeg = NT::children(src).begin(), chend = NT::children(src).end(); if( chend != chbeg ) { // got children? dest << '\n'; PARENS_INDENT(1,0); std::for_each( chbeg, chend, node_child_simple_formatter<this_type>( *this, dest, indent, "" ) ); PARENS_INDENT(0,1); } dest << this->m_close << '\n'; if( 0 == depth ) { dest.flush(); // << std::endl; // else client may be forced to manually flush(). } --this->m_depth; return true; } private: size_t m_depth; static const std::string m_open; static const std::string m_close; }; template <typename NodeType> const std::string parens_serializer<NodeType>::m_open = "("; template <typename NodeType> const std::string parens_serializer<NodeType>::m_close = ")"; } } } // namespace P::s11n::io #undef PARENS_VERSION #undef PARENS_INDENT #endif // parens_SERIALIZER_H_INCLUDED |
From: stephan b. <sg...@us...> - 2004-12-26 17:27:56
|
Update of /cvsroot/pclasses/pclasses2/src/s11n/io/parens In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3518/src/s11n/io/parens Log Message: Directory /cvsroot/pclasses/pclasses2/src/s11n/io/parens added to the repository |
From: Christian P. <cp...@us...> - 2004-12-26 17:03:05
|
Update of /cvsroot/pclasses/pclasses2/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31213/src Added Files: Date.cpp Log Message: Added Date class --- NEW FILE: Date.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/Date.h" #include <iomanip> namespace P { Date::Date(unsigned int year, unsigned int month, unsigned int day) throw(InvalidDate) : _year(year), _month(month), _day(day) { if(month > 12 || day > daysInMonth(month, year)) throw InvalidDate("Invalid date", P_SOURCEINFO); } Date::~Date() throw() { } void Date::setYear(unsigned int year) { _year = year; } unsigned int Date::year() const throw() { return _year; } void Date::setMonth(unsigned int month) throw(InvalidDate) { if(month > 12) throw InvalidDate("Invalid month", P_SOURCEINFO); _month = month; } unsigned int Date::month() const throw() { return _month; } unsigned int Date::daysInMonth() throw() { return daysInMonth(_month, _year); } void Date::setDay(unsigned int day) throw(InvalidDate) { unsigned int dim = daysInMonth(_month, _year); if(day <= dim) { _day = day; return; } throw InvalidDate("Invalid day in month", P_SOURCEINFO); } unsigned int Date::day() const throw() { return _day; } double Date::julianDayNumber() const throw() { int a = (14 - _month) / 12; int y = _year + 4800 - a; int m = _month + 12 * a - 3; return (_day + ((153 * m + 2) / 5) + (365 * y) + (y/4) - (y/100) + (y/400) - 32045); } static int _daysInMonth[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; static int _daysOfYear[] = { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 }; unsigned int Date::dayOfYear() const throw() { unsigned int doy = _daysOfYear[_month - 1] + _day; if(isLeapYear(_year) && _month > 1) return doy + 1; return doy; } unsigned int Date::dayOfWeek() const throw() { return ((_year + dayOfYear() + (_year - 1) / 4 - (_year - 1) / 100 + (_year - 1) / 400) % 7); } bool Date::isInLeapYear() const throw() { return isLeapYear(_year); } bool Date::isLeapYear(unsigned int year) throw() { return (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0)); } unsigned int Date::daysInMonth(unsigned int month, unsigned int year) throw(InvalidDate) { unsigned int dim = _daysInMonth[month - 1]; if(isLeapYear(year) && month > 1) return dim + 1; return dim; } bool Date::operator>(const Date& d) const throw() { return (_year > d._year || (_year == d._year && _month > d._month) || (_month == d._month && _day > d._day)); } bool Date::operator<(const Date& d) const throw() { return (_year < d._year || (_year == d._year && _month < d._month) || (_month == d._month && _day < d._day)); } bool Date::operator>=(const Date& d) const throw() { return (operator>(d) || operator==(d)); } bool Date::operator<=(const Date& d) const throw() { return (operator<(d) || operator==(d)); } bool Date::operator==(const Date& d) const throw() { return (_year == d._year && _month == d._month && _day == d._day); } bool Date::operator!=(const Date& d) const throw() { return (!operator==(d)); } std::ostream& operator << (std::ostream& os, const Date& d) { int oldw = os.width(); char oldf = os.fill(); os << std::setfill('0') << std::setw(4) << d.year() << '-' << std::setw(2) << d.month() << '-' << std::setw(2) << d.day() << std::setfill(oldf) << std::setw(oldw); return os; } } // !namespace P |
From: Christian P. <cp...@us...> - 2004-12-26 17:03:04
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31213/include/pclasses Added Files: Date.h Log Message: Added Date class --- NEW FILE: Date.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_Date_h #define P_Date_h #include <pclasses/Exception.h> #include <iostream> namespace P { //! Invalid date error class InvalidDate: public RuntimeError { public: InvalidDate(const char* _what, const SourceInfo& si) : RuntimeError(_what, si) {} }; //! Date class class Date { public: //! Enumeration of weekdays enum weekDay_t { Saturday = 0, Sunday, Monday, Tuesday, Wednesday, Thursday, Friday }; //! Enumeration of months enum month_t { January = 1, February, March, April, May, June, July, August, September, October, November, December }; Date(unsigned int year = 1970, unsigned int month = 1, unsigned int day = 1) throw(InvalidDate); ~Date() throw(); double julianDayNumber() const throw(); void setYear(unsigned int year); unsigned int year() const throw(); void setMonth(unsigned int month) throw(InvalidDate); unsigned int month() const throw(); //! Returns the number of days in stored month unsigned int daysInMonth() throw(); void setDay(unsigned int day) throw(InvalidDate); unsigned int day() const throw(); unsigned int dayOfYear() const throw(); unsigned int dayOfWeek() const throw(); //! Test if date is in a leap year bool isInLeapYear() const throw(); bool operator>(const Date& d) const throw(); bool operator<(const Date& d) const throw(); bool operator>=(const Date& d) const throw(); bool operator<=(const Date& d) const throw(); bool operator==(const Date& d) const throw(); bool operator!=(const Date& d) const throw(); //! Returns the number of days in month static unsigned int daysInMonth(unsigned int month, unsigned int year) throw(InvalidDate); //! Test if the given year is a leap year static bool isLeapYear(unsigned int year) throw(); friend std::ostream& operator << (std::ostream& os, const Date& d); private: unsigned short _year; unsigned char _month; unsigned char _day; }; } // !namespace P #endif |
From: Christian P. <cp...@us...> - 2004-12-26 16:45:58
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27931/include/pclasses Added Files: Time.h TimeSpan.h Log Message: Added TimeSpan and Time class. --- NEW FILE: TimeSpan.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_TimeSpan_h #define P_TimeSpan_h #include <pclasses/Exception.h> namespace P { //! Timespan class /*! This class is used to add or subtract a timespan from a Date, Time or DateTime object. */ class TimeSpan { public: TimeSpan(unsigned int days = 0, unsigned int hours = 0, unsigned int minutes = 0, unsigned int seconds = 0, unsigned int usecs = 0) throw(OverflowError); ~TimeSpan() throw(); void setDays(unsigned int days) throw(OverflowError); unsigned int days() const throw(); void setHours(unsigned int hours) throw(OverflowError); unsigned int hours() const throw(); void setMinutes(unsigned int minutes) throw(OverflowError); unsigned int minutes() const throw(); void setSeconds(unsigned int seconds) throw(OverflowError); unsigned int seconds() const throw(); void setUsecs(unsigned int usec) throw(OverflowError); unsigned int usecs() const throw(); //! Normalize the timespan void normalize() throw(OverflowError); bool operator>(const TimeSpan& sp) const throw(); bool operator<(const TimeSpan& sp) const throw(); bool operator>=(const TimeSpan& sp) const throw(); bool operator<=(const TimeSpan& sp) const throw(); bool operator==(const TimeSpan& sp) const throw(); bool operator!=(const TimeSpan& sp) const throw(); TimeSpan& operator+=(const TimeSpan& sp) throw(OverflowError); TimeSpan& operator-=(const TimeSpan& sp) throw(); friend TimeSpan operator+(const TimeSpan& sp1, const TimeSpan& sp2) throw(OverflowError); friend TimeSpan operator-(const TimeSpan& sp1, const TimeSpan& sp2) throw(); private: unsigned int _days; unsigned int _hours; unsigned int _minutes; unsigned int _seconds; unsigned int _usecs; }; } // !namespace P #endif --- NEW FILE: Time.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_Time_h #define P_Time_h #include <pclasses/Exception.h> #include <iostream> namespace P { //! Invalid time error class InvalidTime: public RuntimeError { public: InvalidTime(const char* _what, const SourceInfo& si) : RuntimeError(_what, si) {} }; //! Time class class Time { public: Time(unsigned int hour = 0, unsigned int minute = 0, unsigned int second = 0, unsigned int usec = 0) throw(InvalidTime); ~Time() throw(); void setHour(unsigned int hour) throw(InvalidTime); unsigned int hour() const throw(); void setMinute(unsigned int minute) throw(InvalidTime); unsigned int minute() const throw(); void setSecond(unsigned int second) throw(InvalidTime); unsigned int second() const throw(); void setUsec(unsigned int usec) throw(InvalidTime); unsigned int usec() const throw(); bool operator>(const Time& t) const throw(); bool operator<(const Time& t) const throw(); bool operator>=(const Time& t) const throw(); bool operator<=(const Time& t) const throw(); bool operator==(const Time& t) const throw(); bool operator!=(const Time& t) const throw(); friend std::ostream& operator << (std::ostream& os, const Time& t); private: unsigned char _hour; unsigned char _minute; unsigned char _second; unsigned int _usec; }; } // !namespace P #endif |
From: Christian P. <cp...@us...> - 2004-12-26 16:45:57
|
Update of /cvsroot/pclasses/pclasses2/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27931/src Added Files: Time.cpp TimeSpan.cpp Log Message: Added TimeSpan and Time class. --- NEW FILE: Time.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/Time.h" #include <iomanip> namespace P { Time::Time(unsigned int hour, unsigned int minute, unsigned int second, unsigned int usec) throw(InvalidTime) : _hour(hour), _minute(minute), _second(second), _usec(usec) { if(hour > 23 || minute > 59 || second > 59 || usec > ((1000*1000)-1)) throw InvalidTime("Invalid time", P_SOURCEINFO); } Time::~Time() throw() { } void Time::setHour(unsigned int hour) throw(InvalidTime) { if(hour > 23) throw InvalidTime("Invalid hour", P_SOURCEINFO); _hour = hour; } unsigned int Time::hour() const throw() { return _hour; } void Time::setMinute(unsigned int minute) throw(InvalidTime) { if(minute > 59) throw InvalidTime("Invalid minute", P_SOURCEINFO); _minute = minute; } unsigned int Time::minute() const throw() { return _minute; } void Time::setSecond(unsigned int second) throw(InvalidTime) { if(second > 59) throw InvalidTime("Invalid second", P_SOURCEINFO); _second = second; } unsigned int Time::second() const throw() { return _second; } void Time::setUsec(unsigned int usec) throw(InvalidTime) { if(usec > (1000 * 1000) - 1) throw InvalidTime("Invalid hour", P_SOURCEINFO); _usec = usec; } unsigned int Time::usec() const throw() { return _usec; } bool Time::operator>(const Time& t) const throw() { return (_hour > t._hour || (_hour == t._hour && _minute > t._minute) || (_hour == t._hour && _minute == t._minute && _second > t._second) || (_hour == t._hour && _minute == t._minute && _second == t._second && _usec > t._usec)); } bool Time::operator<(const Time& t) const throw() { return (_hour < t._hour || (_hour == t._hour && _minute < t._minute) || (_hour == t._hour && _minute == t._minute && _second < t._second) || (_hour == t._hour && _minute == t._minute && _second == t._second && _usec < t._usec)); } bool Time::operator>=(const Time& t) const throw() { return (operator>(t) || operator==(t)); } bool Time::operator<=(const Time& t) const throw() { return (operator<(t) || operator==(t)); } bool Time::operator==(const Time& t) const throw() { return (_hour == t._hour && _minute == t._minute && _second == t._second && _usec == t._usec); } bool Time::operator!=(const Time& t) const throw() { return (!operator==(t)); } std::ostream& operator << (std::ostream& os, const Time& t) { int oldw = os.width(); char oldf = os.fill(); os << std::setfill('0') << std::setw(2) << t.hour() << ':' << std::setw(2) << t.minute() << ':' << std::setw(2) << t.second() << std::setfill(oldf) << std::setw(oldw); return os; } } // !namespace P --- NEW FILE: TimeSpan.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/TimeSpan.h" namespace P { #define CHECK_OVERFLOW(num, add) \ { \ if(add > (2 ^ (sizeof(num) * 8) - num)) \ throw OverflowError("Overflow", P_SOURCEINFO); \ } TimeSpan::TimeSpan(unsigned int days, unsigned int hours, unsigned int minutes, unsigned int seconds, unsigned int usecs) throw(OverflowError) : _days(days), _hours(hours), _minutes(minutes), _seconds(seconds), _usecs(usecs) { normalize(); } TimeSpan::~TimeSpan() throw() { } void TimeSpan::setDays(unsigned int days) throw(OverflowError) { _days = days; } unsigned int TimeSpan::days() const throw() { return _days; } void TimeSpan::setHours(unsigned int hours) throw(OverflowError) { _hours = hours; if(hours > 23) normalize(); } unsigned int TimeSpan::hours() const throw() { return _hours; } void TimeSpan::setMinutes(unsigned int minutes) throw(OverflowError) { _minutes = minutes; if(minutes > 59) normalize(); } unsigned int TimeSpan::minutes() const throw() { return _minutes; } void TimeSpan::setSeconds(unsigned int seconds) throw(OverflowError) { _seconds = seconds; if(seconds > 59) normalize(); } unsigned int TimeSpan::seconds() const throw() { return _seconds; } void TimeSpan::setUsecs(unsigned int usec) throw(OverflowError) { _usecs = usec; if(usec > ((1000 * 1000) - 1)) normalize(); } unsigned int TimeSpan::usecs() const throw() { return _usecs; } void TimeSpan::normalize() throw(OverflowError) { if(_usecs > (1000 * 1000) - 1) { unsigned int secs = _usecs / (1000 * 1000); CHECK_OVERFLOW(_seconds, secs); _seconds += secs; _usecs -= secs * (1000 * 1000); } if(_seconds > 59) { unsigned int mins = _seconds / 60; CHECK_OVERFLOW(_minutes, mins); _minutes += mins; _seconds -= mins * 60; } if(_minutes > 59) { unsigned int hours = _minutes / 60; CHECK_OVERFLOW(_hours, hours); _hours += hours; _minutes -= hours * 60; } if(_hours > 23) { unsigned int days = _hours / 24; CHECK_OVERFLOW(_days, days); _days += days; _hours -= days * 24; } } bool TimeSpan::operator>(const TimeSpan& sp) const throw() { return (_days > sp._days || (_days == sp._days && _hours > sp._hours) || (_hours == sp._hours && _minutes > sp._minutes) || (_minutes == sp._minutes && _seconds > sp._seconds) || (_seconds == sp._seconds && _usecs > sp._usecs)); } bool TimeSpan::operator<(const TimeSpan& sp) const throw() { return (_days < sp._days || (_days == sp._days && _hours < sp._hours) || (_hours == sp._hours && _minutes < sp._minutes) || (_minutes == sp._minutes && _seconds < sp._seconds) || (_seconds == sp._seconds && _usecs < sp._usecs)); } bool TimeSpan::operator>=(const TimeSpan& sp) const throw() { return (operator>(sp) || operator==(sp)); } bool TimeSpan::operator<=(const TimeSpan& sp) const throw() { return (operator<(sp) || operator==(sp)); } bool TimeSpan::operator==(const TimeSpan& sp) const throw() { return (_days == sp._days && _hours == sp._hours && _minutes == sp._minutes && _seconds == sp._seconds && _usecs == sp._usecs); } bool TimeSpan::operator!=(const TimeSpan& sp) const throw() { return (!operator==(sp)); } TimeSpan& TimeSpan::operator+=(const TimeSpan& sp) throw(OverflowError) { CHECK_OVERFLOW(_days, sp._days); CHECK_OVERFLOW(_hours, sp._hours); CHECK_OVERFLOW(_minutes, sp._minutes); CHECK_OVERFLOW(_seconds, sp._seconds); CHECK_OVERFLOW(_usecs, sp._usecs); _days += sp._days; _hours += sp._hours; _minutes += sp._minutes; _seconds += sp._seconds; _usecs += sp._usecs; normalize(); return *this; } TimeSpan& TimeSpan::operator-=(const TimeSpan& sp) throw() { if(sp._days > _days) _days = 0; else _days -= sp._days; if(sp._hours > _hours) _hours = 0; else _hours -= sp._hours; if(sp._minutes > _minutes) _minutes = 0; else _minutes -= sp._minutes; if(sp._seconds > _seconds) _seconds = 0; else _seconds -= sp._seconds; if(sp._usecs > _usecs) _usecs = 0; else _usecs -= sp._usecs; normalize(); return *this; } TimeSpan operator+(const TimeSpan& sp1, const TimeSpan& sp2) throw(OverflowError) { TimeSpan ret = sp1; ret += sp2; return ret; } TimeSpan operator-(const TimeSpan& sp1, const TimeSpan& sp2) throw() { TimeSpan ret = sp1; ret -= sp2; return ret; } } // !namespace P |
From: stephan b. <sg...@us...> - 2004-12-26 16:26:47
|
Update of /cvsroot/pclasses/pclasses2/src/IO In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24991/src/IO Modified Files: Makefile.toc Log Message: Added URL. Index: Makefile.toc =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/IO/Makefile.toc,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Makefile.toc 24 Dec 2004 23:06:26 -0000 1.3 +++ Makefile.toc 26 Dec 2004 16:26:28 -0000 1.4 @@ -2,12 +2,14 @@ include toc.make SOURCES = IODevice.cpp \ - IOError.cpp + IOError.cpp \ + URL.cpp DIST_FILES += $(SOURCES) OBJECTS = IODevice.o \ - IOError.o + IOError.o \ + URL.o CLEAN_FILES += $(OBJECTS) |
From: stephan b. <sg...@us...> - 2004-12-26 16:26:40
|
Update of /cvsroot/pclasses/pclasses2/src/IO In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24892/src/IO Added Files: URL.cpp Log Message: egg - ported in from p1. It is missing the port lookup routines, because of a dependency on Net. --- NEW FILE: URL.cpp --- /* * P::Classes - Portable C++ Application Framework * Copyright (C) 2000-2002 Christian Prochnow <cp...@se...> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "pclasses/IO/URL.h" // #include "pclasses/ptypes.h" // #include "pclasses/pnetdb.h" #ifndef WIN32 #include <netinet/in.h> #include <arpa/inet.h> #include <netdb.h> #endif #include <sstream> namespace P { namespace IO { using namespace std; URL::URL() { m_proto = "file"; m_port = 0; m_path = "/"; } URL::URL(const string& url) throw(InvalidURL/*,NetDbError*/) { *this = url; } URL::URL(const URL& url) : m_proto(url.m_proto), m_host(url.m_host), m_user(url.m_user), m_passwd(url.m_passwd), m_port(url.m_port), m_path(url.m_path) {} URL::~URL() { } void URL::setProtocol(const string& proto, bool setPort) { m_proto = proto; if(setPort) { m_port = lookupPort(proto); } } void URL::setHost(const string& host) { m_host = host; } void URL::setUser(const string& user) { m_user = user; } void URL::setPassword(const string& passwd) { m_passwd = passwd; } void URL::setPort(unsigned short port) { m_port = port; } void URL::setPath(const string& path) { if(path.empty()) m_path = "/"; else m_path = path; } URL& URL::operator=(const URL& url) { m_proto = url.m_proto; m_host = url.m_host; m_user = url.m_user; m_passwd= url.m_passwd; m_port = url.m_port; m_path = url.m_path; return *this; } URL& URL::operator=(const string& url) throw(InvalidURL/*,NetDbError*/) { string proto, host, user, passwd, path, port; istringstream is(url); ostringstream os; char ch; bool atfound = url.find('@') != (size_t)-1 ? true : false; // parse until protocol delimiter found... while((is >> ch)) { if(ch == ':') { if((is >> ch) && ch == '/' && (is >> ch) && ch == '/') break; throw InvalidURL(std::string("Invalid url: "+url).c_str(), P_SOURCEINFO); } else if(!isalnum(ch) && !isalpha(ch)) throw InvalidURL(std::string("Invalid url: "+url).c_str(), P_SOURCEINFO); os << ch; } if(!is) throw InvalidURL("Invalid url", P_SOURCEINFO); proto = os.str(); os.str(""); // parse hostname ... bool atproc = false; while((is >> ch)) { // username in hostname ? if(ch == '@') { user = os.str(); os.str(""); size_t pos = user.find(':'); if(pos != (size_t)-1) { passwd = user.substr(pos+1, user.length() - (pos + 1)); user = user.substr(0, pos); } atproc = true; continue; } else if(((atfound && ch == ':') && (atproc && ch == ':')) || ch == '/') break; os << ch; } host = os.str(); os.str(""); if(!is) { m_proto = proto; m_host = host; m_user = user; m_passwd= passwd; m_port = lookupPort(proto); m_path = "/"; return *this; } // parse port ... if(ch == ':') { while((is >> ch)) { if(ch == '/') break; else if(!isdigit(ch)) throw InvalidURL("Non-digit in port not allowed", P_SOURCEINFO); os << ch; } port = os.str(); os.str(""); } if(!is) { m_proto = proto; m_host = host; m_user = user; m_passwd= passwd; m_port = atoi(port.c_str()); if(!m_port) m_port = lookupPort(proto); m_path = "/"; return *this; } os << '/'; // parse path while((is >> ch)) os << ch; m_proto = proto; m_host = host; m_user = user; m_passwd= passwd; m_port = atoi(port.c_str()); if(!m_port) m_port = lookupPort(proto); m_path = os.str(); return *this; } bool URL::operator==(const URL& url) const { if(m_proto == url.m_proto && m_host == url.m_host && m_user == url.m_user && m_passwd == url.m_passwd && m_port == url.m_port && m_path == url.m_path) return true; return false; } string URL::str() const { ostringstream os; os << *this; return os.str(); } ostream& operator<<(ostream& os, const URL& url) { os << url.m_proto << "://"; if(!url.m_user.empty()) { os << url.m_user; os << '@'; } os << url.m_host; if(url.m_port != URL::lookupPort(url.m_proto)) os << ':' << url.m_port; os << url.m_path; return os; } istream& operator>>(istream& is, URL& url) throw(InvalidURL) { string str; if(is) { is >> str; url = str; } return is; } unsigned short URL::lookupPort(const string& service, const string& proto) { return 0; // NetDb::ServiceEntry se = NetDb::serviceByName(service, proto); // return se.port(); } }} // P::IO |
From: stephan b. <sg...@us...> - 2004-12-26 16:26:39
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses/IO In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24892/include/pclasses/IO Added Files: URL.h Log Message: egg - ported in from p1. It is missing the port lookup routines, because of a dependency on Net. --- NEW FILE: URL.h --- /* * P::Classes - Portable C++ Application Framework * Copyright (C) 2000-2002 Christian Prochnow <cp...@se...> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _purl_h_ #define _purl_h_ // #include <pclasses/pexport.h> #include <pclasses/Exception.h> // #include <pclasses/pnetdb.h> #include <iostream> #include <string> namespace P { namespace IO { //! Invalid url error /*! \ingroup net \author Christian Prochnow <cp...@se...> */ class /* PNET_EXPORT*/ InvalidURL: public RuntimeError { public: inline InvalidURL(const char* _what, const SourceInfo& _si) throw() : RuntimeError(_what,_si) {} }; //! Uniform resource locator /*! This class is used to parse and store uniform resource locators. When storing a URL with password the password will not be printed out by the operator<< but can be retrieved via password(). \ingroup net \author Christian Prochnow <cp...@se...> */ class /*PNET_EXPORT*/ URL { public: //! Default constructor /*! Initializes the URL to 'file:///' */ URL(); //! Parse URL constructor URL(const std::string& url) throw(InvalidURL/*,NetDbError*/); URL(const URL& url); ~URL(); inline const std::string& protocol() const { return m_proto; } /** Achtung: setPort is currently ignored, and might go away, due to a dep on network libs. */ void setProtocol(const std::string& proto, bool setPort = true); inline const std::string& host() const { return m_host; } void setHost(const std::string& host); inline const std::string& user() const { return m_user; } void setUser(const std::string& user); inline const std::string& password() const { return m_passwd; } void setPassword(const std::string& passwd); inline unsigned short port() const { return m_port; } void setPort(unsigned short port); inline const std::string& path() const { return m_path; } void setPath(const std::string& path); URL& operator=(const URL& url); URL& operator=(const std::string& url) throw(InvalidURL/*,NetDbError*/); bool operator==(const URL& url) const; std::string str() const; /* PNET_EXPORT*/ friend std::ostream& operator<<(std::ostream& os, const URL& url); /*PNET_EXPORT*/ friend std::istream& operator>>(std::istream& is, URL& url) throw(InvalidURL); private: /** currently always returns 0. */ static unsigned short lookupPort(const std::string& service, const std::string& proto = "tcp"); // const? std::string m_proto; std::string m_host; std::string m_user; std::string m_passwd; unsigned short m_port; std::string m_path; }; }} // P::IO #endif |
From: stephan b. <sg...@us...> - 2004-12-26 16:26:37
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses/IO In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24991/include/pclasses/IO Modified Files: Makefile.toc Log Message: Added URL. Index: Makefile.toc =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/IO/Makefile.toc,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Makefile.toc 24 Dec 2004 04:49:26 -0000 1.1 +++ Makefile.toc 26 Dec 2004 16:26:28 -0000 1.2 @@ -1,9 +1,12 @@ #!/usr/bin/make -f include toc.make + HEADERS = IODevice.h \ - IOError.h + IOError.h \ + URL.h + DIST_FILES += $(HEADERS) INSTALL_PACKAGE_HEADERS += $(HEADERS) -INSTALL_PACKAGE_HEADERS_DEST = $(prefix)/include/pclasses/IO +INSTALL_PACKAGE_HEADERS_DEST = $(INSTALL_PACKAGE_HEADERS_BASE)/IO all: |
From: stephan b. <sg...@us...> - 2004-12-26 15:23:06
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses/Util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16066/include/pclasses/Util Modified Files: ManagedThread.h Log Message: Added empty impl for suspended() and resumed(). Index: ManagedThread.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/Util/ManagedThread.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- ManagedThread.h 22 Dec 2004 17:54:41 -0000 1.1.1.1 +++ ManagedThread.h 26 Dec 2004 15:22:42 -0000 1.2 @@ -62,8 +62,11 @@ virtual int init(); virtual int main() = 0; virtual void cleanup(); - virtual void suspended(); - virtual void resumed(); + virtual void suspended() {}; + virtual void resumed() {}; + // ^^^^^ACHTUNG: no-op impls of suspended()/resumed() added by + // stephan to work around a link error. i have no clue what + // they SHOULD do. private: virtual int main(void* arg); |
From: stephan b. <sg...@us...> - 2004-12-26 15:19:16
|
Update of /cvsroot/pclasses/pclasses2/src/System In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15448/src/System Modified Files: Makefile.toc Log Message: Added SharedLibCache.h Index: Makefile.toc =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/System/Makefile.toc,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- Makefile.toc 24 Dec 2004 23:06:27 -0000 1.9 +++ Makefile.toc 26 Dec 2004 15:19:06 -0000 1.10 @@ -2,12 +2,12 @@ include toc.make -HEADERS = timeout.h +HEADERS = timeout.h SharedLibCache.h DIST_FILES += $(HEADERS) -INSTALL_PACKAGE_HEADERS += $(HEADERS) - +INSTALL_PACKAGE_HEADERS = $(HEADERS) +INSTALL_PACKAGE_HEADERS_DEST = $(INSTALL_PACKAGE_HEADERS_BASE)/System SOURCES_COMMON = \ |
From: Christian P. <cp...@us...> - 2004-12-26 14:54:59
|
Update of /cvsroot/pclasses/pclasses2/src/System In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11424/src/System Modified Files: SharedLibCache.h Log Message: Fixed SharedLibCache::add() Index: SharedLibCache.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/System/SharedLibCache.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- SharedLibCache.h 26 Dec 2004 14:38:09 -0000 1.3 +++ SharedLibCache.h 26 Dec 2004 14:54:50 -0000 1.4 @@ -54,7 +54,7 @@ _handles.clear(); } - void add(const std::string& name, unsigned long handle) + void add(const std::string& name, handle_t handle) { iterator i = _handles.find(name); if(i == _handles.end()) |
From: stephan b. <sg...@us...> - 2004-12-26 14:54:40
|
Update of /cvsroot/pclasses/pclasses2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11374 Modified Files: toc.pclasses2.make.at Log Message: Removed a lot of now-bogus LD flags. Index: toc.pclasses2.make.at =================================================================== RCS file: /cvsroot/pclasses/pclasses2/toc.pclasses2.make.at,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- toc.pclasses2.make.at 26 Dec 2004 04:10:57 -0000 1.6 +++ toc.pclasses2.make.at 26 Dec 2004 14:54:30 -0000 1.7 @@ -23,21 +23,27 @@ ######################################################################## # P_BACKLINK_LDADD is for use by in-tree libs which need a -L arg # to link back to other in-tree libs. -P_BACKLINK_LDADD = -L$(top_srcdir)/lib \ - -L$(top_srcdir)/src \ - $(addprefix -L$(top_srcdir)/src/,System Util Unicode IO Net) +P_BACKLINK_LDADD = -L$(top_srcdir)/lib +# -L$(top_srcdir)/src $(addprefix -L$(top_srcdir)/src/,System Util Unicode IO Net) #################################################################################### # Linker args for in-build-tree tests, so they can link back to the in-tree # shared libs easily... -LIBP_TESTS_LDADD = -rdynamic $(P_BACKLINK_LDADD) -L$(top_srcdir)/lib $(LIBPCORE_CLIENT_LDADD) +LIBP_TESTS_LDADD = -rdynamic $(P_BACKLINK_LDADD) $(LIBPCORE_CLIENT_LDADD) ######################################################################## # HUGE KLUDGE to shut up 'no rule to make target -lfoo' errors from make: -l$(LIBPCORE_BASENAME): + @true -l$(LIBPNET_BASENAME): + @true -l$(LIBPIO_BASENAME): + @true -l$(LIBPUNICODE_BASENAME): + @true -l$(LIBPSYSTEM_BASENAME): + @true -l$(LIBPUTIL_BASENAME): + @true -l$(LIBPS11N_BASENAME): + @true |
From: Christian P. <cp...@us...> - 2004-12-26 14:51:00
|
Update of /cvsroot/pclasses/pclasses2/src/System In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10867/src/System Modified Files: SharedLib.ltdl.cpp Log Message: Some fixes. Removed lt_handle_map(). Added support for SharedLibCache. Index: SharedLib.ltdl.cpp =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/System/SharedLib.ltdl.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- SharedLib.ltdl.cpp 26 Dec 2004 14:38:09 -0000 1.7 +++ SharedLib.ltdl.cpp 26 Dec 2004 14:50:52 -0000 1.8 @@ -41,16 +41,7 @@ } int ltdl_init_placeholder = (ltdl_init(),0); -typedef unsigned long handle_type; -typedef std::map<handle_type,lt_dlhandle> lt_handle_map_t; - struct ltdl_sharing_context {}; // marker class -lt_handle_map_t & -lt_handle_map() -{ - typedef ::P::Phoenix< lt_handle_map_t, ltdl_sharing_context > PHX; - return PHX::instance(); -} int BindMode2Flags(SharedLib::BindMode mode) { // ltdl doesn't use dlopen() flags @@ -61,7 +52,7 @@ { void operator()(lt_dlhandle handle) { - lt_dlclose((handle); + lt_dlclose(handle); } }; @@ -89,7 +80,7 @@ SharedLib::SharedLib(const std::string& name, BindMode mode) throw(SystemError) : _handle(0) { - Cache& cache = shared_lib_cache<unsigned long, SharedLibCloser>(); + Cache& cache = shared_lib_cache<lt_dlhandle, SharedLibCloser>(); CriticalSection::ScopedLock lck(cache.mutex); // see if we can get it from the handle cache ... @@ -99,11 +90,10 @@ lt_dlhandle h = lt_dlopen(name.c_str() /** BindMode2Flags(mode) */ ); if( h ) { - _handle = reinterpret_cast<handle_type>( static_cast<void *>( h ) ); - lt_handle_map().insert( std::make_pair( _handle, h ) ); + _handle = (unsigned long)h; // add it to the handle cache - cache.add(name, _handle); + cache.add(name, h); } else { @@ -113,19 +103,12 @@ } else { - _handle = i->second; + _handle = (unsigned long)i->second; } } SharedLib::~SharedLib() throw() { - lt_handle_map_t::iterator it = lt_handle_map().find( _handle ); - if( lt_handle_map().end() != it ) - { - // CERR << "~SharedLib() erasing a handle: " << _handle << "\n"; -// lt_dlclose((*it).second); - lt_handle_map().erase( it ); - } } void* SharedLib::operator[](const char* symbol) throw(RuntimeError) @@ -134,12 +117,8 @@ { throw RuntimeError( "Invalid symbol (null).", P_SOURCEINFO ); } - lt_handle_map_t::iterator it = lt_handle_map().find( _handle ); - if( lt_handle_map().end() == it ) - { - throw RuntimeError( "DLL handle is invalid.", P_SOURCEINFO ); - } - lt_dlhandle lth = (*it).second; + + lt_dlhandle lth = (lt_dlhandle)_handle; void* addr = lt_dlsym( lth, symbol); if(!addr) { |
From: stephan b. <sg...@us...> - 2004-12-26 14:44:55
|
Update of /cvsroot/pclasses/pclasses2/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9868/test Modified Files: s11nTest.cpp Log Message: Worked around compiler bug :(. Added s11n_cast() demo. Index: s11nTest.cpp =================================================================== RCS file: /cvsroot/pclasses/pclasses2/test/s11nTest.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- s11nTest.cpp 26 Dec 2004 08:09:07 -0000 1.4 +++ s11nTest.cpp 26 Dec 2004 14:44:46 -0000 1.5 @@ -14,20 +14,34 @@ using namespace ::P::SIO; +typedef std::list<std::string> TestListType2; +typedef std::list<P::Util::LexT> TestListType; +// compiler bug, gcc 3.3.5 20040809 +// When adding :: before P in the above decl it fails +// with a 'parse error before :', but it allows +// me to do :: on the map here: typedef std::map<std::string,::P::Util::LexT> TestMapType; +#define USE_FAT_PROXIES 1 +#if ! USE_FAT_PROXIES // install a custom proxy, which doesn't produce as fat // output as the default one for maps: -#define PS11N_TYPE TestMapType -#define PS11N_TYPE_NAME "TestMapType" -#define PS11N_SERIALIZE_FUNCTOR ::P::s11n::map::streamable_map_serializable_proxy -#include <pclasses/s11n/reg_serializable_traits.h> +# define PS11N_TYPE TestMapType +# define PS11N_TYPE_NAME "TestMapType" +# define PS11N_SERIALIZE_FUNCTOR ::P::s11n::map::streamable_map_serializable_proxy +# include <pclasses/s11n/reg_serializable_traits.h> +// ditto for our list... +# define PS11N_TYPE TestListType +# define PS11N_TYPE_NAME "TestListType" +# define PS11N_SERIALIZE_FUNCTOR ::P::s11n::list::streamable_list_serializable_proxy +# include <pclasses/s11n/reg_serializable_traits.h> +#endif // ! USE_FAT_PROXIES #define SERIALIZE(Node,SType,SObj) serialize< SType >( Node, SObj ) #define DESERIALIZE(Node,SType) deserialize< SType >( Node ) -#define SERIALIZER_CLASS_NAME "<!DOCTYPE P::s11n::io::expat_serializer>" +#define SERIALIZER_CLASS_NAME "expat" // #define SERIALIZER_CLASS_NAME "expat" bool test_load( const std::string & fn ) @@ -80,8 +94,7 @@ NODETR::clear(node); using ::P::Util::LexT; - typedef std::list<LexT> ListT; - ListT list; + TestListType list; TestMapType map; LexT tmpv; LexT tmpk; @@ -99,6 +112,25 @@ CERR << "Containers...\n"; + TestMapType::const_iterator mit; + TestListType::const_iterator lit = list.begin(); + size_t at = 0; + if( 0 ) + { + while( lit != list.end() ) + { + CERR << "list["<<at++<<"] = " << (*(lit++))<<"\n"; + } + mit = map.begin(); + while( mit != map.end() ) + { + CERR << "map["<<(*mit).first<<"] = "<<(*mit).second<<"\n"; + ++mit; + } + } + + + assert( serialize(node,list) ); assert( ser->serialize( node, std::cout ) ); list.clear(); @@ -117,18 +149,29 @@ // now prove it... - ListT::const_iterator lit = list.begin(); - size_t at = 0; - while( lit != list.end() ) - { - CERR << "list["<<at++<<"] = " << (*(lit++))<<"\n"; - } - TestMapType::const_iterator mit = map.begin(); - while( mit != map.end() ) + if( 0 ) { - CERR << "map["<<(*mit).first<<"] = "<<(*mit).second<<"\n"; - ++mit; + lit = list.begin(); + at = 0; + while( lit != list.end() ) + { + CERR << "list["<<at++<<"] = " << (*(lit++))<<"\n"; + } + mit = map.begin(); + while( mit != map.end() ) + { + CERR << "map["<<(*mit).first<<"] = "<<(*mit).second<<"\n"; + ++mit; + } } + + CERR << "s11n_cast(list,list2)...\n"; + TestListType2 list2; + assert( s11n_cast( list, list2 ) && "s11n_cast() failed :(" ); + // ^^^ reminder: only works when list and list2 use compatible + // proxies!!! + CERR << "casted-to list (size=="<<list2.size()<<"):\n"; + save( list2, std::cout ); return 0; } |
From: stephan b. <sg...@us...> - 2004-12-26 14:43:13
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses/Util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9584/include/pclasses/Util Modified Files: LexT.h Log Message: Corrected file header. Index: LexT.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/Util/LexT.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- LexT.h 26 Dec 2004 01:43:53 -0000 1.2 +++ LexT.h 26 Dec 2004 14:43:03 -0000 1.3 @@ -1,7 +1,9 @@ #ifndef p_UTIL_LEXT_HPP_INCLUDED #define p_UTIL_LEXT_HPP_INCLUDED 1 //////////////////////////////////////////////////////////////////////// -// LexT.hpp: the lext::LexT class +// LexT.h: the P::Util::LexT class +// author: st...@s1... +// License: Public Domain //////////////////////////////////////////////////////////////////////// |
From: stephan b. <sg...@us...> - 2004-12-26 14:42:26
|
Update of /cvsroot/pclasses/pclasses2/src/s11n In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9436/src/s11n Modified Files: test.cpp Log Message: now compiles with latest ps11n code. Index: test.cpp =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/s11n/test.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- test.cpp 26 Dec 2004 02:06:57 -0000 1.4 +++ test.cpp 26 Dec 2004 14:42:18 -0000 1.5 @@ -132,7 +132,7 @@ worked = ::P::s11n::deserialize( node, list ); assert( worked && "deser list failed :(" ); - node.clear(); + TRAITS::clear(node); assert( ::P::s11n::serialize(node,map) ); map.clear(); worked = ::P::s11n::deserialize( node, map ); |