Changeset 19530 in vbox for trunk/include
- Timestamp:
- May 8, 2009 2:39:23 PM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 47074
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/xml.h
r19520 r19530 54 54 #endif 55 55 56 #include "VBox/com/string.h"57 58 56 /* 59 57 * Shut up MSVC complaining that auto_ptr[_ref] template instantiations (as a … … 92 90 { 93 91 92 // Little string class for XML only 93 ////////////////////////////////////////////////////////////////////////////// 94 95 class ministring 96 { 97 public: 98 ministring() 99 : m_psz(NULL) 100 { 101 } 102 103 ministring(const ministring &s) 104 : m_psz(NULL) 105 { 106 copyFrom(s.c_str()); 107 } 108 109 ministring(const char *pcsz) 110 : m_psz(NULL) 111 { 112 copyFrom(pcsz); 113 } 114 115 ~ministring() 116 { 117 cleanup(); 118 } 119 120 void operator=(const char *pcsz) 121 { 122 cleanup(); 123 copyFrom(pcsz); 124 } 125 126 void operator=(const ministring &s) 127 { 128 cleanup(); 129 copyFrom(s.c_str()); 130 } 131 132 const char* c_str() const 133 { 134 return m_psz; 135 } 136 137 private: 138 void cleanup() 139 { 140 if (m_psz) 141 { 142 RTStrFree(m_psz); 143 m_psz = NULL; 144 } 145 } 146 147 void copyFrom(const char *pcsz) 148 { 149 if (pcsz) 150 m_psz = RTStrDup(pcsz); 151 } 152 153 154 char *m_psz; 155 }; 156 94 157 // Exceptions 95 158 //////////////////////////////////////////////////////////////////////////////
Note:
See TracChangeset
for help on using the changeset viewer.