25 const size_t l = strlen(str);
32 char *current = &data[start];
46 while(data[count+
offset]) {
83 if (available>=strlen(str)) {
85 char *dest = &data[
offset];
116 const std::string text(str);
118 std::string::size_type start_p = 0;
119 std::string::size_type end_p = 0;
121 while(start_p < text.size()) {
123 if (end_p == std::string::npos) {
124 end_p = text.length();
126 std::string extract = text.substr(start_p, end_p - start_p);
127 if(extract.size() > 0) {
128 vector.push_back(extract);
147 str_vector::const_iterator pos;
148 std::ostringstream stream;
149 for(pos=vect.begin();pos!=vect.end();pos++) {
150 if (vect.begin()!=pos) {
184 const std::string text(str);
185 std::string::size_type start_p = 0;
186 std::string::size_type end_p = 0;
188 while(start_p < text.size()) {
190 if (end_p == std::string::npos) {
191 end_p = text.length();
193 const std::string entry(text.substr(start_p, end_p - start_p));
194 const std::string::size_type entrySize = entry.size();
197 if(separator_p != std::string::npos) {
198 if((separator_p + 1) < entrySize) {
199 map[entry.substr(0, separator_p)] = entry.substr(separator_p + 1);
201 map[entry.substr(0, separator_p)] =
"";
223 str_map::const_iterator pos;
224 std::ostringstream stream;
225 for(pos=map.begin();pos!=map.end();pos++) {
226 if (map.begin()!=pos) {
229 stream << (pos->first);
231 stream << (pos->second);
#define ERS_RANGE_CHECK(min, val, max)
#define ERS_PRECONDITION(expression)
virtual char * string_area_write()=0
write pointer for the string area
std::map< std::string, std::string > str_map
virtual size_t string_area_size() const =0
size of the string area
size_t clear(offset_t offset)
const char * get_string(offset_t offset) const
virtual offset_t last_string() const =0
offset of the end of the last string
static const char STRING_SEPARATOR
character used to separate strings (i.e., to tokenize strings in vectors)
static const char MAP_ENTRY_SEPARATOR
character used to separate map entries
str_vector get_vector(offset_t offset) const
offset_t insert(offset_t offset, const char *str)
str_map get_map(offset_t offset) const
offset_t add(const char *str)
std::vector< std::string > str_vector
virtual const char * string_area_read() const =0
read pointer for the string area