Changeset 7413
- Timestamp:
- 2004-05-25T11:00:18+12:00 (20 years ago)
- Location:
- trunk/gsdl/src/mgpp/text
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/src/mgpp/text/UCArray.cpp
r3008 r7413 30 30 text.push_back (*cStr); 31 31 cStr++; 32 } 33 } 34 35 void SetCStr (UCArray &text, const char *cStr, size_t nSizeHint) { 36 text.erase(text.begin(), text.end()); 37 38 // reserve the needed space in advance 39 if (text.capacity() < nSizeHint + 1) { 40 text.reserve(nSizeHint + 1); 41 } 42 while (*cStr != '\0') { 43 text.push_back (*cStr); 44 ++cStr; 32 45 } 33 46 } -
trunk/gsdl/src/mgpp/text/UCArray.h
r3008 r7413 55 55 // functions to manipulate UCArrays 56 56 void SetCStr (UCArray &text, const char *cStr); 57 // same as SetCStr but first tries to allocate nSizeHint space (only if needed) 58 void SetCStr (UCArray &text, const char *cStr, size_t nSizeHint); 57 59 char * GetCStr(UCArray text); 58 60 inline void UCArrayClear (UCArray &a) {
Note:
See TracChangeset
for help on using the changeset viewer.