Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef RVNGSTRING_H
00022 #define RVNGSTRING_H
00023
00024 #include "librevenge-api.h"
00025
00026 namespace librevenge
00027 {
00028
00029 class RVNGStringImpl;
00030
00033 class REVENGE_API RVNGString
00034 {
00035 public:
00036 RVNGString();
00037 RVNGString(const RVNGString &other);
00038 RVNGString(const char *str);
00039 ~RVNGString();
00040
00048 static RVNGString escapeXML(const RVNGString &s);
00049
00057 static RVNGString escapeXML(const char *s);
00058
00059 const char *cstr() const;
00060
00065 int len() const;
00072 unsigned long size() const;
00073
00074 bool empty() const;
00075
00076 void sprintf(const char *format, ...) REVENGE_ATTRIBUTE_PRINTF(2, 3);
00077 void append(const RVNGString &s);
00078 void append(const char *s);
00079 void append(const char c);
00080
00085 void appendEscapedXML(const RVNGString &s);
00086
00091 void appendEscapedXML(const char *s);
00092
00093 void clear();
00094 RVNGString &operator=(const RVNGString &str);
00095 RVNGString &operator=(const char *s);
00096
00097
00098 bool operator==(const char *s) const;
00099 bool operator==(const RVNGString &str) const;
00100 inline bool operator!=(const char *s) const
00101 {
00102 return !operator==(s);
00103 }
00104 inline bool operator!=(const RVNGString &str) const
00105 {
00106 return !operator==(str);
00107 }
00108 bool operator<(const char *s) const;
00109 bool operator<(const RVNGString &str) const;
00110 inline bool operator<=(const char *s) const
00111 {
00112 return operator==(s) || operator<(s);
00113 }
00114 inline bool operator<=(const RVNGString &str) const
00115 {
00116 return operator==(str) || operator<(str);
00117 }
00118 inline bool operator>=(const char *s) const
00119 {
00120 return !operator<(s);
00121 }
00122 inline bool operator>=(const RVNGString &str) const
00123 {
00124 return !operator<(str);
00125 }
00126 inline bool operator>(const char *s) const
00127 {
00128 return !operator<=(s);
00129 }
00130 inline bool operator>(const RVNGString &str) const
00131 {
00132 return !operator<=(str);
00133 }
00134
00135 class REVENGE_API Iter
00136 {
00137 public:
00138 Iter(const RVNGString &str);
00139 virtual ~Iter();
00140 void rewind();
00141 bool next();
00142 bool last();
00143 const char *operator()() const;
00144 private:
00145 Iter(const Iter &);
00146 Iter &operator=(const Iter &);
00147 RVNGStringImpl *m_stringImpl;
00148 int m_pos;
00149 mutable char *m_curChar;
00150 };
00151
00152 private:
00153 RVNGStringImpl *m_stringImpl;
00154 };
00155
00156 }
00157
00158 #endif
00159