Changeset 21404 in vbox for trunk/include/iprt
- Timestamp:
- Jul 8, 2009 3:19:42 PM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 49780
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/ministring_cpp.h
r21394 r21404 35 35 #include <iprt/string.h> 36 36 37 #include <new> 38 37 39 /** 38 40 * "ministring" is a small C++ string class that does not depend on anything … … 125 127 { 126 128 m_psz = (char*)RTMemRealloc(m_psz, cb); 129 #ifdef RT_EXCEPTIONS_ENABLED 130 if (!m_psz) 131 throw std::bad_alloc(); 132 #endif 127 133 m_cbAllocated = cb; 128 134 } … … 255 261 { 256 262 return length() == 0; 257 }258 259 /**260 * Returns true if no memory is currently allocated.261 * @return262 */263 bool isNull() const264 {265 return m_psz == NULL;266 263 } 267 264 … … 349 346 m_cbAllocated = m_cbLength + 1; 350 347 m_psz = (char*)RTMemAlloc(m_cbAllocated); 348 #ifdef RT_EXCEPTIONS_ENABLED 349 if (!m_psz) 350 throw std::bad_alloc(); 351 #endif 351 352 memcpy(m_psz, s.m_psz, m_cbAllocated); // include 0 terminator 352 353 } … … 374 375 m_cbAllocated = m_cbLength + 1; 375 376 m_psz = (char*)RTMemAlloc(m_cbAllocated); 377 #ifdef RT_EXCEPTIONS_ENABLED 378 if (!m_psz) 379 throw std::bad_alloc(); 380 #endif 376 381 memcpy(m_psz, pcsz, m_cbAllocated); // include 0 terminator 377 382 }
Note:
See TracChangeset
for help on using the changeset viewer.