Difference between revisions of "Data Overview"
m (Added info on empty and size) |
|||
Line 13: | Line 13: | ||
c_str() is generally necessary only when transitioning to another string representation, like char* or std::string. | c_str() is generally necessary only when transitioning to another string representation, like char* or std::string. | ||
+ | |||
+ | Data::empty() returns true if the Data is empty, and false otherwise. Data::size() returns a size_type with the length of the data. |
Revision as of 15:28, 2 June 2005
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.
Data::empty() returns true if the Data is empty, and false otherwise. Data::size() returns a size_type with the length of the data.