For char * strings we manually manage stack buffers and allocated buffers, use strcpy(), memcpy(), strcat(), ... The udata.c code even uses a "tiny string" poor man's string "class", all written in C. Wouldn't it be nice if we could use STL string? StatusAs of ICU 4.6 Milestone 1 (4.5.1), the old CharString class has been turned into a minimalist but fully usable C++ char * string class for ICU-internal use. (The old CharString class only served for invariant-character conversion from UnicodeString to const char *.) See ticket 7496 and its commits. Old design ideaIt should be possible to define class icu_string : public UMemory, stl::basic_string<char, char_traits<char>, icu_allocator<char> > {}; Note:
Question: What should happen in an out-of-memory situation? The icu_allocator could
References
|
Design Docs > C++ >