diff --git a/makefile.am b/makefile.am index 841ec5a..8e9af59 100644 --- a/makefile.am +++ b/makefile.am @@ -8,79 +8,6 @@ ## @copy © Marc Wäckerlin ## @license LGPL, see file COPYING ## -## $Log$ -## Revision 1.24 2005/04/10 15:00:13 marc -## improved targets for makefile -## -## Revision 1.23 2005/04/07 21:01:46 marc -## reordering of dependencies (i.e. make release) -## documentation is now generated in root dir, no more in mrw subdir -## -## Revision 1.22 2005/03/11 23:28:30 marc -## - new multithreaded package -## - new log4cxx package -## -## Revision 1.21 2005/02/28 08:11:46 marc -## stack trace and dynamic library are conditional -## -## Revision 1.20 2005/02/28 07:54:57 marc -## added functiontrace -## -## Revision 1.19 2005/02/21 16:33:41 marc -## source rpm: no "-devel"! -## -## Revision 1.18 2005/02/18 16:19:13 marc -## Also build source RPM -## No more install RPMs after build -## Added dynamiclibrary.hpp -## -## Revision 1.17 2005/02/08 12:34:14 marc -## added errno / unix_error -## -## Revision 1.16 2005/01/07 00:37:10 marc -## config file handler and file -## -## Revision 1.15 2004/12/17 16:30:06 marc -## added tokenizer -## -## Revision 1.14 2004/12/14 20:22:42 marc -## added regexp -## -## Revision 1.13 2004/10/11 18:33:53 marc -## add stdext.hpp -## -## Revision 1.12 2004/10/07 17:25:40 marc -## make rpm also installs the new rpm (to check whether this is possible) -## -## Revision 1.11 2004/10/07 16:12:52 marc -## a backslash too much -## -## Revision 1.10 2004/10/07 16:01:03 marc -## new headers missing in installation -## -## Revision 1.9 2004/10/07 13:41:16 marc -## devel in the same spec file -## -## Revision 1.8 2004/09/09 20:09:06 marc -## library versioning now works how i want it -## -## Revision 1.7 2004/08/31 16:22:29 marc -## webserver now depends on tag and rpm -## added .PHONY -## -## Revision 1.6 2004/08/28 16:21:07 marc -## mrw-c++-0.92 (mrw) -## - new file: version.cpp -## - new file header for all sources -## - work around warning in mrw::auto -## - possibility to compile without log4cxx -## - work around bugs in demangle.h and libiberty.h -## - corrections in documentation -## - added simple tracing mechanism -## - more warnings -## - small corrections in Auto<>::Free and a new test for it -## - possibility to compile without stack trace -## SUBDIRS = mrw diff --git a/mrw/arg.hpp b/mrw/arg.hpp index ae2c0b8..91223d2 100644 --- a/mrw/arg.hpp +++ b/mrw/arg.hpp @@ -9,6 +9,9 @@ @license LGPL, see file COPYING $Log$ + Revision 1.7 2005/11/29 12:39:42 marc + make it compilable with gcc 4.0.2 and newer doxygen + Revision 1.6 2005/02/08 12:31:36 marc new static methods to simplify access to options @@ -130,7 +133,7 @@ namespace mrw { /** @brief List of additional (mandatory) parameter to one command line argument. - @pre #include + @pre \#include A new mandatory parameter is added to the list of parameter, by shifting the default value into the instance of @c @@ -207,7 +210,7 @@ namespace mrw { public: /** @brief Abstract base class to represent one single parameter value. - @pre #include + @pre \#include */ class Value { @@ -372,7 +375,7 @@ namespace mrw { }; /** @brief this class represents one command line option - @pre #include + @pre \#include The library user needs this class when setting up the list of supported command line ooptions: Simply shift one instance of @c @@ -469,7 +472,7 @@ namespace mrw { }; /** @brief handle command line arguments - @pre #include + @pre \#include This class handles command line arguments. It is a singleton. Get the one and only instance of this class with @c diff --git a/mrw/auto.hpp b/mrw/auto.hpp index 6bb89b2..eff4660 100644 --- a/mrw/auto.hpp +++ b/mrw/auto.hpp @@ -8,32 +8,6 @@ @copy © Marc Wäckerlin @license LGPL, see file COPYING - $Log$ - Revision 1.7 2004/12/20 07:40:35 marc - documentation improved, new grouping - - Revision 1.6 2004/10/11 16:48:29 marc - better comment and operators -> and * for AutoPtr - - Revision 1.5 2004/10/11 16:05:02 marc - new AutoPtr - - Revision 1.4 2004/10/07 09:24:08 marc - enhance windoze compatibility - - Revision 1.3 2004/08/28 16:21:25 marc - mrw-c++-0.92 (mrw) - - new file: version.cpp - - new file header for all sources - - work around warning in mrw::auto - - possibility to compile without log4cxx - - work around bugs in demangle.h and libiberty.h - - corrections in documentation - - added simple tracing mechanism - - more warnings - - small corrections in Auto<>::Free and a new test for it - - possibility to compile without stack trace - */ #ifndef __MRW_AUTO_HPP__ #define __MRW_AUTO_HPP__ @@ -89,7 +63,7 @@ namespace mrw { //@{ /** @brief Automatically frees a resource when destructed. - @pre #include + @pre \#include AutoResource works exactly like std::auto_ptr, but for any resource instead of new allocated pointers. Whenever the context @@ -135,6 +109,17 @@ namespace mrw { AutoResource(AutoResource& o) throw(std::bad_exception): _res(o.release()) { } + //! @brief Do not use this method! + //! This method had to be introduced for the @c std::map, where + //! @c operator[] first creates an empty element, then assigns it + //! the real value. Because that empty element is temporary, gcc can + //! not use @c AutoResource(AutoResource&) since release 4.0. + AutoResource(const AutoResource& o) throw(std::bad_exception): + _res(INITIAL_VALUE) { + assert(o._res==INITIAL_VALUE); + if (o._res!=INITIAL_VALUE) + _res = const_cast(o).release(); + } /// @brief Free resource. Calls @c reset(). ~AutoResource() throw(std::bad_exception) {reset();} /// @brief Assign new resource. Calls @c reset(). @@ -183,7 +168,7 @@ namespace mrw { }; /** @brief Automatically deletes a pointer when destructed. - @pre #include + @pre \#include mrw::AutoPtr is a replacement for std::auto_ptr. The problem with standard std::auto_ptr is, that it cannot be stored in a std::map. @@ -208,6 +193,16 @@ namespace mrw { AutoPtr(AutoPtr& o) throw(std::bad_exception): _res(o.release()) { } + //! @brief Do not use this method! + //! This method had to be introduced for the @c std::map, where + //! @c operator[] first creates an empty element, then assigns it + //! the real value. Because that empty element is temporary, gcc can + //! not use @c AutoResource(AutoResource&) since release 4.0. + AutoPtr(const AutoPtr& o) throw(std::bad_exception): _res(0) { + assert(o._res==0); + if (o._res!=0) + _res = const_cast(o).release(); + } /// @brief Free resource. Calls @c reset(). ~AutoPtr() throw(std::bad_exception) {reset();} /// @brief Assign new resource. Calls @c reset(). @@ -260,7 +255,7 @@ namespace mrw { }; /** @brief Automatically closes a file when destructed. - @pre #include + @pre \#include AutoFile works exactly like std::auto_ptr, but for files instead of pointers. Whenever the context of AutoFile is left, @@ -297,7 +292,7 @@ namespace mrw { ::munmap((char*)res.first, res.second); // char* conversion for windoze cygwin compatibility } /** @brief Automatically calls @c munmap on destruction for mmaped files. - @pre #include + @pre \#include It's the same as std::auto_ptr, but for @c mmap instead of @c new. When the context of @c AutoMapper is left, @c munmap is @@ -307,7 +302,7 @@ namespace mrw { AutoMapper; /** @brief Automatically calls @c bfd_close for @c bfd*. - @pre #include + @pre \#include It acts like a @c std::auto_ptr, but for @c bfd*, that means it calls @c bfd_close whenever the context is left. @@ -316,7 +311,7 @@ namespace mrw { /** @brief Automatically calls @c free for @c malloc allocated memory. Instanciate it as @c mrw::Auto::Free. - @pre #include + @pre \#include It works like a @c std::auto_ptr, but for memory that was allocated with @c malloc, not @c new. Memory is freed, whenever diff --git a/mrw/autofunctiontracelog4cxx.cpp b/mrw/autofunctiontracelog4cxx.cpp index e47aa39..db5568f 100644 --- a/mrw/autofunctiontracelog4cxx.cpp +++ b/mrw/autofunctiontracelog4cxx.cpp @@ -8,17 +8,6 @@ @copy © Marc Wäckerlin @license LGPL, see file COPYING - $Log$ - Revision 1.3 2005/04/14 19:12:18 marc - better formatting for operators - - Revision 1.2 2005/04/07 20:42:38 marc - renamed loggerhierarchy from mrw.gccfunctiontrace to mrw.fn - - Revision 1.1 2005/03/11 21:07:54 marc - initial version - - 1 2 3 4 5 6 7 8 5678901234567890123456789012345678901234567890123456789012345678901234567890 */ @@ -34,6 +23,10 @@ #include #include +#if (__GNUC__==3 && __GNUC_MINOR__<4 || __GNUC__<3) && _REENTRANT && !_MT +#define _MT +#endif + // these are special built in functions of GNU Compiler Collection extern "C" void __cyg_profile_func_enter (void *, void *) __attribute__((no_instrument_function)); extern "C" void __cyg_profile_func_exit (void *, void *) __attribute__((no_instrument_function)); @@ -45,7 +38,7 @@ namespace mrw { bool recurse; }; -#ifdef _REENTRANT +#ifdef _MT static __thread ThreadInfo info = {0, false}; #else static ThreadInfo info = {0, false}; @@ -58,13 +51,17 @@ namespace mrw { Lock() __attribute__((no_instrument_function)); ~Lock() __attribute__((no_instrument_function)); }; + // workaround doxygen problem: + // - the C++ compiler compiles the following code + // - doxygen ignores it +#ifndef LET_DOXYGEN_IGNORE_THIS // doxygen can't match with __attribute__ above Lock::Lock() { info.recurse = true; } Lock::~Lock() { info.recurse = false; } - +#endif } extern "C" int main(int, char**); @@ -169,7 +166,7 @@ extern "C" void __cyg_profile_func_enter(void *this_fn, void*) { { static bool init(mrw::StackTrace::createSymtable()); if (!init) return; - mrw::StackTrace::CodePos pos(mrw::StackTrace::translate(this_fn)); + const mrw::StackTrace::CodePos& pos(mrw::StackTrace::translate(this_fn)); std::string hierarchy(pos.function); for (std::string::size_type p(0); (p=hierarchy.find("::", p))!=std::string::npos; @@ -182,7 +179,7 @@ extern "C" void __cyg_profile_func_enter(void *this_fn, void*) { log4cxx::Logger* logger (log4cxx::Logger::getLogger(_T("mrw.fn.")+hierarchy)); if (logger->isDebugEnabled()) { - std::stringstream ss; + std::ostringstream ss; ss<forcedLog(::log4cxx::Level::DEBUG, ss.str(), @@ -204,7 +201,7 @@ extern "C" void __cyg_profile_func_exit(void *this_fn, void*) { if (mrw::info.recurse || mrw::info.level==0) return; mrw::Lock lock; { - mrw::StackTrace::CodePos pos(mrw::StackTrace::translate(this_fn)); + const mrw::StackTrace::CodePos& pos(mrw::StackTrace::translate(this_fn)); std::string hierarchy(pos.function); for (std::string::size_type p(0); (p=hierarchy.find("::", p))!=std::string::npos; @@ -217,7 +214,7 @@ extern "C" void __cyg_profile_func_exit(void *this_fn, void*) { log4cxx::Logger* logger (log4cxx::Logger::getLogger(_T("mrw.fn.")+hierarchy)); if (logger->isDebugEnabled()) { - std::stringstream ss; + std::ostringstream ss; ss<forcedLog(::log4cxx::Level::DEBUG, ss.str(), diff --git a/mrw/autostacktracelog4cxx.cpp b/mrw/autostacktracelog4cxx.cpp index 2e89a4e..916f281 100644 --- a/mrw/autostacktracelog4cxx.cpp +++ b/mrw/autostacktracelog4cxx.cpp @@ -8,41 +8,16 @@ @copy © Marc Wäckerlin @license LGPL, see file COPYING - $Log$ - Revision 1.7 2005/04/07 20:43:50 marc - docu corrected, new doxygen - - Revision 1.6 2005/02/25 16:18:15 marc - now naming for the logger: "mrw.stacktrace" instead of simply "libmrw" - - Revision 1.5 2005/01/28 12:13:11 marc - interference between group name StackTrace and class name StackTrace - - Revision 1.4 2005/01/28 12:13:11 marc - interference between group name StackTrace and class name StackTrace - - Revision 1.3 2005/01/28 07:42:23 marc - added terminate handler (uncaught handler) - - Revision 1.2 2004/08/28 16:21:25 marc - mrw-c++-0.92 (mrw) - - new file: version.cpp - - new file header for all sources - - work around warning in mrw::auto - - possibility to compile without log4cxx - - work around bugs in demangle.h and libiberty.h - - corrections in documentation - - added simple tracing mechanism - - more warnings - - small corrections in Auto<>::Free and a new test for it - - possibility to compile without stack trace - */ #include #include #include #include +#ifndef _T +#define _T +#endif + namespace mrw { /** @addtogroup AutoTrace diff --git a/mrw/autostacktracestderr.cpp b/mrw/autostacktracestderr.cpp index 2ffdbd6..c41bcff 100644 --- a/mrw/autostacktracestderr.cpp +++ b/mrw/autostacktracestderr.cpp @@ -8,32 +8,6 @@ @copy © Marc Wäckerlin @license LGPL, see file COPYING - $Log$ - Revision 1.7 2005/01/28 12:13:11 marc - interference between group name StackTrace and class name StackTrace - - Revision 1.6 2005/01/28 12:13:11 marc - interference between group name StackTrace and class name StackTrace - - Revision 1.5 2005/01/28 07:42:23 marc - added terminate handler (uncaught handler) - - Revision 1.4 2004/10/13 10:41:28 marc - no newline at the end of stack trace - - Revision 1.3 2004/08/28 16:21:25 marc - mrw-c++-0.92 (mrw) - - new file: version.cpp - - new file header for all sources - - work around warning in mrw::auto - - possibility to compile without log4cxx - - work around bugs in demangle.h and libiberty.h - - corrections in documentation - - added simple tracing mechanism - - more warnings - - small corrections in Auto<>::Free and a new test for it - - possibility to compile without stack trace - */ #include #include diff --git a/mrw/configfile.cpp b/mrw/configfile.cpp index 0be203f..794b3ff 100644 --- a/mrw/configfile.cpp +++ b/mrw/configfile.cpp @@ -9,6 +9,9 @@ @license LGPL, see file COPYING $Log$ + Revision 1.3 2005/11/29 12:39:42 marc + make it compilable with gcc 4.0.2 and newer doxygen + Revision 1.2 2005/01/28 07:49:32 marc Save configuration using file.hpp @@ -129,7 +132,12 @@ mrw::ConfigFileReader& mrw::ConfigFileWriter& #endif mrw::ConfigFileWriter::reload() throw(std::exception) { +#if __GNUC__ == 3 && __GNUC_MINOR__ < 4 return parse(_file=mrw::File::read(_filename)); +#else + return dynamic_cast + (parse(_file=mrw::File::read(_filename))); +#endif } mrw::ConfigFileWriter& mrw::ConfigFileWriter::save() throw(std::exception) { diff --git a/mrw/configfile.hpp b/mrw/configfile.hpp index 9d75740..535389a 100644 --- a/mrw/configfile.hpp +++ b/mrw/configfile.hpp @@ -9,6 +9,9 @@ @license LGPL, see file COPYING $Log$ + Revision 1.3 2005/11/29 12:39:42 marc + make it compilable with gcc 4.0.2 and newer doxygen + Revision 1.2 2005/01/28 07:49:32 marc Save configuration using file.hpp @@ -27,7 +30,7 @@ namespace mrw { /** @defgroup config Configuration File Handler - @pre #include + @pre \#include Read configuration parameters from a file. diff --git a/mrw/deque.hpp b/mrw/deque.hpp index 0f71c7c..0d30ffd 100644 --- a/mrw/deque.hpp +++ b/mrw/deque.hpp @@ -9,6 +9,9 @@ @license LGPL, see file COPYING $Log$ + Revision 1.4 2005/11/29 12:39:42 marc + make it compilable with gcc 4.0.2 and newer doxygen + Revision 1.3 2005/04/07 20:48:20 marc docu: new doxygen, new grouping @@ -43,7 +46,7 @@ @param l a deque of values @param o a value to be inserted into deque @c l - @pre #include + @pre \#include */ template std::deque& operator<<(std::deque& l, const T& o) throw(std::bad_exception) { @@ -67,7 +70,7 @@ std::deque& operator<<(std::deque& l, const T& o) throw(std::bad_exc @note when something is extracted from a deque, it is removed from the deque, that means after every shift the deque is shortened by the shifted element - @pre #include + @pre \#include */ template std::deque& operator>>(std::deque& l, T& o) throw(std::exception) { diff --git a/mrw/doxyfile.in b/mrw/doxyfile.in index 0c43fd9..fe2847b 100644 --- a/mrw/doxyfile.in +++ b/mrw/doxyfile.in @@ -9,6 +9,9 @@ ## @license LGPL, see file COPYING ## ## $Log$ +## Revision 1.16 2005/11/29 12:39:42 marc +## make it compilable with gcc 4.0.2 and newer doxygen +## ## Revision 1.15 2005/04/07 20:55:21 marc ## Oops, there's a make distcheck...? Now it works. ## @@ -898,7 +901,7 @@ MACRO_EXPANSION = NO EXPAND_ONLY_PREDEF = NO # If the SEARCH_INCLUDES tag is set to YES (the default) the includes files -# in the INCLUDE_PATH (see below) will be search if a #include is found. +# in the INCLUDE_PATH (see below) will be search if a \#include is found. SEARCH_INCLUDES = YES @@ -921,7 +924,7 @@ INCLUDE_FILE_PATTERNS = # or name=definition (no spaces). If the definition and the = are # omitted =1 is assumed. -PREDEFINED = HAVE_STACKTRACE +PREDEFINED = HAVE_STACKTRACE LET_DOXYGEN_IGNORE_THIS # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then # this tag can be used to specify a list of macro names that should be expanded. diff --git a/mrw/dynamiclibrary.hpp b/mrw/dynamiclibrary.hpp index ad45fc1..a288796 100644 --- a/mrw/dynamiclibrary.hpp +++ b/mrw/dynamiclibrary.hpp @@ -9,6 +9,9 @@ @license LGPL, see file COPYING $Log$ + Revision 1.3 2005/11/29 12:39:42 marc + make it compilable with gcc 4.0.2 and newer doxygen + Revision 1.2 2005/02/21 16:16:47 marc finished and documented @@ -48,7 +51,7 @@ namespace mrw { } @endcode - @pre #include + @pre \#include @pre Files that use this wrapper must be linked with libltdl, with GNU g++ on UNIX, this is link option: @c -lltdl diff --git a/mrw/errno.hpp b/mrw/errno.hpp index c807def..12ab30e 100644 --- a/mrw/errno.hpp +++ b/mrw/errno.hpp @@ -9,6 +9,9 @@ @license LGPL, see file COPYING $Log$ + Revision 1.3 2005/11/29 12:39:42 marc + make it compilable with gcc 4.0.2 and newer doxygen + Revision 1.2 2005/02/18 15:53:07 marc I'm so stupid, there's strerror for mapping errno to a string... @@ -40,7 +43,7 @@ namespace mrw { /** @brief Stores a UNIX errno error number and converts it to string. - @pre #include */ + @pre \#include */ class Errno { //................................................................ methods @@ -74,7 +77,7 @@ namespace mrw { /** @brief to be thrown when a unix system call fails, evaluates @c errno - @pre #include */ + @pre \#include */ class unix_error: public mrw::runtime_error { diff --git a/mrw/exception.hpp b/mrw/exception.hpp index ec46db7..2ddc2d3 100644 --- a/mrw/exception.hpp +++ b/mrw/exception.hpp @@ -9,6 +9,9 @@ @license LGPL, see file COPYING $Log$ + Revision 1.12 2005/11/29 12:39:42 marc + make it compilable with gcc 4.0.2 and newer doxygen + Revision 1.11 2005/03/14 16:25:23 marc changed size of dot image so that it fits an A4 @@ -236,7 +239,7 @@ call of fn0 successful //@{ /** @brief replacement for @c std::exception, that collects a stack trace - @pre #include + @pre \#include This exception class behaves exactely like @c std::exception, but it collects a stack trace in the constructor and offers a diff --git a/mrw/exec.cpp b/mrw/exec.cpp index 2ac7dff..652bcae 100644 --- a/mrw/exec.cpp +++ b/mrw/exec.cpp @@ -9,6 +9,9 @@ @license LGPL, see file COPYING $Log$ + Revision 1.14 2005/11/29 12:39:42 marc + make it compilable with gcc 4.0.2 and newer doxygen + Revision 1.13 2005/04/20 18:32:14 marc *** empty log message *** @@ -385,7 +388,7 @@ mrw::PartialExec::PartialExec(const mrw::PartialExec& e) _input(e._input), _num0(e._num0), _num1(e._num1), _num2(e._num2), _lastPid(e._lastPid), _pid(e._pid) { - /// @warning @c const is casted away + /** @warning @c const is casted away */ mrw::PartialExec& nonConstE(const_cast(e)); _stdIn = nonConstE._stdIn; _stdOut = nonConstE._stdOut; diff --git a/mrw/exec.hpp b/mrw/exec.hpp index 75db4aa..4e1d3b0 100644 --- a/mrw/exec.hpp +++ b/mrw/exec.hpp @@ -9,6 +9,9 @@ @license LGPL, see file COPYING $Log$ + Revision 1.8 2005/11/29 12:39:42 marc + make it compilable with gcc 4.0.2 and newer doxygen + Revision 1.7 2005/04/20 18:12:55 marc added kill() for PartialExec @@ -95,7 +98,7 @@ namespace mrw { //============================================================================ /** @brief Exception: Execution of command failed. - @pre #include + @pre \#include This exception is thrown, if the exection of a command in mrw::Exec is failed. That means, it was not possible to fork or @@ -115,7 +118,7 @@ namespace mrw { //============================================================================ /** @brief Execute a command in a new process. - @pre #include + @pre \#include This class handles the execution of a command in a new process and returns the two streams @c cout and @c cerr, also known as @c @@ -280,7 +283,7 @@ namespace mrw { //============================================================================ /** @brief Execute a UNIX program in non blocking parts. - @pre #include + @pre \#include A given UNIX command is executed, but the class does not wait until it is finished, instead it gives back the control to the @@ -437,7 +440,7 @@ while (!exec.finished()) res+=exec.read().first; //============================================================================ /** @brief A system command to be executed - @pre #include + @pre \#include This class is used in conjunction with mrw::Exec. It must be initialized with the command name, then the command parameters diff --git a/mrw/functiontrace.hpp b/mrw/functiontrace.hpp index a145bda..dac9cd7 100644 --- a/mrw/functiontrace.hpp +++ b/mrw/functiontrace.hpp @@ -9,6 +9,9 @@ @license LGPL, see file COPYING $Log$ + Revision 1.3 2005/11/29 12:39:42 marc + make it compilable with gcc 4.0.2 and newer doxygen + Revision 1.2 2005/04/07 20:50:13 marc docu: new doxygen, new grouping @@ -28,13 +31,22 @@ #include #include +// support for log4cxx 0.9.7 and for new CVS version +#ifndef LOG4CXX_LOCATION +# define MRW_LOG4CXX_LOCATION _file.c_str(), _line +#else +# define LOG4CXX_CVS +# define MRW_LOG4CXX_LOCATION \ + ::log4cxx::spi::LocationInfo(_name.c_str(), _file.c_str(), _line) +#endif + namespace mrw { /** @addtogroup debug */ //@{ /** @defgroup FunctionTrace Function Tracing (using log4cxx) - @pre #include + @pre \#include Place the macro @ref METHOD as first line of all methods you want to trace, and macro @ref FUNCTION as first line of all functions to be @@ -56,8 +68,8 @@ namespace mrw { The trace of the following code: @code - #include - #include + \#include + \#include void fn(int i=0) { FUNCTION("fn(int)"); // trace entry and exit if (i<4) fn(++i); @@ -234,7 +246,7 @@ namespace mrw { oss<forcedLog(log4cxx::Level::DEBUG, oss.str(), - _file.c_str(), _line); + MRW_LOG4CXX_LOCATION); ++_level; } } @@ -248,7 +260,7 @@ namespace mrw { oss<forcedLog(log4cxx::Level::DEBUG, oss.str(), - _file.c_str(), _line); + MRW_LOG4CXX_LOCATION); ++_level; } } @@ -263,7 +275,7 @@ namespace mrw { oss<forcedLog(log4cxx::Level::DEBUG, oss.str(), - _file.c_str(), _line); + MRW_LOG4CXX_LOCATION); } } private: diff --git a/mrw/list.hpp b/mrw/list.hpp index c4ed330..cf8f6ea 100644 --- a/mrw/list.hpp +++ b/mrw/list.hpp @@ -9,6 +9,9 @@ @license LGPL, see file COPYING $Log$ + Revision 1.4 2005/11/29 12:39:42 marc + make it compilable with gcc 4.0.2 and newer doxygen + Revision 1.3 2005/04/07 20:48:20 marc docu: new doxygen, new grouping @@ -62,14 +65,39 @@ @param l a list of values @param o a value to be inserted into list @c l - @pre #include + @pre \#include */ +// template +// std::list& operator<<(std::list& l, const FROM& o) +// throw(std::bad_exception) { +// l.push_back(T(o)); +// return l; +// } template -std::list& operator<<(std::list& l, const T& o) throw(std::bad_exception) { + std::list& operator<<(std::list& l, const T& o) + throw(std::bad_exception) { l.push_back(o); return l; } +/* @brief push a char* to a list of string + + @code + std::list test; + test<<"Hello"<<"World"; + @endcode + + @param l a list of string values (that can be constructed from char*) + @param o a value to be inserted into list @c l + @pre \#include */ +template + std::list& operator<<(std::list& l, + const char *const o) + throw(std::bad_exception) { + l.push_back(T(o)); + return l; +} + /** @brief extract the first value of a list @code @@ -86,7 +114,7 @@ std::list& operator<<(std::list& l, const T& o) throw(std::bad_excep @note when something is extracted from a list, it is removed from the list, that means after every shift the list is shortened by the shifted element - @pre #include + @pre \#include */ template std::list& operator>>(std::list& l, T& o) throw(std::exception) { @@ -100,7 +128,6 @@ std::list& operator>>(std::list& l, T& o) throw(std::exception) { return l; } -//@} //@} //@} diff --git a/mrw/log4cxxconfiguration.cpp b/mrw/log4cxxconfiguration.cpp index 3685cfc..8dcd8a2 100644 --- a/mrw/log4cxxconfiguration.cpp +++ b/mrw/log4cxxconfiguration.cpp @@ -9,6 +9,9 @@ @license LGPL, see file COPYING $Log$ + Revision 1.3 2005/11/29 12:39:42 marc + make it compilable with gcc 4.0.2 and newer doxygen + Revision 1.2 2005/04/14 19:06:37 marc no more duplicated traces, better filtering for Qt @@ -24,6 +27,10 @@ #include #include +#if (__GNUC__==3 && __GNUC_MINOR__<4 || __GNUC__<3) && _REENTRANT && !_MT +#define _MT +#endif + namespace mrw { /** @addtogroup debug @@ -153,7 +160,7 @@ log4j.appender.A1.layout.ConversionPattern = 60c%m%n "org.apache.log4j.ConsoleAppender"); properties.setProperty("log4j.appender.A1.layout", "org.apache.log4j.PatternLayout"); -#ifdef _REENTRANT +#ifdef _MT properties.setProperty("log4j.appender.A1.layout.ConversionPattern", "%t-%-60c%m%n"); #else @@ -167,4 +174,4 @@ log4j.appender.A1.layout.ConversionPattern = 60c%m%n //@} //@} -}; +} diff --git a/mrw/map.hpp b/mrw/map.hpp index c023937..a1f6f95 100644 --- a/mrw/map.hpp +++ b/mrw/map.hpp @@ -9,6 +9,9 @@ @license LGPL, see file COPYING $Log$ + Revision 1.4 2005/11/29 12:39:42 marc + make it compilable with gcc 4.0.2 and newer doxygen + Revision 1.3 2005/04/07 20:48:20 marc docu: new doxygen, new grouping @@ -45,7 +48,7 @@ @throw mrw::invalid_argument, if element is already in map @param l a map of values @param o a value to be inserted into map @c l - @pre #include + @pre \#include */ template std::map& operator<<(std::map& l, const std::pair& o) @@ -75,7 +78,7 @@ std::map& operator<<(std::map& l, const std::pair& @note when something is extracted from a map, it is removed from the map, that means after every shift the map is shortened by the shifted element - @pre #include + @pre \#include */ template std::map& operator>>(std::map& l, std::pair& o) diff --git a/mrw/mrw.hpp.in b/mrw/mrw.hpp.in index fa29f3c..25c48fb 100644 --- a/mrw/mrw.hpp.in +++ b/mrw/mrw.hpp.in @@ -104,7 +104,7 @@ Include the headers you need with prefix @c mrw, e.g.: @verbatim - #include + \#include @endverbatim All classes are in the @c mrw namespace. @@ -132,9 +132,19 @@ /** @page threads Thread Safety + There is a severe bug in the g++ compiler with version + >= 3.4: The macro @c _REENTRANT is always set and cannot be + used to check whether we are in a multithreaded compilation or + not! See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11953 for + more details. Workaround: To enable multithreading, you must pass + the @c -D_MT compiler flag for the GNU gcc verions 3.4 and above! + To enable thread safety, you must link to @c libmrw-mt instead of @c libmrw. That means, your link option is: @c -lmrw-mt + For GNU gcc verions 3.4 and above, you must use the compile option + @c -D_MT in addition, because of a severe bug in the compiler. + Different instances of classes can run in different threads, but instances of classes can not be shared between different threads. diff --git a/mrw/mrwautofunctiontracelog4cxx_test.cpp b/mrw/mrwautofunctiontracelog4cxx_test.cpp index fbb3bf2..73fb463 100644 --- a/mrw/mrwautofunctiontracelog4cxx_test.cpp +++ b/mrw/mrwautofunctiontracelog4cxx_test.cpp @@ -9,6 +9,9 @@ @license LGPL, see file COPYING $Log$ + Revision 1.3 2005/11/29 12:39:42 marc + make it compilable with gcc 4.0.2 and newer doxygen + Revision 1.2 2005/04/07 20:42:38 marc renamed loggerhierarchy from mrw.gccfunctiontrace to mrw.fn @@ -32,6 +35,10 @@ #include #include +#if (__GNUC__==3 && __GNUC_MINOR__<4 || __GNUC__<3) && _REENTRANT && !_MT +#define _MT +#endif + namespace HalloWelt { class A { @@ -40,14 +47,14 @@ namespace HalloWelt { } }; - void fn() { + void fn(int) { A().method(); A().method(); } void fn1() { - fn(); - fn(); + fn(1); + fn(2); } } @@ -56,7 +63,7 @@ void anotherFunction() { HalloWelt::fn1(); } -#ifdef _REENTRANT +#ifdef _MT #include //#include // sleep, the one from boost::thread does not work! class Thread { @@ -72,7 +79,7 @@ namespace mrw { public: void testcase() { mrw::StackTrace::createSymtable(); -#ifdef _REENTRANT +#ifdef _MT try {mrw::File::remove("mrwautofunctiontracelog4cxx_test-mt.log");} #else try {mrw::File::remove("mrwautofunctiontracelog4cxx_test.log");} @@ -103,7 +110,7 @@ namespace mrw { "org.apache.log4j.FileAppender"); properties.setProperty("log4j.appender.A1.layout", "org.apache.log4j.PatternLayout"); -#ifdef _REENTRANT +#ifdef _MT properties.setProperty("log4j.appender.A1.layout.ConversionPattern", "%t-%-27c%m%n"); properties.setProperty("log4j.appender.A1.filename", @@ -115,7 +122,7 @@ namespace mrw { "mrwautofunctiontracelog4cxx_test.log"); #endif log4cxx::PropertyConfigurator::configure(properties); -#ifdef _REENTRANT +#ifdef _MT // sleep(4); // to be reproducable, wait for "main" flag Thread threadFunction; boost::thread::thread thread1(threadFunction); @@ -123,7 +130,7 @@ namespace mrw { boost::thread::thread thread3(threadFunction); #endif anotherFunction(); -#ifdef _REENTRANT +#ifdef _MT thread1.join(); thread2.join(); thread3.join(); @@ -133,37 +140,46 @@ namespace mrw { mrw::RegExp match ("^mrw\\.fn\\.anotherFunction ( ? ? ?)\\\\ anotherFunction\\(\\)\n" "mrw\\.fn\\.HalloWelt\\.fn1 \\1 \\\\ HalloWelt::fn1\\(\\)\n" - "mrw\\.fn\\.HalloWelt\\.fn \\1 \\\\ HalloWelt::fn\\(\\)\n" + "mrw\\.fn\\.HalloWelt\\.fn \\1 \\\\ HalloWelt::fn\\(int\\)\n" "mrw\\.fn\\.HalloWelt\\.A\\.method \\1 \\\\ HalloWelt::A::method\\(\\)\n" "mrw\\.fn\\.HalloWelt\\.A\\.method \\1 / HalloWelt::A::method\\(\\)\n" "mrw\\.fn\\.HalloWelt\\.A\\.method \\1 \\\\ HalloWelt::A::method\\(\\)\n" "mrw\\.fn\\.HalloWelt\\.A\\.method \\1 / HalloWelt::A::method\\(\\)\n" - "mrw\\.fn\\.HalloWelt\\.fn \\1 / HalloWelt::fn\\(\\)\n" - "mrw\\.fn\\.HalloWelt\\.fn \\1 \\\\ HalloWelt::fn\\(\\)\n" + "mrw\\.fn\\.HalloWelt\\.fn \\1 / HalloWelt::fn\\(int\\)\n" + "mrw\\.fn\\.HalloWelt\\.fn \\1 \\\\ HalloWelt::fn\\(int\\)\n" "mrw\\.fn\\.HalloWelt\\.A\\.method \\1 \\\\ HalloWelt::A::method\\(\\)\n" "mrw\\.fn\\.HalloWelt\\.A\\.method \\1 / HalloWelt::A::method\\(\\)\n" "mrw\\.fn\\.HalloWelt\\.A\\.method \\1 \\\\ HalloWelt::A::method\\(\\)\n" "mrw\\.fn\\.HalloWelt\\.A\\.method \\1 / HalloWelt::A::method\\(\\)\n" - "mrw\\.fn\\.HalloWelt\\.fn \\1 / HalloWelt::fn\\(\\)\n" + "mrw\\.fn\\.HalloWelt\\.fn \\1 / HalloWelt::fn\\(int\\)\n" "mrw\\.fn\\.HalloWelt\\.fn1 \\1 / HalloWelt::fn1\\(\\)\n" "mrw\\.fn\\.anotherFunction \\1/ anotherFunction\\(\\)\n$"); -#ifdef _REENTRANT +#ifdef _MT std::string log(mrw::File::read("mrwautofunctiontracelog4cxx_test-mt.log")); - std::map logs; + typedef std::map Logs; + Logs logs; for (std::string::size_type pos(0), last(0); (pos=log.find('\n', pos+1))!=std::string::npos; last=pos) { std::string::size_type dash(log.find('-', last)); - CPPUNIT_ASSERT(dash!=std::string::npos); + CPPUNIT_ASSERT_MESSAGE("\"-\" not found", + dash!=std::string::npos); logs[mrw::to(log.substr(last, dash-last))] += log.substr(dash+1, pos-dash); } - CPPUNIT_ASSERT(logs.size()==4); // 4 threads - for (std::map::iterator it(logs.begin()); - it!=logs.end(); ++it) - CPPUNIT_ASSERT(match(it->second)); + CPPUNIT_ASSERT_EQUAL((Logs::size_type)4, logs.size()); // 4 threads + for (Logs::iterator it(logs.begin()); it!=logs.end(); ++it) + CPPUNIT_ASSERT_MESSAGE("The following text does not match the " + "Expectation:\n--------------------\n" + +it->second+"--------------------", + match(it->second)); mrw::File::remove("mrwautofunctiontracelog4cxx_test-mt.log"); #else - CPPUNIT_ASSERT(match(mrw::File::read("mrwautofunctiontracelog4cxx_test.log"))); + CPPUNIT_ASSERT_MESSAGE + ("The following text does not match the " + "Expectation:\n--------------------\n" + +mrw::File::read("mrwautofunctiontracelog4cxx_test.log") + +"--------------------", + match(mrw::File::read("mrwautofunctiontracelog4cxx_test.log"))); mrw::File::remove("mrwautofunctiontracelog4cxx_test.log"); #endif } diff --git a/mrw/multimap.hpp b/mrw/multimap.hpp index 6f0114c..5def115 100644 --- a/mrw/multimap.hpp +++ b/mrw/multimap.hpp @@ -9,6 +9,9 @@ @license LGPL, see file COPYING $Log$ + Revision 1.4 2005/11/29 12:39:42 marc + make it compilable with gcc 4.0.2 and newer doxygen + Revision 1.3 2005/04/07 20:48:20 marc docu: new doxygen, new grouping @@ -45,7 +48,7 @@ @throw mrw::invalid_argument, if element is already in multimap @param l a multimap of values @param o a value to be inserted into multimap @c l - @pre #include + @pre \#include */ template std::multimap& operator<<(std::multimap& l, const std::pair& o) @@ -71,7 +74,7 @@ std::multimap& operator<<(std::multimap& l, const std::p @note when something is extracted from a multimap, it is removed from the multimap, that means after every shift the multimap is shortened by the shifted element - @pre #include + @pre \#include */ template std::multimap& operator>>(std::multimap& l, std::pair& o) diff --git a/mrw/multiset.hpp b/mrw/multiset.hpp index c6177ee..48a406f 100644 --- a/mrw/multiset.hpp +++ b/mrw/multiset.hpp @@ -9,6 +9,9 @@ @license LGPL, see file COPYING $Log$ + Revision 1.4 2005/11/29 12:39:42 marc + make it compilable with gcc 4.0.2 and newer doxygen + Revision 1.3 2005/04/07 20:48:20 marc docu: new doxygen, new grouping @@ -43,7 +46,7 @@ @param l a multiset of values @param o a value to be inserted into multiset @c l - @pre #include + @pre \#include */ template std::multiset& operator<<(std::multiset& l, const T& o) throw(std::bad_exception) { @@ -67,7 +70,7 @@ std::multiset& operator<<(std::multiset& l, const T& o) throw( @note when something is extracted from a multiset, it is removed from the multiset, that means after every shift the multiset is shortened by the shifted element - @pre #include + @pre \#include */ template std::multiset& operator>>(std::multiset& l, T& o) throw(std::exception) { diff --git a/mrw/regexp.hpp b/mrw/regexp.hpp index 9a470d5..96907fa 100644 --- a/mrw/regexp.hpp +++ b/mrw/regexp.hpp @@ -9,14 +9,17 @@ @license LGPL, see file COPYING $Log$ + Revision 1.8 2005/11/29 12:39:42 marc + make it compilable with gcc 4.0.2 and newer doxygen + Revision 1.7 2005/03/02 22:02:10 marc fixed for solaris (included sys/types.h) Revision 1.6 2005/01/28 07:52:00 marc - added #include to documentation + added \#include to documentation Revision 1.5 2004/12/20 13:21:49 marc - #ifndef forgotten + \#ifndef forgotten Revision 1.4 2004/12/20 07:40:36 marc documentation improved, new grouping @@ -47,7 +50,7 @@ namespace mrw { //@{ /** @defgroup regexpregexp Regular Expressions - @pre #include + @pre \#include A simple wrapper around the C POSIX regular expression library with a C++ Interface. diff --git a/mrw/set.hpp b/mrw/set.hpp index 8b254f5..9852fc4 100644 --- a/mrw/set.hpp +++ b/mrw/set.hpp @@ -9,6 +9,9 @@ @license LGPL, see file COPYING $Log$ + Revision 1.4 2005/11/29 12:39:42 marc + make it compilable with gcc 4.0.2 and newer doxygen + Revision 1.3 2005/04/07 20:48:20 marc docu: new doxygen, new grouping @@ -44,7 +47,7 @@ @throw mrw::invalid_argument, if element is already in set @param l a set of values @param o a value to be inserted into set @c l - @pre #include + @pre \#include */ template std::set& operator<<(std::set& l, const T& o) @@ -73,7 +76,7 @@ std::set& operator<<(std::set& l, const T& o) @note when something is extracted from a set, it is removed from the set, that means after every shift the set is shortened by the shifted element - @pre #include + @pre \#include */ template std::set& operator>>(std::set& l, T& o) diff --git a/mrw/smartpointer.hpp b/mrw/smartpointer.hpp index 585eda5..589c25e 100644 --- a/mrw/smartpointer.hpp +++ b/mrw/smartpointer.hpp @@ -8,20 +8,6 @@ @copy © Marc Wäckerlin @license LGPL, see file COPYING - $Log$ - Revision 1.2 2004/08/28 16:21:25 marc - mrw-c++-0.92 (mrw) - - new file: version.cpp - - new file header for all sources - - work around warning in mrw::auto - - possibility to compile without log4cxx - - work around bugs in demangle.h and libiberty.h - - corrections in documentation - - added simple tracing mechanism - - more warnings - - small corrections in Auto<>::Free and a new test for it - - possibility to compile without stack trace - */ #ifndef __MRW__SMARTPOINTER_HPP__ #define __MRW__SMARTPOINTER_HPP__ @@ -63,7 +49,7 @@ namespace mrw { //@{ /** @brief Smart Pointer Implementation - @pre #include + @pre \#include This is a smart pointer that can be casted withing the inheritance of the pointer it is storing. diff --git a/mrw/stacktrace.hpp b/mrw/stacktrace.hpp index 5307b82..75d0478 100644 --- a/mrw/stacktrace.hpp +++ b/mrw/stacktrace.hpp @@ -8,54 +8,6 @@ @copy © Marc Wäckerlin @license LGPL, see file COPYING - $Log$ - Revision 1.15 2005/04/07 20:51:30 marc - docu: new doxygen, new grouping - - Revision 1.14 2005/03/11 23:22:58 marc - It's multithreaded now, thanks to a boost mutex - - Revision 1.13 2005/02/18 15:48:56 marc - Dynamic loading of libbfd, no more dependency on specific libbfd version! - - Revision 1.12 2005/01/28 12:13:11 marc - interference between group name StackTrace and class name StackTrace - - Revision 1.11 2005/01/28 12:13:11 marc - interference between group name StackTrace and class name StackTrace - - Revision 1.10 2004/11/25 18:30:20 marc - bug fixed (put solution in the documentation) - - Revision 1.9 2004/10/13 10:47:15 marc - no more need for ldd in StackTrace, read from /proc/self/maps - - Revision 1.8 2004/10/11 16:49:32 marc - Better comment for new shared library feature - - Revision 1.7 2004/10/11 15:58:51 marc - First version with working support for shared libraries! - - Revision 1.6 2004/10/07 16:59:12 marc - new method createSymtable that takes a list of arguments - -> untested! - - Revision 1.5 2004/10/07 09:32:45 marc - correction in parameter (const&) - - Revision 1.4 2004/08/28 16:21:25 marc - mrw-c++-0.92 (mrw) - - new file: version.cpp - - new file header for all sources - - work around warning in mrw::auto - - possibility to compile without log4cxx - - work around bugs in demangle.h and libiberty.h - - corrections in documentation - - added simple tracing mechanism - - more warnings - - small corrections in Auto<>::Free and a new test for it - - possibility to compile without stack trace - */ #ifndef __MRW_STACKTRACE_HPP__ #define __MRW_STACKTRACE_HPP__ @@ -68,7 +20,10 @@ #include #include -#ifdef _REENTRANT +#if (__GNUC__==3 && __GNUC_MINOR__<4 || __GNUC__<3) && _REENTRANT && !_MT +#define _MT +#endif +#ifdef _MT #include #endif @@ -117,7 +72,7 @@ namespace mrw { //@{ /** @brief store and print a stack trace of the actual position in code - @pre #include + @pre \#include In the constructor, a stack trace is stored, but not yet evaluated. Therefore storing a stack trace is relatively @@ -181,6 +136,7 @@ namespace mrw { backtrace_symbols? I think rather not...? */ class StackTrace { + friend class StackTraceTest; public: //............................................................... typedefs /// container for the adresses @@ -189,14 +145,14 @@ namespace mrw { typedef std::list< std::pair > BinFiles; /// structure to store all evaluated information struct CodePos { - CodePos(void* a, std::string fn, std::string fi, unsigned int l) - throw(std::bad_exception): - address(a), function(fn), file(fi), line(l) { + CodePos(void const*const a, const std::string& fu, + const std::string& fi, unsigned int l): + address(a), function(fu), file(fi), line(l) { } - void* address; ///< the address pointer - std::string function; ///< function/method name - std::string file; ///< code file name - unsigned int line; ///< code line number + void const*const address; ///< the address pointer + std::string function; ///< function/method name + std::string file; ///< code file name + unsigned int line; ///< code line number }; //................................................................ methods /// the constructor stores the actual stack trace @@ -252,6 +208,17 @@ namespace mrw { */ static bool createSymtable(const std::string& fname="", void* offs=0) throw(std::bad_exception); + + /** @brief get the error text if @ref createSymtable returns false + + In case @ref createSymtable is not successful, you can use + this method to retrieve the error text of the exception that + was caught in @ref createSymtable. + + @return error text */ + static const std::string& error() throw() { + return _error; + } /** @brief read the symbol table from a list of an executable file and shared libraries @@ -288,15 +255,19 @@ namespace mrw { static int bfdClose(bfd*) throw(); typedef mrw::AutoResource AutoBfd; + friend class mrw::AutoResource + ; //.............................................................. variables AddressTrace _trace; static std::map _dic; static std::map _addrs; static std::map _bfd; static std::map > _syms; -#ifdef _REENTRANT +#ifdef _MT static boost::recursive_mutex _mutex; #endif + static std::string _error; + //................................................................ methods static BinFiles filename() throw(std::bad_exception); static void buildSectionMap(bfd*, asection*, void*) diff --git a/mrw/stacktrace_test.cpp b/mrw/stacktrace_test.cpp index b8e2edf..449a864 100644 --- a/mrw/stacktrace_test.cpp +++ b/mrw/stacktrace_test.cpp @@ -8,27 +8,10 @@ @copy © Marc Wäckerlin @license LGPL, see file COPYING - $Log$ - Revision 1.6 2005/01/28 07:51:24 marc - improved and corrected trace formatting - - Revision 1.5 2004/10/13 10:49:12 marc - check whether shared libraries are evaluated - - Revision 1.4 2004/08/28 16:21:25 marc - mrw-c++-0.92 (mrw) - - new file: version.cpp - - new file header for all sources - - work around warning in mrw::auto - - possibility to compile without log4cxx - - work around bugs in demangle.h and libiberty.h - - corrections in documentation - - added simple tracing mechanism - - more warnings - - small corrections in Auto<>::Free and a new test for it - - possibility to compile without stack trace - + 1 2 3 4 5 6 7 8 + 5678901234567890123456789012345678901234567890123456789012345678901234567890 */ + #include #include #include @@ -40,18 +23,48 @@ namespace mrw { public: /// test if symbols are correctely evaluated void StackTrace() { - mrw::StackTrace::createSymtable(); + bool init(mrw::StackTrace::createSymtable()); + CPPUNIT_ASSERT_MESSAGE("createSymtable() failed! ERROR=" + +mrw::StackTrace::error(), + init); mrw::StackTrace s; int l(__LINE__); std::string f(__FILE__); std::stringstream ss; ss<first+"\"\n"; + msg += "----------------------------------------\n"; std::string::size_type pos(st.find("mrw::StackTraceTest::StackTrace()")); - CPPUNIT_ASSERT(pos!=std::string::npos); - CPPUNIT_ASSERT(st.find(ss.str(), pos) < st.size()); - CPPUNIT_ASSERT(st.find("CppUnit::TestCase::run") - < st.size()); - CPPUNIT_ASSERT(st.find("????:0 ????") - >= st.size()); + CPPUNIT_ASSERT_MESSAGE("\"mrw::StackTraceTest::StackTrace()\"" + " not found!\n"+msg, pos!=std::string::npos); + CPPUNIT_ASSERT_MESSAGE('"'+ss.str()+"\" not found!\n"+msg, + st.find(ss.str(), pos) < st.size()); + CPPUNIT_ASSERT_MESSAGE("\"CppUnit::TestCaller" + "::runTest()\" not found!\n"+msg, + st.find("CppUnit::TestCaller" + "::runTest()") nm /usr/lib/libcppunit-1.10.so.2.0.0 + // nm: /usr/lib/libcppunit-1.10.so.2.0.0: no symbols + // > file /usr/lib/libcppunit-1.10.so.2.0.0 + // /usr/lib/libcppunit-1.10.so.2.0.0: + // ELF 32-bit LSB shared object, Intel 80386, + // version 1 (SYSV), stripped + //CPPUNIT_ASSERT_MESSAGE("\"CppUnit::TestCase::run\" not found!\n"+msg, + // st.find("CppUnit::TestCase::run")=st.size()); } CPPUNIT_TEST_SUITE(StackTraceTest); CPPUNIT_TEST(StackTrace); diff --git a/mrw/stdext.hpp b/mrw/stdext.hpp index 0fb94f8..c2487e1 100644 --- a/mrw/stdext.hpp +++ b/mrw/stdext.hpp @@ -8,30 +8,6 @@ @copy © Marc Wäckerlin @license LGPL, see file COPYING - $Log$ - Revision 1.7 2005/02/28 07:10:23 marc - removed deprecated min, max - - Revision 1.6 2005/02/18 15:47:23 marc - missing #ifndef - new functions ifelse - - Revision 1.5 2005/01/28 07:52:33 marc - typo in doc - - Revision 1.4 2004/12/20 07:40:36 marc - documentation improved, new grouping - - Revision 1.3 2004/12/17 16:27:28 marc - error in documentation: group forgotten - - Revision 1.2 2004/10/13 11:18:33 marc - getline reads a whole line from a stream - - Revision 1.1 2004/10/11 18:30:16 marc - *** empty log message *** - - */ #ifndef __MRW__STDEXT_HPP__ @@ -53,7 +29,7 @@ namespace mrw { - @ref ifelse implements a dual ?: operator, like: a ? a : b - @section stdextReadline Read Line + @section stdextGetline Read Line The global functions mrw::getline read exactly one line from a stream, without the need of a buffer. It is therefore guaranteed @@ -62,9 +38,9 @@ namespace mrw { @code // first syntax returns a string: - std::string line(mrw::readline(std::cin)); + std::string line(mrw::getline(std::cin)); // second syntax returns the stream: - while (mrw::readline(std::cin, line)) + while (mrw::getline(std::cin, line)) std::cout<<"Read: "<a ? a : b - @pre #include + @pre \#include @pre @c T must be convertible to @c bool */ template const T& ifelse(const T& a, const T& b) { @@ -108,7 +84,7 @@ namespace mrw { @param is the stream to read from @param d the end of line delimiter @return the line read from the stream - @pre #include + @pre \#include */ std::string getline(std::istream& is, char d = '\n'); @@ -122,7 +98,7 @@ namespace mrw { @param d the end of line delimiter @return @c s: the line read from the stream @return the stream after extraction of line - @pre #include + @pre \#include */ std::istream& getline(std::istream& is, std::string& s, char d = '\n'); diff --git a/mrw/style.css b/mrw/style.css index 174d69f..f2ac0f0 100644 --- a/mrw/style.css +++ b/mrw/style.css @@ -3,14 +3,41 @@ body,h1,h2,h3,h4,h5,h6,p,center,td,th,ul,dl,div { font-family: Geneva, Arial, Helvetica, sans-serif; } caption { font-weight: bold } -div.nav { - width: 100%; - background-color: #eeeeff; - border: 1px solid #b0b0b0; - text-align: center; - margin: 2px; - padding: 2px; - line-height: 140%; +@media screen { + /** navigation in old doxygen */ + div.nav { + width: 100%; + background-color: #eeeeff; + border: 1px solid #b0b0b0; + text-align: center; + margin: 2px; + padding: 2px; + line-height: 140%; + } + /** navigation in new doxygen (SuSE 10.0, 11.2005) */ + div.tabs { + width: 100%; + display: table; + background-color: #eeeeff; + border: 1px solid #b0b0b0; + text-align: center; + margin: 2px; + padding: 2px; + } + div.tabs ul { + display: table-row; + /*width: 100%;*/ + } + div.tabs ul li { + display: table-cell; + border: 1px solid #b0b0b0; + text-align: center; + } +} +@media print { + div.tabs, div.nav { + display: none; + } } /* a.el { text-decoration: none; font-weight: bold } diff --git a/mrw/tokenizer.hpp b/mrw/tokenizer.hpp index 2a8bec3..a9f28c4 100644 --- a/mrw/tokenizer.hpp +++ b/mrw/tokenizer.hpp @@ -8,20 +8,6 @@ @copy © Marc Wäckerlin @license LGPL, see file COPYING - $Log$ - Revision 1.4 2005/01/28 07:53:45 marc - Doc: added #include - - Revision 1.3 2004/12/20 13:24:26 marc - #ifndef forgotten - - Revision 1.2 2004/12/20 07:40:36 marc - documentation improved, new grouping - - Revision 1.1 2004/12/17 16:26:58 marc - initial version - - */ #ifndef __MRW__TOKENIZER_HPP__ #define __MRW__TOKENIZER_HPP__ @@ -36,7 +22,7 @@ namespace mrw { //@{ /** @defgroup regexptokenizer Tokenizer - @pre #include + @pre \#include There is a Tokenizer which splits strings according to a list of delimiters and allows to iterate over the individual tokens: diff --git a/mrw/unistd.hpp b/mrw/unistd.hpp index d3336c6..56402f7 100644 --- a/mrw/unistd.hpp +++ b/mrw/unistd.hpp @@ -9,6 +9,9 @@ @license LGPL, see file COPYING $Log$ + Revision 1.8 2005/11/29 12:39:43 marc + make it compilable with gcc 4.0.2 and newer doxygen + Revision 1.7 2004/12/18 20:58:19 marc pipes can be blocking, non blocking or blocking on one side only default is again blocking, because it causes less trouble @@ -49,7 +52,7 @@ namespace mrw { //@{ /** @brief class that implements an unnamed UNIX pipe - @pre #include + @pre \#include Implements a UNIX pipe that is automatically closed in destructor and offers some facilities. */ diff --git a/mrw/vector.hpp b/mrw/vector.hpp index 44eec48..20e2495 100644 --- a/mrw/vector.hpp +++ b/mrw/vector.hpp @@ -9,6 +9,9 @@ @license LGPL, see file COPYING $Log$ + Revision 1.4 2005/11/29 12:39:43 marc + make it compilable with gcc 4.0.2 and newer doxygen + Revision 1.3 2005/04/07 20:48:20 marc docu: new doxygen, new grouping @@ -43,7 +46,7 @@ @param l a vector of values @param o a value to be inserted into vector @c l - @pre #include + @pre \#include */ template std::vector& operator<<(std::vector& l, const T& o) throw(std::bad_exception) { @@ -67,7 +70,7 @@ std::vector& operator<<(std::vector& l, const T& o) throw(std::bad_e @note when something is extracted from a vector, it is removed from the vector, that means after every shift the vector is shortened by the shifted element - @pre #include + @pre \#include */ template std::vector& operator>>(std::vector& l, T& o) throw(std::exception) {