Rapicorn - Experimental UI Toolkit - Source Code 10.08.1
rapicorndebugtools.hh
Go to the documentation of this file.
00001 /* Copyright (C) 2009 Tim Janik
00002  * GNU LGPL v3 or later: http://www.gnu.org/licenses/lgpl.html
00003  */
00004 #ifndef __RAPICORN_DEBUG_TOOLS_HH__
00005 #define __RAPICORN_DEBUG_TOOLS_HH__
00006 
00007 #include <rcore/utilities.hh>
00008 
00009 namespace Rapicorn {
00010 
00011 /* --- test dump --- */
00012 class TestStream : protected NonCopyable {
00013 public:
00014   typedef enum { TEXT, NODE, VALUE, INTERN, INDENT, POPNODE, POPINDENT } Kind;
00015 protected:
00016   /*Con*/       TestStream              ();
00017   virtual void  ddump                   (Kind kind, const String &name, const String &val) = 0;
00018 public:
00019   virtual      ~TestStream              ();
00020   void          dump                    (const String &text) { ddump (TEXT, "", text); }
00021   template<typename Value>
00022   void          dump                    (const String &name, Value v) { ddump (VALUE, name, string_from_type (v)); }
00023   template<typename Value>
00024   void          dump_intern             (const String &name, Value v) { ddump (INTERN, name, string_from_type (v)); }
00025   void          push_node               (const String &name) { ddump (NODE, name, ""); }
00026   void          pop_node                ()     { ddump (POPNODE, "", ""); }
00027   void          push_indent             (void) { ddump (INDENT, "", ""); }
00028   void          pop_indent              (void) { ddump (POPINDENT, "", ""); }
00029   virtual void  filter_matched_nodes    (const String &matchpattern) = 0;
00030   virtual void  filter_unmatched_nodes  (const String &matchpattern) = 0;
00031   virtual String string                 () = 0;
00032   static
00033   TestStream*   create_test_stream      ();
00034 };
00035 
00036 } // Rapicorn
00037 
00038 #endif /* __RAPICORN_DEBUG_TOOLS_HH__ */
00039 /* vim:set ts=8 sts=2 sw=2: */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines