Difference between revisions of "Data Overview"
Jump to navigation
Jump to search
Line 10: | Line 10: | ||
memory. Data::c_str() also returns a raw pointer to internal memory, | memory. Data::c_str() also returns a raw pointer to internal memory, | ||
but will guarantee that the internal buffer is null terminated, by | but will guarantee that the internal buffer is null terminated, by | ||
− | copying it if necessary. | + | copying it if necessary. |
+ | |||
+ | c_str() is generally necessary only when transitioning to another string representation, like char* or std::string. |
Revision as of 13:29, 15 November 2004
Data is resiprocate's string class. It is named Data rather than String for historical reasons. VOCAL had a reference counting version of Data. Resiprocate's version is not reference counting.
Data handles 8 bit character buffers.
Data is internally aware of its content length and is not guaranteed to be null terminated. Date::data() returns a raw pointer to internal memory. Data::c_str() also returns a raw pointer to internal memory, but will guarantee that the internal buffer is null terminated, by copying it if necessary.
c_str() is generally necessary only when transitioning to another string representation, like char* or std::string.