Data Overview

From reSIProcate
Revision as of 15:28, 2 June 2005 by Bryan (talk | contribs) (Added info on empty and size)
Jump to navigation Jump to search

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.