00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #if !defined(_xyzzy_indent_hxx_)
00023 # define _xyzzy_indent_hxx_
00024
00025 #include <string>
00026
00027 namespace xyzzy
00028 {
00029 class TIndent
00030 {
00031 public:
00032 TIndent(int indentAmt = 4);
00033
00034 TIndent(const TIndent &s, bool indent = true);
00035
00036 operator const char*() const
00037 {
00038 return m_indent.c_str();
00039 }
00040
00041 private:
00042 static int st_indentAmt;
00043 static bool st_notUsedYet;
00044
00045 std::string m_indent;
00046 };
00047 };
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064 #define BEGIN_INDENT(_indent,_indentRef) \
00065 xyzzy::TIndent __indentSaved(_indentRef, false);\
00066 _indentRef = xyzzy::TIndent(__indentSaved); \
00067 const char *_indent = _indentRef
00068
00069 #define END_INDENT(_indentRef) _indentRef = xyzzy::TIndent(__indentSaved,false)
00070
00071 #endif //# define _xyzzy_indent_hxx_