Changeset 21428 in vbox for trunk/src/VBox/Runtime
- Timestamp:
- Jul 9, 2009 11:11:11 AM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 49816
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r3/xml.cpp
r21409 r21428 168 168 { 169 169 Data() 170 : fileName (NULL), handle (NIL_RTFILE), opened (false) {} 171 172 char *fileName; 170 : handle(NIL_RTFILE), opened(false) 171 { } 172 173 iprt::MiniString strFileName; 173 174 RTFILE handle; 174 175 bool opened : 1; … … 176 177 177 178 File::File(Mode aMode, const char *aFileName) 178 : m (new Data()) 179 { 180 m->fileName = RTStrDup (aFileName); 181 if (m->fileName == NULL) 182 throw ENoMemory(); 179 : m(new Data()) 180 { 181 m->strFileName = aFileName; 183 182 184 183 unsigned flags = 0; … … 205 204 } 206 205 207 File::File 208 : m 206 File::File(RTFILE aHandle, const char *aFileName /* = NULL */) 207 : m(new Data()) 209 208 { 210 209 if (aHandle == NIL_RTFILE) … … 214 213 215 214 if (aFileName) 216 { 217 m->fileName = RTStrDup (aFileName); 218 if (m->fileName == NULL) 219 throw ENoMemory(); 220 } 215 m->strFileName = aFileName; 221 216 222 217 setPos (0); … … 226 221 { 227 222 if (m->opened) 228 RTFileClose (m->handle); 229 230 RTStrFree (m->fileName); 231 } 232 233 const char *File::uri() const 234 { 235 return m->fileName; 223 RTFileClose(m->handle); 224 } 225 226 const char* File::uri() const 227 { 228 return m->strFileName.c_str(); 236 229 } 237 230 … … 796 789 if (!(plibNode = xmlNewNode(NULL, // namespace 797 790 (const xmlChar*)pcszElementName))) 798 throw ENoMemory();791 throw std::bad_alloc(); 799 792 xmlAddChild(m->plibNode, plibNode); 800 793 … … 823 816 xmlNode *plibNode; 824 817 if (!(plibNode = xmlNewText((const xmlChar*)pcszContent))) 825 throw ENoMemory();818 throw std::bad_alloc(); 826 819 xmlAddChild(m->plibNode, plibNode); 827 820 … … 1046 1039 if (!(plibRootNode = xmlNewNode(NULL, // namespace 1047 1040 (const xmlChar*)pcszRootElementName))) 1048 throw ENoMemory();1041 throw std::bad_alloc(); 1049 1042 xmlDocSetRootElement(m->plibDocument, plibRootNode); 1050 1043 … … 1067 1060 m_ctxt = xmlNewParserCtxt(); 1068 1061 if (m_ctxt == NULL) 1069 throw ENoMemory();1062 throw std::bad_alloc(); 1070 1063 } 1071 1064 … … 1090 1083 { 1091 1084 if (!(ctxt = xmlNewParserCtxt())) 1092 throw xml::ENoMemory();1085 throw std::bad_alloc(); 1093 1086 } 1094 1087
Note:
See TracChangeset
for help on using the changeset viewer.