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...> - 2005-01-14 14:56:13
|
Update of /cvsroot/pclasses/pclasses2/src/Net In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21205/src/Net Added Files: RTSPSocket.cpp RTSPHeader.cpp Log Message: Migrating RTSP standalone lib based on P1 --- NEW FILE: RTSPSocket.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/IO/IOStream.h" #include "pclasses/Net/RTSPSocket.h" #include <sstream> namespace P { namespace Net { extern Socket::Domain AddrFamily2Domain(int family); RTSPRequest::RTSPRequest(Method method) : _method(method), _url(), _urlValid(false) { } RTSPRequest::RTSPRequest(Method method, const IO::URL& url) : _method(method), _url(url), _urlValid(true) { } RTSPRequest::~RTSPRequest() throw() { } RTSPRequest::Method RTSPRequest::method() const throw() { return _method; } void RTSPRequest::setUrl(const IO::URL& url) throw() { _url = url; } const IO::URL& RTSPRequest::url() const throw() { return _url; } void RTSPRequest::clearUrl() throw() { _urlValid = false; _url = IO::URL(); } bool RTSPRequest::hasUrl() const throw() { return _urlValid; } const RTSPRequestHeader& RTSPRequest::header() const throw() { return _header; } RTSPRequestHeader& RTSPRequest::header() throw() { return _header; } RTSPResponse::RTSPResponse(RTSPSocket& socket, const std::string& protoVer, int code, const std::string& reason) : _socket(&socket), _protoVer(protoVer), _statusCode(code), _reason(reason), _bytesRead(0), _contentLength(0) { setAccess(Read); setValid(true); setEof(false); } RTSPResponse::~RTSPResponse() throw() { try { close(); } catch(...) { } } const RTSPResponseHeader& RTSPResponse::header() const throw() { return _header; } RTSPResponseHeader& RTSPResponse::header() throw() { return _header; } const std::string& RTSPResponse::protocolVersion() const throw() { return _protoVer; } int RTSPResponse::statusCode() const throw() { return _statusCode; } const std::string& RTSPResponse::reason() const throw() { return _reason; } void RTSPResponse::_close() throw(IO::IOError) { setValid(false); setAccess(None); setEof(true); _socket = 0; } size_t RTSPResponse::_write(const char* buffer, size_t count) throw(IO::IOError) { return 0; } size_t RTSPResponse::_read(char* buffer, size_t count) throw(IO::IOError) { if(!_bytesRead) { RTSPHeader::const_iterator i = _header.find("Content-Length"); if(i != _header.end()) { std::istringstream is(i->second); is >> _contentLength; } } size_t ret; // we know the size of the response body ... if(_contentLength > 0) { if(_bytesRead == _contentLength) { setEof(true); return 0; } size_t bytesLeft = _contentLength - _bytesRead; if(count > bytesLeft) count = bytesLeft; ret = _socket->read(buffer, count); _bytesRead += ret; if(!ret) setEof(true); } // we do not know the size of the response body ... // the connection will probably be closed after receiving // the body // XXXX RTSP requires !!! the presence of the Content-Length field else { ret = _socket->read(buffer, count); _bytesRead += ret; if(!ret) setEof(true); } return ret; } RTSPSocket::RTSPSocket() : StreamSocket() { } RTSPSocket::RTSPSocket(Domain d) : StreamSocket() { open(d); } RTSPSocket::RTSPSocket(const NetworkAddress& addr, port_t port) : StreamSocket() { open(AddrFamily2Domain(addr.family())); connect(addr, port); } RTSPSocket::~RTSPSocket() throw() { } void RTSPSocket::open(Domain d) throw(IO::IOError) { Socket::open(d, Stream, 0); } void RTSPSocket::sendRequest(RTSPRequest& req) throw(IO::IOError) { IO::IOStream reqs(*this); switch(req.method()) { case RTSPRequest::DESCRIBE: reqs << "DESCRIBE "; break; case RTSPRequest::ANNOUNCE: reqs << "ANNOUNCE "; break; case RTSPRequest::GET_PARAMETER: reqs << "GET_PARAMETER "; break; case RTSPRequest::OPTIONS: reqs << "OPTIONS "; break; case RTSPRequest::PAUSE: reqs << "PAUSE "; break; case RTSPRequest::PLAY: reqs << "PLAY "; break; case RTSPRequest::RECORD: reqs << "RECORD "; break; case RTSPRequest::REDIRECT: reqs << "REDIRECT "; break; case RTSPRequest::SETUP: reqs << "SETUP "; break; case RTSPRequest::SET_PARAMETER: reqs << "SET_PARAMETER "; break; case RTSPRequest::TEARDOWN: reqs << "TEARDOWN "; break; default: throw RuntimeError("RTSP request not implemented",P_SOURCEINFO); } // send URL .. if(req.hasUrl()) reqs << req.url().path(); else reqs << "*"; // send protocol version .. reqs << " RTSP/1.0\r\n"; // send header lines ... RTSPHeader::const_iterator i = req.header().begin(); bool hostFound = false; while(i != req.header().end()) { if(i->first == "Host") hostFound = true; reqs << i->first << ": " << i->second << "\r\n"; ++i; } if(!hostFound) reqs << "Host: " << req.url().host() << "\r\n"; // terminate request and flush stream reqs << "\r\n"; reqs.sync(); } RTSPResponse RTSPSocket::readResponse() throw(IO::IOError) { std::string line1 = readLine(); std::string rtspProto, rtspResponse; int rtspResponseCode; std::string tmp; std::istringstream is(line1); is >> rtspProto; is >> rtspResponseCode; is >> rtspResponse; RTSPResponse resp(*this, rtspProto, rtspResponseCode, rtspResponse); while(1) { tmp = readLine(); // response header terminated ? if(tmp == "\r\n" || tmp == "\n") break; size_t pos = tmp.find(':'); if(pos != std::string::npos && tmp.size() > 4) { std::string headName = tmp.substr(0, pos); std::string headVal = tmp.substr(pos+2, tmp.size()-(pos+4)); std::cerr << headName << '=' << headVal << std::endl; resp.header().set(headName, headVal); } } return resp; } } // !namespace Net } // !namespace P --- NEW FILE: RTSPHeader.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/Net/RTSPHeader.h" namespace P { namespace Net { RTSPHeader::RTSPHeader() { } RTSPHeader::~RTSPHeader() { } RTSPRequestHeader::RTSPRequestHeader() { } RTSPRequestHeader::~RTSPRequestHeader() { } RTSPResponseHeader::RTSPResponseHeader() { } RTSPResponseHeader::~RTSPResponseHeader() { } } // !namespace Net } // !namespace P |
|
From: Christian P. <cp...@us...> - 2005-01-14 14:56:13
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses/Net In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21205/include/pclasses/Net Added Files: RTSPSocket.h RTSPHeader.h Log Message: Migrating RTSP standalone lib based on P1 --- NEW FILE: RTSPSocket.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. * ***************************************************************************/ #include <pclasses/IO/URL.h> #include <pclasses/IO/IODevice.h> #include <pclasses/Net/Socket.h> #include <pclasses/Net/RTSPHeader.h> namespace P { namespace Net { //! RTSP request class class RTSPRequest { public: //! RTSP Request methods enum Method { DESCRIBE, ANNOUNCE, GET_PARAMETER, OPTIONS, PAUSE, PLAY, RECORD, REDIRECT, SETUP, SET_PARAMETER, TEARDOWN }; RTSPRequest(Method m); RTSPRequest(Method m, const IO::URL& url); ~RTSPRequest() throw(); Method method() const throw(); void setUrl(const IO::URL& url) throw(); void clearUrl() throw(); bool hasUrl() const throw(); const IO::URL& url() const throw(); const RTSPRequestHeader& header() const throw(); RTSPRequestHeader& header() throw(); private: Method _method; IO::URL _url; bool _urlValid; RTSPRequestHeader _header; }; class RTSPSocket; //! RTSP response class class RTSPResponse: public IO::IODevice { public: RTSPResponse(RTSPSocket& socket, const std::string& protoVer, int code, const std::string& reason); ~RTSPResponse() throw(); const RTSPResponseHeader& header() const throw(); RTSPResponseHeader& header() throw(); const std::string& protocolVersion() const throw(); int statusCode() const throw(); const std::string& reason() const throw(); private: void _close() throw(IO::IOError); size_t _write(const char* buffer, size_t count) throw(IO::IOError); size_t _read(char* buffer, size_t count) throw(IO::IOError); RTSPSocket* _socket; RTSPResponseHeader _header; std::string _protoVer; int _statusCode; std::string _reason; size_t _bytesRead; size_t _contentLength; }; //! RTSP coomunication socket class RTSPSocket: public StreamSocket { public: RTSPSocket(); RTSPSocket(Socket::Domain d); RTSPSocket(const NetworkAddress& addr, port_t port); ~RTSPSocket() throw(); void open(Domain d) throw(IO::IOError); void sendRequest(RTSPRequest& req) throw(IO::IOError); RTSPResponse readResponse() throw(IO::IOError); }; } // !namespace Net } // !namespace P --- NEW FILE: RTSPHeader.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_Net_RTSPHeader_h #define P_Net_RTSPHeader_h #include <pclasses/PropertyMap.h> #include <string> namespace P { namespace Net { //! RTSP Header base-class class RTSPHeader: public PropertyMap<std::string, std::string> { public: RTSPHeader(); ~RTSPHeader(); /* SETUP, optional standard values request: no-cache, max-stale, min-fresh, only-if-cached response: public, private, no-cache, no-transform, must-revalidate, proxy-revalidate, max-age=<delta seconds> */ inline void setCacheControl(const std::string& val) { set("Cache-Control", val); } /* all, required */ inline void setConnection(const std::string& val) { set("Connection", val); } inline const std::string& connection() const { return get("Connection"); } /* all, optional */ inline void setDate(const std::string& val) { set("Date", val); } /* all, optional */ inline void setVia(const std::string& val) { set("Via", val); } /* all, required */ inline void setCSeq(const std::string& val) { set("CSeq", val); } /* all but SETUP, OPTIONS - required */ inline void setSession(const std::string& val) { set("Session", val); } /* PLAY, PAUSE, RECORD - optional */ inline void setRange(const std::string& val) { set("Range", val); } }; //! RTSP Request header class RTSPRequestHeader: public RTSPHeader { public: RTSPRequestHeader(); ~RTSPRequestHeader(); /* entity, optional */ inline void setAccept(const std::string& val) { set("Accept", val); } /* entity, optional */ inline void setAcceptEncoding(const std::string& val) { set("Accept-Encoding", val); } /* all, optional */ inline void setAcceptLanguage(const std::string& val) { set("Accept-Language", val); } /* all, optional */ inline void setAuthorization(const std::string& val) { set("Authorization", val); } /* all, optional */ inline void setFrom(const std::string& val) { set("From", val); } /* DESCRIBE, SETUP - optional */ inline void setIfModifiedSince(const std::string& val) { set("If-Modified-Since", val); } /* all, optional */ inline void setReferer(const std::string& val) { set("Referer", val); } /* all, optional */ inline void setUserAgent(const std::string& val) { set("User-Agent", val); } inline void setProxyRequire(const std::string& val) { set("Proxy-Require", val); } }; //! RTSP Response header class RTSPResponseHeader: public RTSPHeader { public: RTSPResponseHeader(); ~RTSPResponseHeader(); inline void setLocation(const std::string& val) { set("Location", val); } inline void setProxyAuthenticate(const std::string& val) { set("Proxy-Authenticate", val); } inline void setPublic(const std::string& val) { set("Public", val); } inline void setRetryAfter(const std::string& val) { set("Retry-After", val); } inline void setServer(const std::string& val) { set("Server", val); } inline void setVary(const std::string& val) { set("Vary", val); } inline void setWWWAuthenticate(const std::string& val) { set("WWW-Authenticate", val); } /* all, optional */ inline void setAllow(const std::string& val) { set("Allow", val); } inline void setContentBase(const std::string& val) { set("Content-Base", val); } inline void setContentEncoding(const std::string& val) { set("Content-Encoding", val); } inline void setContentLanguage(const std::string& val) { set("Content-Language", val); } inline void setContentLegth(const std::string& val) { set("Content-Legth", val); } inline void setContentLocation(const std::string& val) { set("Content-Location", val); } inline void setContentType(const std::string& val) { set("Content-Type", val); } inline void setExpires(const std::string& val) { set("Expires", val); } inline void setLastModified(const std::string& val) { set("Last-Modified", val); } }; } // !namespace Net } // !namespace P #endif |
|
From: Christian P. <cp...@us...> - 2005-01-14 14:54:20
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20953/include/pclasses Modified Files: Makefile.am Log Message: Added PropertyMap.h Index: Makefile.am =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/Makefile.am,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- Makefile.am 11 Jan 2005 14:53:47 -0000 1.6 +++ Makefile.am 14 Jan 2005 14:54:07 -0000 1.7 @@ -7,4 +7,4 @@ Stack.h LinkedItem.h Pair.h IntTypeLimits.h Queue.h IntrusivePtr.h \ CircularQueue.h List.h NonCopyable.h Phoenix.h Factory.h \ Time.h Date.h DateTime.h TimeSpan.h Callback.h Signal.h \ - Trace.h + Trace.h PropertyMap.h |
|
From: Christian P. <cp...@us...> - 2005-01-14 14:53:10
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20723/include/pclasses Added Files: PropertyMap.h Log Message: Added simple PropertyMap. --- NEW FILE: PropertyMap.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_PropertyMap_h #define P_PropertyMap_h #include <map> #include <string> namespace P { template <typename KeyType, typename ValueType> class PropertyMap { public: typedef std::map<KeyType, ValueType> FieldMap; typedef typename FieldMap::iterator iterator; typedef typename FieldMap::const_iterator const_iterator; PropertyMap() {} ~PropertyMap() {} void set(const KeyType& key, const ValueType& val) { _fields[key] = val; } const ValueType& get(const KeyType& key) const { static KeyType empty = KeyType(); const_iterator i = _fields.find(key); if(i != _fields.end()) return i->second; return empty; } bool remove(const KeyType& key) { _fields.erase(key); } bool isset(const KeyType& key) const { return _fields.find(key) != _fields.end(); } iterator find(const KeyType& key) { return _fields.find(key); } const_iterator find(const KeyType& key) const { return _fields.find(key); } inline const_iterator begin() const { return _fields.begin(); } inline const_iterator end() const { return _fields.end(); } inline iterator begin() { return _fields.begin(); } inline iterator end() { return _fields.end(); } std::string& operator[](const KeyType& key) { return _fields[key]; } const std::string& operator[](const KeyType& key) const { return _fields[key]; } private: FieldMap _fields; }; } #endif |
|
From: Christian P. <cp...@us...> - 2005-01-14 14:49:15
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses/XML In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20034/include/pclasses/XML Modified Files: Makefile.am XMLParseError.h Log Message: Added missing #ifndef-#define to XMLParseError.h. Added XMLParseError.h to Makefile.am. Index: Makefile.am =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/XML/Makefile.am,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Makefile.am 11 Jan 2005 14:47:47 -0000 1.1 +++ Makefile.am 14 Jan 2005 14:48:55 -0000 1.2 @@ -1,3 +1,3 @@ INCLUDES = METASOURCES = AUTO -pkginclude_HEADERS = XMLPushParser.h +pkginclude_HEADERS = XMLParseError.h XMLPushParser.h Index: XMLParseError.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/XML/XMLParseError.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- XMLParseError.h 11 Jan 2005 14:47:47 -0000 1.1 +++ XMLParseError.h 14 Jan 2005 14:48:55 -0000 1.2 @@ -18,6 +18,9 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ +#ifndef P_XML_XMLParseError +#define P_XML_XMLParseError + #include <pclasses/Exception.h> #include <string> @@ -45,3 +48,5 @@ } // !namespace XML } // !namespace P + +#endif |
|
From: Christian P. <cp...@us...> - 2005-01-14 14:49:13
|
Update of /cvsroot/pclasses/pclasses2/src/XML In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20034/src/XML Modified Files: Makefile.am Log Message: Added missing #ifndef-#define to XMLParseError.h. Added XMLParseError.h to Makefile.am. Index: Makefile.am =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/XML/Makefile.am,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Makefile.am 11 Jan 2005 14:47:47 -0000 1.1 +++ Makefile.am 14 Jan 2005 14:48:56 -0000 1.2 @@ -3,7 +3,8 @@ lib_LTLIBRARIES = libpclasses_xml.la -libpclasses_xml_la_SOURCES = XMLPushParser.expat.cpp +libpclasses_xml_la_SOURCES = XMLParseError.cpp XMLPushParser.expat.cpp \ + XMLRPC_Value.cpp libpclasses_xml_la_LDFLAGS = -no-undefined |
|
From: Christian P. <cp...@us...> - 2005-01-14 14:46:14
|
Update of /cvsroot/pclasses/pclasses2/src/Unicode In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19335/src/Unicode Modified Files: Char.cpp Makefile.am unicodedata.awk Added Files: uctype.cpp unicodedata.cpp unicodedata.h ustring.cpp Log Message: Unicode re-work. Lets get compatible to std::basic_string<>. Unicode::Char, Unicode::String will be obsoleted. --- NEW FILE: unicodedata.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 "unicodedata.h" namespace P { namespace Unicode { #include "unicodedata_extra_db.h" #include "unicodedata_db.h" const codePointData* lookupCodePoint(uchar_t codePoint) { unsigned int i = 0; while(codePoints[i].codePoint != (uchar_t)-1) { if(codePoints[i].codePoint == codePoint) return &codePoints[i]; ++i; } return 0; } Category category(uchar_t ch) { const codePointData* data = lookupCodePoint(ch); return (Category)data->category; } BidiClass bidiClass(uchar_t ch) { const codePointData* data = lookupCodePoint(ch); return (BidiClass)data->bidi; } Decomposition decompTag(uchar_t ch) { const codePointData* data = lookupCodePoint(ch); return (Decomposition)data->decomp; } CombiningClass combiningClass(uchar_t ch) { const codePointData* data = lookupCodePoint(ch); return (CombiningClass)data->combining; } } // !namespace Unicode } // !namespace P Index: Char.cpp =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/Unicode/Char.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Char.cpp 23 Dec 2004 05:45:58 -0000 1.2 +++ Char.cpp 14 Jan 2005 14:46:02 -0000 1.3 @@ -19,27 +19,12 @@ */ #include "pclasses/Unicode/Char.h" - -#include "unicodedata_extra.h" // UNICODE extra character data -#include "unicodedata.h" // UNICODE character data +#include "unicodedata.h" namespace P { namespace Unicode { -const codePointData* lookupCodePoint(uint32_t codePoint) -{ - unsigned int i = 0; - while(codePoints[i].codePoint != (uint32_t)-1) - { - if(codePoints[i].codePoint == codePoint) - return &codePoints[i]; - ++i; - } - - return 0; -} - Char::Char(uint32_t ch) : _char(ch) { } Index: Makefile.am =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/Unicode/Makefile.am,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Makefile.am 11 Jan 2005 14:57:33 -0000 1.3 +++ Makefile.am 14 Jan 2005 14:46:02 -0000 1.4 @@ -1,21 +1,19 @@ -noinst_HEADERS = unicodedata.h unicodedata_extra.h +noinst_HEADERS = unicodedata.h unicodedata_db.h unicodedata_extra_db.h unicodedata-clean: - rm -f unicodedata.h - rm -f unicodedata_extra.h - -unicodedata: unicodedata-clean unicodedata.h unicodedata_extra.h + rm -f unicodedata_db.h + rm -f unicodedata_extra_db.h -unicodedata.h unicodedata_extra.h: +unicodedata: unicodedata-clean wget --passive-ftp http://www.unicode.org/Public/UNIDATA/UnicodeData.txt - awk -f $(top_srcdir)/src/Unicode/unicodedata.awk UnicodeData.txt >unicodedata.h + awk -f $(top_srcdir)/src/Unicode/unicodedata.awk UnicodeData.txt >unicodedata_db.h rm -f UnicodeData.txt INCLUDES = -I$(top_srcdir)/include -I$(top_builddir)/include -I$(top_builddir)/src/Unicode $(all_includes) METASOURCES = AUTO lib_LTLIBRARIES = libpclasses_unicode.la -libpclasses_unicode_la_SOURCES = Char.cpp String.cpp TextStream.cpp +libpclasses_unicode_la_SOURCES = unicodedata.cpp uctype.cpp ustring.cpp Char.cpp String.cpp TextStream.cpp libpclasses_unicode_la_LDFLAGS = -no-undefined --- NEW FILE: uctype.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/Unicode/uctype.h" #include "unicodedata.h" namespace P { namespace Unicode { int isualnum(uchar_t c) { int ret = 0; switch(category(c)) { case Letter_Uppercase: case Letter_Lowercase: case Letter_Titlecase: case Letter_Modifier: case Letter_Other: case Number_DecimalDigit: case Number_Letter: case Number_Other: ret = 1; default: break; } return ret; } int isualpha(uchar_t c) { int ret = 0; switch(category(c)) { case Letter_Uppercase: case Letter_Lowercase: case Letter_Titlecase: case Letter_Modifier: case Letter_Other: ret = 1; default: break; } return ret; } int isucntrl(uchar_t c) { int ret = 0; switch(category(c)) { case Mark_NonSpacing: case Mark_SpacingCombining: case Mark_Enclosing: case Other_Control: case Other_Format: case Other_Surrogate: case Other_PrivateUse: case Other_NotAssigned: ret = 1; default: break; } return ret; } int isudigit(uchar_t c) { int ret = 0; switch(category(c)) { case Number_DecimalDigit: case Number_Letter: case Number_Other: ret = 1; default: break; } return ret; } int isugraph(uchar_t c) { //@@fixme return 0; } int isulower(uchar_t c) { return category(c) == Letter_Lowercase ? 1 : 0; } int isuprint(uchar_t c) { //@@fixme return 0; } int isupunct(uchar_t c) { //@@fixme return 0; } int isuspace(uchar_t c) { int ret = 0; switch(category(c)) { case Separator_Space: case Separator_Line: case Separator_Paragraph: ret = 1; default: break; } return ret; } int isuupper(uchar_t c) { return category(c) == Letter_Uppercase ? 1 : 0; } uchar_t toulower(uchar_t c) { const codePointData* data = lookupCodePoint(c); if(data && data->extra) { const letterExtraData* extraData = (const letterExtraData*)data->extra; return extraData->lower; } return c; } uchar_t touupper(uchar_t c) { const codePointData* data = lookupCodePoint(c); if(data && data->extra) { const letterExtraData* extraData = (const letterExtraData*)data->extra; return extraData->upper; } return c; } uchar_t touchar(char c) { if(c < 0x7f) return c; return '?'; } } // !namespace Unicode } // !namespace P --- NEW FILE: unicodedata.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_Unicode_unicodedata_h #define P_Unicode_unicodedata_h #include "pclasses/BasicTypes.h" #include "pclasses/Unicode/uctype.h" namespace P { namespace Unicode { //! General category enum Category { Mark_NonSpacing, // Mn Mark_SpacingCombining, // Mc Mark_Enclosing, // Me Number_DecimalDigit, // Nd Number_Letter, // Nl Number_Other, // No Separator_Space, // Zs Separator_Line, // Zl Separator_Paragraph, // Zp Other_Control, // Cc Other_Format, // Cf Other_Surrogate, // Cs Other_PrivateUse, // Co Other_NotAssigned, // Cn Letter_Uppercase, // Lu Letter_Lowercase, // Ll Letter_Titlecase, // Lt Letter_Modifier, // Lm Letter_Other, // Lo Punctuation_Connector, // Pc Punctuation_Dash, // Pd Punctuation_Open, // Ps Punctuation_Close, // Pe Punctuation_InitialQuote, // Pi Punctuation_FinalQuote, // Pf Punctuation_Other, // Po Symbol_Math, // Sm Symbol_Currency, // Sc Symbol_Modifier, // Sk Symbol_Other // So }; //! Bidirectional Class enum BidiClass { LeftToRight, // L LeftToRightEmbedding, // LRE LeftToRightOverride, // LRO RightToLeft, // R RightToLeftArabic, // AL RightToLeftEmbedding, // RLE RightToLeftOverride, // RLO PopDirectionalFormat, // PDF EuropeanNumber, // EN EuropeanNumberSeparator, // ES EuropeanNumberTerminator, // ET ArabicNumber, // AN CommonNumberSeparator, // CS NonSpacingMark, // NSM BoundaryNeutral, // BN ParagraphSeparator, // B SegmentSeparator, // S Whitespace, // WS OtherNeutrals // ON }; //! Character Decomposition Tag enum Decomposition { NoDecomposition, Font, // <font> NoBreak, // <noBreak> Initial, // <initial> Medial, // <medial> Final, // <final> Isolated, // <isolated> Encircled, // <circle> Superscript, // <super> Subscript, // <sub> Vertical, // <vertical> Wide, // <wide> Narrow, // <narrow> Small, // <small> Square, // <square> Fraction, // <fraction> Compat // <compat> }; //! Canonical Combining Class enum CombiningClass { Combining_Spacing = 0, Combining_Overlays = 1, Combining_Nuktas = 7, Combining_VoicingMarks = 8, Combining_Viramas = 9, Combining_FixedStart = 10, Combining_FixedEnd = 199, Combining_BelowLeftAttached = 200, Combining_BelowAttached = 202, Combining_BelowRightAttached = 204, Combining_LeftAttached = 208, Combining_RightAttached = 210, Combining_AboveLeftAttached = 212, Combining_AboveAttached = 214, Combining_AboveRightAttached = 216, Combining_BelowLeft = 218, Combining_Below = 220, Combining_BelowRight = 222, Combining_Left = 224, Combining_Right = 226, Combining_AboveLeft = 228, Combining_Above = 230, Combining_AboveRight = 232, Combining_DoubleBelow = 233, Combining_DoubleAbove = 234, Combining_IotaSubscript = 240 }; struct codePointData { uchar_t codePoint; char category; char combining; char bidi; char decomp; char mirrored; void* extra; }; struct letterExtraData { uchar_t upper; uchar_t lower; uchar_t title; }; struct decimalDigitExtraData { int num; }; const codePointData* lookupCodePoint(uchar_t codePoint); Category category(uchar_t ch); BidiClass bidiClass(uchar_t ch); Decomposition decompTag(uchar_t ch); CombiningClass combiningClass(uchar_t ch); } // !namespace Unicode } // !namespace P #endif --- NEW FILE: ustring.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/Unicode/ustring.h" #include <string.h> namespace P { namespace Unicode { int umemcmp(const uchar_t* s1, const uchar_t* s2, size_t n) { while(n-- > 0) { if(*s1 != *s2) { //@@fixme return 1; } ++s1; ++s2; } return 0; } size_t ucslen(const uchar_t* s) { size_t n = 0; while(*(s++) != 0) ++n; return n; } const uchar_t* umemchr(const uchar_t* s, size_t n, uchar_t a) { while(n-- > 0) { if(*(s++) == a) return s; } return 0; } uchar_t* umemmove(uchar_t* s1, const uchar_t* s2, size_t n) { return (uchar_t*)std::memmove(s1, s2, n * sizeof(uchar_t)); } uchar_t* umemcpy(uchar_t* s1, const uchar_t* s2, size_t n) { return (uchar_t*)std::memcpy(s1, s2, n * sizeof(uchar_t)); } uchar_t* umemset(uchar_t* s, size_t n, uchar_t a) { while(n-- > 0) *(s++) = a; return s; } ustring str(const char* str) { size_t len = strlen(str); ustring ret; ret.reserve(len); size_t i = 0; while(len-- > 0) ret[i++] = touchar(*(str++)); return ret; } } // !namespace Unicode } // !namespace P Index: unicodedata.awk =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/Unicode/unicodedata.awk,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- unicodedata.awk 23 Dec 2004 04:32:18 -0000 1.2 +++ unicodedata.awk 14 Jan 2005 14:46:02 -0000 1.3 @@ -1,23 +1,5 @@ BEGIN { FS=";" - - print "/* Automatically generated by P::Classes unicodedata.awk */" > "unicodedata_extra.h" - print "namespace P { namespace Unicode {" >> "unicodedata_extra.h" - print "struct letterExtraData { uint32_t upper, lower, title; };" >> "unicodedata_extra.h" - print "struct decimalDigitExtraData { int num; };" >> "unicodedata_extra.h" - - print "/* Automatically generated by P::Classes unicodedata.awk */" - print "namespace P { namespace Unicode {" - print "struct codePointData {" - print " uint32_t codePoint;" - print " char category;" - print " char combining;" - print " char bidi;" - print " char decomp;" - print " char mirrored;" - print " void* extra;" - print "};" - print "codePointData codePoints[] = {" extranum = 0; } @@ -223,16 +205,14 @@ if(extra != "") { - print extra >> "unicodedata_extra.h" + print extra >> "unicodedata_extra_db.h" extraval = "(void*)&" extraname; } - printf " { 0x%s, Char::%s, %s, Char::%s, Char::%s, %s, %s ", codepoint, categoryEnum, combining, bidiEnum, decompEnum, mirroredVal, extraval + printf " { 0x%s, %s, %s, %s, %s, %s, %s ", codepoint, categoryEnum, combining, bidiEnum, decompEnum, mirroredVal, extraval printf "},\n" } END { print " { (uint32_t)-1, 0, }" print "};" - print "} }" - print "} }" >> "unicodedata_extra.h" } |
|
From: Christian P. <cp...@us...> - 2005-01-14 14:46:13
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses/Unicode In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19335/include/pclasses/Unicode Modified Files: Makefile.am Added Files: uctype.h ustring.h Log Message: Unicode re-work. Lets get compatible to std::basic_string<>. Unicode::Char, Unicode::String will be obsoleted. Index: Makefile.am =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/Unicode/Makefile.am,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Makefile.am 23 Dec 2004 04:32:17 -0000 1.1 +++ Makefile.am 14 Jan 2005 14:46:01 -0000 1.2 @@ -1,3 +1,3 @@ INCLUDES = METASOURCES = AUTO -pkginclude_HEADERS = Char.h String.h TextStream.h +pkginclude_HEADERS = uctype.h ustring.h Char.h String.h TextStream.h --- NEW FILE: ustring.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_Unicode_ustring_h #define P_Unicode_ustring_h #include <pclasses/Unicode/uctype.h> #include <string> namespace P { namespace Unicode { typedef off_t ustreampos; struct ustate_t { }; int umemcmp(const uchar_t* s1, const uchar_t* s2, size_t n); size_t ucslen(const uchar_t* s); const uchar_t* umemchr(const uchar_t* s, size_t n, uchar_t a); uchar_t* umemmove(uchar_t* s1, const uchar_t* s2, size_t n); uchar_t* umemcpy(uchar_t* s1, const uchar_t* s2, size_t n); uchar_t* umemset(uchar_t* s, size_t n, uchar_t a); } // !namespace Unicode } // !namespace P namespace std { template<> struct char_traits<P::Unicode::uchar_t> { typedef P::Unicode::uchar_t char_type; typedef P::uint32_t int_type; typedef streamoff off_type; typedef P::Unicode::ustreampos pos_type; typedef P::Unicode::ustate_t state_type; static void assign(char_type& c1, const char_type& c2) { c1 = c2; } static bool eq(const char_type& c1, const char_type& c2) { return c1 == c2; } static bool lt(const char_type& c1, const char_type& c2) { return P::Unicode::umemcmp(&c1, &c2, 1) < 0; } static int compare(const char_type* c1, const char_type* c2, size_t n) { return P::Unicode::umemcmp(c1, c2, n); } static size_t length(const char_type* s) { return P::Unicode::ucslen(s); } static const char_type* find(const char_type* s, size_t n, const char_type& a) { return P::Unicode::umemchr(s, a, n); } static char_type* move(char_type* s1, const char_type* s2, int_type n) { return P::Unicode::umemmove(s1, s2, n); } static char_type* copy(char_type* s1, const char_type* s2, size_t n) { return P::Unicode::umemcpy(s1, s2, n); } static char_type* assign(char_type* s, size_t n, char_type a) { return P::Unicode::umemset(s, a, n); } static char_type to_char_type(const int_type& c) { return char_type(c); } static int_type to_int_type(const char_type& c) { return int_type(c); } static bool eq_int_type(const int_type& c1, const int_type& c2) { return c1 == c2; } static int_type eof() { return static_cast<int_type>(UEOF); } static int_type not_eof(const int_type& c) { return eq_int_type(c, eof()) ? 0 : c; } }; } namespace P { namespace Unicode { typedef std::basic_string<uchar_t, std::char_traits<uchar_t>, std::allocator<uchar_t> > ustring; ustring str(const char* str); } // !namespace Unicode } // !namespace P #endif --- NEW FILE: uctype.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_Unicode_uctype_h #define P_Unicode_uctype_h #include <pclasses/BasicTypes.h> namespace P { namespace Unicode { typedef uint32_t uchar_t; int isualnum(uchar_t c); int isualpha(uchar_t c); int isucntrl(uchar_t c); int isudigit(uchar_t c); int isugraph(uchar_t c); int isulower(uchar_t c); int isuprint(uchar_t c); int isupunct(uchar_t c); int isuspace(uchar_t c); int isuupper(uchar_t c); uchar_t touchar(char c); uchar_t toulower(uchar_t c); uchar_t touupper(uchar_t c); #define UEOF ((P::Unicode::uchar_t)-1) } // !namespace Unicode } // !namespace P #endif |
|
From: stephan b. <sg...@us...> - 2005-01-12 12:05:41
|
Update of /cvsroot/pclasses/pclasses2/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5400/src Modified Files: Makefile.toc Log Message: That last commit message lied. This time i really added the XML subdir. Index: Makefile.toc =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/Makefile.toc,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- Makefile.toc 12 Jan 2005 11:58:21 -0000 1.16 +++ Makefile.toc 12 Jan 2005 12:05:23 -0000 1.17 @@ -2,7 +2,7 @@ include toc.make -SUBDIRS = Unicode IO System Util s11n Net SIO App +SUBDIRS = Unicode IO System Util s11n Net SIO App XML SOURCES = Alloc.cpp \ AtomicInt.gcc-x86.cpp \ |
|
From: stephan b. <sg...@us...> - 2005-01-12 12:00:04
|
Update of /cvsroot/pclasses/pclasses2/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4132/lib Modified Files: Makefile.toc Log Message: Added XML lib. Index: Makefile.toc =================================================================== RCS file: /cvsroot/pclasses/pclasses2/lib/Makefile.toc,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- Makefile.toc 30 Dec 2004 21:17:33 -0000 1.6 +++ Makefile.toc 12 Jan 2005 11:59:52 -0000 1.7 @@ -19,6 +19,7 @@ System/lib$(LIBPSYSTEM_BASENAME) \ Unicode/lib$(LIBPUNICODE_BASENAME) \ Util/lib$(LIBPUTIL_BASENAME) \ + XML/lib$(LIBPXML_BASENAME) \ ) pliblist := $(wildcard $(addsuffix .so*,$(pliblist))) |
|
From: stephan b. <sg...@us...> - 2005-01-12 12:00:04
|
Update of /cvsroot/pclasses/pclasses2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4132 Modified Files: configure.pclasses2 postconfig.pclasses2 toc.pclasses2.make.at Log Message: Added XML lib. Index: toc.pclasses2.make.at =================================================================== RCS file: /cvsroot/pclasses/pclasses2/toc.pclasses2.make.at,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- toc.pclasses2.make.at 30 Dec 2004 20:14:10 -0000 1.11 +++ toc.pclasses2.make.at 12 Jan 2005 11:59:53 -0000 1.12 @@ -46,6 +46,7 @@ -l$(LIBPS11N_BASENAME): ; @true -l$(LIBPSIO_BASENAME): ; @true -l$(LIBPAPP_BASENAME): ; @true +-l$(LIBPXML_BASENAME): ; @true Index: configure.pclasses2 =================================================================== RCS file: /cvsroot/pclasses/pclasses2/configure.pclasses2,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- configure.pclasses2 3 Jan 2005 18:27:55 -0000 1.24 +++ configure.pclasses2 12 Jan 2005 11:59:53 -0000 1.25 @@ -13,7 +13,7 @@ toc_export PACKAGE_DESCRIPTION="C++ generic application framework library" -# toc_source_test user_is_stephan_beal +toc_source_test user_is_stephan_beal # ^^^ i always compile with -Werror and -Wall. Must come before gnu_cpp_tools test. ####### compilers: @@ -231,6 +231,11 @@ toc_export LIBPAPP_CLIENT_LDADD="-l${LIBPAPP_BASENAME}" toc_export LIBPAPP_CFLAGS="" +toc_export LIBPXML_BASENAME=pclasses_xml +toc_export LIBPXML_LDADD="${LIBEXPAT_CLIENT_LDADD}" +toc_export LIBPXML_CLIENT_LDADD="-l${LIBPXML_BASENAME}" +toc_export LIBPXML_CFLAGS="" + ######################################################################## # Enable mysql driver... Index: postconfig.pclasses2 =================================================================== RCS file: /cvsroot/pclasses/pclasses2/postconfig.pclasses2,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- postconfig.pclasses2 30 Dec 2004 19:47:47 -0000 1.2 +++ postconfig.pclasses2 12 Jan 2005 11:59:53 -0000 1.3 @@ -10,13 +10,13 @@ EOF -for i in CORE IO UNICODE SYSTEM UTIL S11N SIO APP; do - base="LIBP${i}_BASENAME" +for i in CORE IO UNICODE SYSTEM UTIL S11N SIO APP XML; do + base=LIBP${i}_BASENAME ldl="LIBP${i}_LDADD" ldc="LIBP${i}_CLIENT_LDADD" - echo "$(eval echo \$$base):" - echo -e "\t$ldl=$(eval echo \$${ldl})" - echo -e "\t$ldc=$(eval echo \$${ldc})" + echo ${!base}: + echo -e "\t$ldl=${!ldl}" + echo -e "\t$ldc=${!ldc}" done echo |
|
From: stephan b. <sg...@us...> - 2005-01-12 11:58:33
|
Update of /cvsroot/pclasses/pclasses2/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3917/src Modified Files: Makefile.toc Log Message: Added XML subdir. Index: Makefile.toc =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/Makefile.toc,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- Makefile.toc 30 Dec 2004 23:10:53 -0000 1.15 +++ Makefile.toc 12 Jan 2005 11:58:21 -0000 1.16 @@ -12,7 +12,8 @@ Exception.cpp \ LinkedItem.cpp \ Time.cpp \ - TimeSpan.cpp + TimeSpan.cpp \ + Trace.cpp DIST_FILES += $(SOURCES) OBJECTS = $(patsubst %.cpp,%.o,$(SOURCES)) |
|
From: stephan b. <sg...@us...> - 2005-01-12 11:58:01
|
Update of /cvsroot/pclasses/pclasses2/src/XML In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3822/src/XML Added Files: Makefile.toc Log Message: egg --- NEW FILE: Makefile.toc --- #!/usr/bin/make include toc.make SOURCES = $(wildcard *.cpp) OBJECTS = XMLParseError.o ifeq (1,$(PCLASSES_HAVE_lIBEXPAT)) OBJECTS += XMLPushParser.expat.cpp endif LIBNAME = lib$(LIBPXML_BASENAME) SHARED_LIBS = $(LIBNAME) $(LIBNAME)_so_LDADD = $(LIBPXML_LDADD) # -no-undefined $(LIBNAME)_so_VERSION = $(PACKAGE_VERSION) $(LIBNAME)_so_OBJECTS = $(OBJECTS) include $(TOC_MAKESDIR)/SHARED_LIBS.make all: SHARED_LIBS |
|
From: stephan b. <sg...@us...> - 2005-01-12 11:57:26
|
Update of /cvsroot/pclasses/pclasses2/src/XML In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3737/src/XML Modified Files: XMLParseError.cpp Log Message: Fixed a broken #include. Index: XMLParseError.cpp =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/XML/XMLParseError.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- XMLParseError.cpp 11 Jan 2005 14:47:47 -0000 1.1 +++ XMLParseError.cpp 12 Jan 2005 11:57:14 -0000 1.2 @@ -18,7 +18,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include "pclasses/XMLParseError.h" +#include "pclasses/XML/XMLParseError.h" namespace P { |
|
From: stephan b. <sg...@us...> - 2005-01-12 11:50:32
|
Update of /cvsroot/pclasses/pclasses2/src/Util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2598/src/Util Modified Files: SimpleArgvParser.cpp Log Message: Fixed a missing return caught by -Werror. Index: SimpleArgvParser.cpp =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/Util/SimpleArgvParser.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- SimpleArgvParser.cpp 31 Dec 2004 02:45:09 -0000 1.3 +++ SimpleArgvParser.cpp 12 Jan 2005 11:50:23 -0000 1.4 @@ -23,12 +23,14 @@ container of strings. */ template <typename ListT> - size_t toList( ListT & tgt, int argc, char ** argv ) + int toList( ListT & tgt, int argc, char ** argv ) { - for( int i = 0; i < argc; i++) + int i = 0; + for( ; i < argc; i++) { tgt.push_back( argv[i] ); } + return i; } std::string internal_strip_leading_dashes( const std::string & s ) |
|
From: Christian P. <cp...@us...> - 2005-01-11 14:58:44
|
Update of /cvsroot/pclasses/pclasses2/src/App In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12139/src/App Modified Files: LogManager.cpp Log Message: Lookup LogTargets via PluginManager instead of NamedTypeFactory. Index: LogManager.cpp =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/App/LogManager.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- LogManager.cpp 10 Jan 2005 02:38:56 -0000 1.1 +++ LogManager.cpp 11 Jan 2005 14:58:30 -0000 1.2 @@ -19,6 +19,7 @@ ***************************************************************************/ #include "pclasses/Phoenix.h" +#include "pclasses/Plugin/Plugin.h" #include "pclasses/App/LogTarget.h" #include "pclasses/App/LogChannel.h" #include "pclasses/App/LogManager.h" @@ -111,7 +112,9 @@ LogTarget* LogManager::addTarget(LogChannel* channel, const std::string& name, const std::string& type) { - LogTarget* target = LogTargetFactory::instance().create(type); + typedef Plugin::PluginManager<LogTarget> PM; + + LogTarget* target = PM::instance().create(type); if(target) { if(!channel->addTarget(name, target)) |
|
From: Christian P. <cp...@us...> - 2005-01-11 14:56:39
|
Update of /cvsroot/pclasses/pclasses2/src/System In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11655/src/System Modified Files: Makefile.am Log Message: Added PathFinder.cpp Index: Makefile.am =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/System/Makefile.am,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- Makefile.am 31 Dec 2004 03:24:26 -0000 1.6 +++ Makefile.am 11 Jan 2005 14:56:28 -0000 1.7 @@ -1,7 +1,3 @@ -EXTRA_DIST = CriticalSection.generic.cpp CriticalSection.win32.cpp \ - Mutex.solaris.cpp Mutex.posix.cpp Mutex.win32.cpp SharedMemory.sysv.cpp \ - SharedMemory.posix.cpp SharedMemory.win32.cpp - if WITH_POSIX_THREADS Thread_Sources = CriticalSection.generic.cpp Mutex.posix.cpp \ Condition.posix.cpp Thread.posix.cpp @@ -73,6 +69,10 @@ Time_Sources = SystemClock.win32.cpp endif +EXTRA_DIST = CriticalSection.generic.cpp CriticalSection.win32.cpp \ + Mutex.solaris.cpp Mutex.posix.cpp Mutex.win32.cpp SharedMemory.sysv.cpp \ + SharedMemory.posix.cpp SharedMemory.win32.cpp + INCLUDES = -I$(top_srcdir)/include -I$(top_builddir)/include $(all_includes) METASOURCES = AUTO @@ -82,9 +82,10 @@ CriticalSection.cpp Mutex.cpp $(Thread_Sources) \ $(Semaphore_Sources) $(SharedMem_Sources) $(SharedLib_Sources) \ SharedLib.common.cpp FileInfo.common.cpp ProcessIO.cpp Process.common.cpp \ - $(IO_Sources) $(Time_Sources) + $(IO_Sources) $(Time_Sources) PathFinder.cpp libpclasses_system_la_LDFLAGS = -no-undefined + libpclasses_system_la_LIBADD = $(top_builddir)/src/libpclasses.la \ $(top_builddir)/src/Unicode/libpclasses_unicode.la \ $(top_builddir)/src/IO/libpclasses_io.la \ |
|
From: Christian P. <cp...@us...> - 2005-01-11 14:51:05
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9919/include/pclasses Modified Files: Callback.h Signal.h Log Message: Added Signal2, Callback2. Index: Callback.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/Callback.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Callback.h 6 Jan 2005 16:59:23 -0000 1.2 +++ Callback.h 11 Jan 2005 14:50:52 -0000 1.3 @@ -263,6 +263,127 @@ +/* ----------------- Callback2 ------------------ */ + +//! Callback base class with two arguments +template <typename RetType, typename ArgType1, typename ArgType2> +class Callback2 { + public: + virtual ~Callback2() { } + virtual RetType exec(ArgType1, ArgType2) const = 0; + + protected: + Callback2() { } +}; + +//! Callback base class with two arguments (void specialisation) +template <typename ArgType1, typename ArgType2> +class Callback2<void, ArgType1, ArgType2> { + public: + virtual ~Callback2() { } + virtual void exec(ArgType1, ArgType2) const = 0; + + protected: + Callback2() { } + +}; + +/* -------------- Function2 ------------- */ + +//! Function callback class with two arguments +template <typename RetType, typename ArgType1, typename ArgType2> +class Function2: public Callback2<RetType, ArgType1, ArgType2> { + public: + typedef RetType (*FuncPtr)(ArgType1, ArgType2); + + Function2(FuncPtr ptr) + : _funcPtr(ptr) { } + + RetType exec(ArgType1 arg1, ArgType2 arg2) const + { return (*_funcPtr)(arg1, arg2); } + + bool operator==(const Function2& f) const + { return _funcPtr == f._funcPtr; } + + private: + FuncPtr _funcPtr; +}; + +//! Function callback class with two arguments (void specialisation) +template <typename ArgType1, typename ArgType2> +class Function2<void, ArgType1, ArgType2>: public Callback2<void, ArgType1, ArgType2> { + public: + typedef void (*FuncPtr)(ArgType1, ArgType2); + + Function2(FuncPtr ptr) + : _funcPtr(ptr) { } + + void exec(ArgType1 arg1, ArgType2 arg2) const + { (*_funcPtr)(arg1, arg2); } + + bool operator==(const Function2& f) const + { return _funcPtr == f._funcPtr; } + + private: + FuncPtr _funcPtr; +}; + +//! Returns a function-callback object +template <typename RetType, typename ArgType1, typename ArgType2> +Function2<RetType, ArgType1, ArgType2> function(RetType (*ptr)(ArgType1,ArgType2)) +{ return Function2<RetType, ArgType1, ArgType2>(ptr); } + +/* ---------- Method2 ------------ */ + +//! Method callback class with two arguments +template <typename RetType, class ObjT, typename ArgType1, typename ArgType2> +class Method2: public Callback2<RetType, ArgType1, ArgType2> { + public: + typedef RetType (ObjT::*FuncPtr)(ArgType1, ArgType2); + + Method2(ObjT* obj, FuncPtr ptr) + : _obj(obj), _funcPtr(ptr) { } + + RetType exec(ArgType1 arg1, ArgType2 arg2) const + { return (_obj->*_funcPtr)(arg1, arg2); } + + bool operator==(const Method2& f) const + { return _obj == f._obj && _funcPtr == f._funcPtr; } + + private: + ObjT* _obj; + FuncPtr _funcPtr; +}; + +//! Method callback class with two arguments (void specialisation) +template <class ObjT, typename ArgType1, typename ArgType2> +class Method2<void, ObjT, ArgType1, ArgType2>: + public Callback2<void, ArgType1, ArgType2> +{ + public: + typedef void (ObjT::*FuncPtr)(ArgType1, ArgType2); + + Method2(ObjT* obj, FuncPtr ptr) + : _obj(obj), _funcPtr(ptr) { } + + void exec(ArgType1 arg1, ArgType2 arg2) const + { (_obj->*_funcPtr)(arg1, arg2); } + + bool operator==(const Method2& f) const + { return _obj == f._obj && _funcPtr == f._funcPtr; } + + private: + ObjT* _obj; + FuncPtr _funcPtr; +}; + +//! Returns a method-callback object +template <typename RetType, class ObjT, typename ArgType1, typename ArgType2> +Method2<RetType, ObjT, ArgType1, ArgType2> +method(ObjT* obj, RetType (ObjT::*ptr)(ArgType1, ArgType2)) +{ return Method2<RetType, ObjT, ArgType1, ArgType2>(obj, ptr); } + + } // !namespace P #endif Index: Signal.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/Signal.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Signal.h 6 Jan 2005 16:59:24 -0000 1.2 +++ Signal.h 11 Jan 2005 14:50:52 -0000 1.3 @@ -152,7 +152,7 @@ void unbind(CallbackType slot) { unbind_slot(_slots, slot); } - virtual RetType fire() const = 0; + virtual RetType fire(ArgType1) const = 0; protected: CallbackList _slots; @@ -194,6 +194,72 @@ }; +/* -------------------- Signal2 ---------------- */ + +//! Base class for Signal2 +template <typename RetType, typename ArgType1, typename ArgType2> +class SignalBase2 { + public: + typedef std::list< + Callback2<RetType, ArgType1, ArgType2>* + > CallbackList; + + SignalBase2() + { } + + virtual ~SignalBase2() + { unbind_slots(_slots); } + + template <class CallbackType> + void bind(CallbackType slot) + { bind_slot(_slots, slot); } + + template <class CallbackType> + void unbind(CallbackType slot) + { unbind_slot(_slots, slot); } + + virtual RetType fire(ArgType1, ArgType2) const = 0; + + protected: + CallbackList _slots; +}; + +//! Signal with two arguments +template <typename RetType, typename ArgType1, typename ArgType2> +class Signal2: public SignalBase2<RetType, ArgType1, ArgType2> { + public: + RetType fire(ArgType1 arg1, ArgType2 arg2) const + { + RetType ret = RetType(); + typename CallbackList::const_iterator i = _slots.begin(); + while(i != _slots.end()) + { + ret = (*i)->exec(arg1, arg2); + if(ret) + break; + ++i; + } + + return ret; + } +}; + +//! Signal with two arguments (void specialisation) +template <typename ArgType1, typename ArgType2> +class Signal2<void, ArgType1, ArgType2>: public SignalBase2<void, ArgType1, ArgType2> { + public: + void fire(ArgType1 arg1, ArgType2 arg2) const + { + typename CallbackList::const_iterator i = _slots.begin(); + while(i != _slots.end()) + { + (*i)->exec(arg1, arg2); + ++i; + } + } +}; + + } // !namespace P #endif |
|
From: Christian P. <cp...@us...> - 2005-01-11 14:47:59
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses/XML In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9267/include/pclasses/XML Added Files: Makefile.am XMLParseError.h XMLPushParser.h Log Message: Added XMLParseError, XMLPushParser. --- NEW FILE: XMLParseError.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. * ***************************************************************************/ #include <pclasses/Exception.h> #include <string> namespace P { namespace XML { //! XML parse error class XMLParseError: public RuntimeError { public: XMLParseError(int err, const std::string& text, const char* what, const SourceInfo& si); ~XMLParseError(); int errNo() const throw(); const std::string& text() const throw(); private: int _errNo; std::string _text; }; } // !namespace XML } // !namespace P --- NEW FILE: Makefile.am --- INCLUDES = METASOURCES = AUTO pkginclude_HEADERS = XMLPushParser.h --- NEW FILE: XMLPushParser.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_XML_XMLPushParser_h #define P_XML_XMLPushParser_h #include <pclasses/XML/XMLParseError.h> #include <pclasses/NonCopyable.h> #include <pclasses/Signal.h> #include <string> #include <map> namespace P { namespace XML { //! XML push parser class XMLPushParser: public NonCopyable { public: typedef std::map<std::string,std::string> AttributeMap; enum { XMLNS = 0x01 }; XMLPushParser(const std::string& encoding = std::string(), int flags = 0); XMLPushParser(const std::string& encoding, int flags, char separator); //! External entity sub-parser XMLPushParser(XMLPushParser& p, const std::string& encoding, const std::string& context); virtual ~XMLPushParser() throw(); enum EntityParsingMode { Never, UnlessStandalone, Always }; void setParamEntityParsing(EntityParsingMode m); void parse(const char* buffer, size_t count) throw(XMLParseError); void finish() throw(); void reset() throw(); Signal2<void, const std::string&, const std::string&> sig_namespaceDeclStart; Signal1<void, const std::string&> sig_namespaceDeclEnd; Signal1<void, const std::string&> sig_comment; Signal2<void, const std::string&, const AttributeMap&> sig_elementStart; Signal1<void, const std::string&> sig_elementEnd; Signal1<void, const std::string&> sig_characterData; Signal0<void> sig_cDataStart; Signal0<void> sig_cDataEnd; protected: virtual void namespaceDeclStart(const std::string& prefix, const std::string& uri); virtual void namespaceDeclEnd(const std::string& prefix); virtual void comment(const std::string& comment); virtual void elementStart(const std::string& el, const AttributeMap& attrs); virtual void elementEnd(const std::string& el); virtual void characterData(const std::string& data); virtual void cDataStart(); virtual void cDataEnd(); virtual void notationDecl(const std::string& notationName, const std::string& base, const std::string& systemId, const std::string& publicId); virtual bool externalEntityRef(const std::string& context, const std::string& base, const std::string& systemId, const std::string& publicId); private: struct ParserImpl; friend struct ParserImpl; ParserImpl* _impl; }; } // !namespace XML } // !namespace P #endif |
|
From: Christian P. <cp...@us...> - 2005-01-11 14:47:59
|
Update of /cvsroot/pclasses/pclasses2/src/XML In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9267/src/XML Added Files: Makefile.am XMLParseError.cpp XMLPushParser.expat.cpp Log Message: Added XMLParseError, XMLPushParser. --- NEW FILE: XMLPushParser.expat.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/XML/XMLPushParser.h" #include <expat.h> namespace P { namespace XML { struct XMLPushParser::ParserImpl { XML_Parser parser; std::string encoding; ParserImpl(XMLPushParser* p, const std::string& enc, int flags, char sep) { if(flags & XMLPushParser::XMLNS) parser = XML_ParserCreateNS(enc.empty() ? 0 : enc.c_str(), sep); else parser = XML_ParserCreate(enc.empty() ? 0 : enc.c_str()); XML_SetUserData(parser, p); XML_SetNamespaceDeclHandler(parser, namespaceDeclStart, namespaceDeclEnd); XML_SetElementHandler(parser, elementStart, elementEnd); XML_SetCommentHandler(parser, comment); XML_SetCharacterDataHandler(parser, characterData); XML_SetCdataSectionHandler(parser, cDataStart, cDataEnd); XML_SetExternalEntityRefHandler(parser, externalEntityRef); XML_SetNotationDeclHandler(parser, notationDecl); encoding = enc; } ParserImpl(ParserImpl* impl, const std::string& enc, const std::string& context) { parser = XML_ExternalEntityParserCreate(impl->parser, enc.empty() ? 0 : enc.c_str(), context.c_str()); encoding = impl->encoding; } ~ParserImpl() { XML_ParserFree(parser); } static void namespaceDeclStart(void* userData, const char* prefix, const char* uri) { XMLPushParser* p = static_cast<XMLPushParser*>(userData); std::string prefixTmp(prefix); std::string uriTmp(uri); p->namespaceDeclStart(prefix, uri); p->sig_namespaceDeclStart.fire(prefix, uri); } static void namespaceDeclEnd(void* userData, const char* prefix) { XMLPushParser* p = static_cast<XMLPushParser*>(userData); std::string prefixTmp(prefix); p->namespaceDeclEnd(prefix); p->sig_namespaceDeclEnd.fire(prefix); } static void elementStart(void* userData, const char* elem, const char** attrs) { XMLPushParser* p = static_cast<XMLPushParser*>(userData); std::string elemTmp(elem); XMLPushParser::AttributeMap attrMap; for(int i = 0; attrs[i]; i+=2) attrMap[attrs[i]] = attrs[i+1]; p->elementStart(elemTmp, attrMap); p->sig_elementStart.fire(elemTmp, attrMap); } static void elementEnd(void* userData, const char* elem) { XMLPushParser* p = static_cast<XMLPushParser*>(userData); std::string tmp(elem); p->elementEnd(tmp); p->sig_elementEnd.fire(tmp); } static void comment(void* userData, const char* comment) { XMLPushParser* p = static_cast<XMLPushParser*>(userData); std::string tmp(comment); p->comment(tmp); p->sig_comment.fire(tmp); } static void characterData(void* userData, const char* cdata, int len) { XMLPushParser* p = static_cast<XMLPushParser*>(userData); std::string tmp(cdata, len); p->characterData(tmp); p->sig_characterData.fire(tmp); } static void cDataStart(void* userData) { XMLPushParser* p = static_cast<XMLPushParser*>(userData); p->cDataStart(); p->sig_cDataStart.fire(); } static void cDataEnd(void* userData) { XMLPushParser* p = static_cast<XMLPushParser*>(userData); p->cDataEnd(); p->sig_cDataEnd.fire(); } static int externalEntityRef(XML_Parser p, const char* context, const char* base, const char* systemId, const char* publicId) { XMLPushParser* parser = static_cast<XMLPushParser*>(XML_GetUserData(p)); std::string tmpContext(context); std::string tmpBase(base); std::string tmpSystemId(systemId); std::string tmpPublicId(publicId); return parser->externalEntityRef(tmpContext, tmpBase, tmpSystemId, tmpPublicId) ? 1 : 0; } static void notationDecl(void* userData, const char* notationName, const char* base, const char* systemId, const char* publicId) { XMLPushParser* p = static_cast<XMLPushParser*>(userData); std::string tmpNotName(notationName); std::string tmpBase(base); std::string tmpSystemId(systemId); std::string tmpPublicId(publicId); p->notationDecl(tmpNotName, tmpBase, tmpSystemId, tmpPublicId); } }; XMLPushParser::XMLPushParser(const std::string& encoding, int flags) : _impl(new XMLPushParser::ParserImpl(this, encoding, flags, ';')) { } XMLPushParser::XMLPushParser(const std::string& encoding, int flags, char separator) : _impl(new XMLPushParser::ParserImpl(this, encoding, flags, separator)) { } XMLPushParser::XMLPushParser(XMLPushParser& p, const std::string& encoding, const std::string& context) : _impl(new XMLPushParser::ParserImpl(p._impl, encoding, context)) { } XMLPushParser::~XMLPushParser() throw() { delete _impl; } void XMLPushParser::setParamEntityParsing(EntityParsingMode m) { XML_ParamEntityParsing c; switch(m) { case Never: c = XML_PARAM_ENTITY_PARSING_NEVER; break; case UnlessStandalone: c = XML_PARAM_ENTITY_PARSING_UNLESS_STANDALONE; break; case Always: c = XML_PARAM_ENTITY_PARSING_ALWAYS; break; } XML_SetParamEntityParsing(_impl->parser, c); } void XMLPushParser::parse(const char* buffer, size_t count) throw(XMLParseError) { if(XML_Parse(_impl->parser, buffer, count, false) == 0) { XML_Error err = XML_GetErrorCode(_impl->parser); throw XMLParseError(err, XML_ErrorString(err), "Error parsing XML data", P_SOURCEINFO); } } void XMLPushParser::finish() throw() { XML_Parse(_impl->parser, 0, 0, true); } void XMLPushParser::reset() throw() { XML_ParserReset(_impl->parser, _impl->encoding.empty() ? 0 : _impl->encoding.c_str()); } void XMLPushParser::namespaceDeclStart(const std::string& prefix, const std::string& uri) { } void XMLPushParser::namespaceDeclEnd(const std::string& prefix) { } void XMLPushParser::comment(const std::string& comment) { } void XMLPushParser::elementStart(const std::string& el, const AttributeMap& attrs) { } void XMLPushParser::elementEnd(const std::string& el) { } void XMLPushParser::characterData(const std::string& data) { } void XMLPushParser::cDataStart() { } void XMLPushParser::cDataEnd() { } void XMLPushParser::notationDecl(const std::string& notationName, const std::string& base, const std::string& systemId, const std::string& publicId) { } bool XMLPushParser::externalEntityRef(const std::string& context, const std::string& base, const std::string& systemId, const std::string& publicId) { return false; } } // !namespace XML } // !namespace P --- NEW FILE: XMLParseError.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/XMLParseError.h" namespace P { namespace XML { XMLParseError::XMLParseError(int err, const std::string& text, const char* what, const SourceInfo& si) : RuntimeError(what, si), _errNo(err), _text(text) { } XMLParseError::~XMLParseError() { } int XMLParseError::errNo() const throw() { return _errNo; } const std::string& XMLParseError::text() const throw() { return _text; } } // !namespace XML } // !namespace P --- NEW FILE: Makefile.am --- INCLUDES = -I$(top_srcdir)/include -I$(top_builddir)/include $(all_includes) METASOURCES = AUTO lib_LTLIBRARIES = libpclasses_xml.la libpclasses_xml_la_SOURCES = XMLPushParser.expat.cpp libpclasses_xml_la_LDFLAGS = -no-undefined libpclasses_xml_la_LIBADD = $(top_builddir)/src/libpclasses.la \ $(top_builddir)/src/System/libpclasses_system.la -lexpat |
|
From: Christian P. <cp...@us...> - 2005-01-11 14:46:39
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses/XML In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8989/include/pclasses/XML Log Message: Directory /cvsroot/pclasses/pclasses2/include/pclasses/XML added to the repository |
|
From: Christian P. <cp...@us...> - 2005-01-11 14:46:37
|
Update of /cvsroot/pclasses/pclasses2/src/XML In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8989/src/XML Log Message: Directory /cvsroot/pclasses/pclasses2/src/XML added to the repository |
|
From: Christian P. <cp...@us...> - 2005-01-10 15:15:17
|
Update of /cvsroot/pclasses/pclasses2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8572 Modified Files: Makefile.am configure.in Log Message: Added plugins subdir. Added plugin Makefiles. Index: Makefile.am =================================================================== RCS file: /cvsroot/pclasses/pclasses2/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:31 -0000 1.1.1.1 +++ Makefile.am 10 Jan 2005 15:14:49 -0000 1.2 @@ -2,4 +2,4 @@ # have all needed files, that a GNU package needs AUTOMAKE_OPTIONS = foreign 1.4 -SUBDIRS = src include test m4 +SUBDIRS = m4 include src plugins test Index: configure.in =================================================================== RCS file: /cvsroot/pclasses/pclasses2/configure.in,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- configure.in 10 Jan 2005 02:54:48 -0000 1.3 +++ configure.in 10 Jan 2005 15:14:49 -0000 1.4 @@ -199,6 +199,7 @@ AC_SUBST(CXXFLAGS) AC_OUTPUT(Makefile \ + m4/Makefile \ include/Makefile \ include/pclasses/Makefile \ include/pclasses/Unicode/Makefile \ @@ -214,8 +215,10 @@ src/Net/Makefile \ src/Util/Makefile \ src/App/Makefile \ - test/Makefile \ - m4/Makefile) + plugins/Makefile \ + plugins/LogTarget/Makefile \ + plugins/LogTarget/Console/Makefile \ + test/Makefile) AC_PREFIX_CONFIG_H("PCLASSES", include/pclasses/config.h, include/pclasses/pclasses-config.h) |
|
From: Christian P. <cp...@us...> - 2005-01-10 13:05:18
|
Update of /cvsroot/pclasses/pclasses2/plugins In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15363/plugins Added Files: Makefile.am Log Message: Added plugins subdirs. Added ConsoleLogTarget plugin. --- NEW FILE: Makefile.am --- SUBDIRS = LogTarget |
|
From: Christian P. <cp...@us...> - 2005-01-10 13:05:12
|
Update of /cvsroot/pclasses/pclasses2/plugins/LogTarget/Console In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15363/plugins/LogTarget/Console Added Files: Makefile.am ConsoleLogTarget.cpp Log Message: Added plugins subdirs. Added ConsoleLogTarget plugin. --- NEW FILE: Makefile.am --- INCLUDES = -I$(top_srcdir)/include -I$(top_builddir)/include $(all_includes) METASOURCES = AUTO lib_LTLIBRARIES = libplog_console.la libplog_console_la_SOURCES = ConsoleLogTarget.cpp libplog_console_la_LIBADD = $(top_builddir)/src/libpclasses.la \ $(top_builddir)/src/App/libpclasses_app.la --- NEW FILE: ConsoleLogTarget.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/Plugin/Plugin.h" #include "pclasses/App/LogTarget.h" #include <iostream> using namespace P; using namespace P::IO; using namespace P::App; using namespace std; class ConsoleLogTarget: public LogTarget { public: ConsoleLogTarget() { } ~ConsoleLogTarget() throw() { } void open(const URL& url) throw(IOError) { _out = &cout; } void close() throw(IOError) { _out = 0; } void reload() throw(IOError) { } void output(const LogMessage& msg) throw(IOError) { if(msg.level() >= logLevel()) (*_out) << msg.when() << ' ' << msg.level2Str(msg.level()) << ' ' << msg.msg().utf8() << endl; } bool valid() const throw() { return _out ? true : false; } private: ostream* _out; }; PLUGIN_REGISTER_TYPE(LogTarget, ConsoleLogTarget); PLUGIN_REGISTER_ALIAS(LogTarget, Console, ConsoleLogTarget); |