|
From: Markus S. <mar...@gm...> - 2006-12-19 10:27:41
|
On 12/13/06, Brodie Thiesfield <bro...@je...> wrote: > Is there any way that I can force the UnicodeString class to guarantee > that getBuffer(void) const method will always return a null-terminated > string (apart from when read-only aliased to a non-terminated string)? > It is difficult in some circumstances to use the getTerminatedBuffer() > call since it is non-const and I don't want to change the exposed > interface to be non-const. No, not without getTerminatedBuffer(). We would have to change a substantial portion of the implementation to guarantee that the buffer always contains a terminating NUL, if it's been written by UnicodeString itself. However, it could still wrap other buffers (with the aliasing constructors) that are not terminated, so there would not be a firm guarantee on the getBuffer() API anyway. markus |