Changeset 26 for trunk/Classes/serialization/parser.cpp
- Timestamp:
- 2010-05-28 07:39:52 (2 years ago)
- File:
-
- 1 edited
-
trunk/Classes/serialization/parser.cpp (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Classes/serialization/parser.cpp
r4 r26 114 114 elements.push(element(&cfg_, "")); 115 115 116 leading_spaces_buffer.reserve(1024);117 value_buffer.reserve(10*1024);116 //leading_spaces_buffer.reserve(1024); 117 //value_buffer.reserve(10*1024); 118 118 119 119 do { … … 186 186 case token::STRING: // [element] 187 187 elname = tok_->current_token().value; 188 //elname.assign(tok_->current_token().value_ptr, tok_->current_token().value_size); 188 189 if (tok_->next_token().type != ']') 189 190 error(_("Unterminated [element] tag")); … … 199 200 error(_("Invalid tag name")); 200 201 elname = tok_->current_token().value; 202 //elname.assign(tok_->current_token().value_ptr, tok_->current_token().value_size); 201 203 if (tok_->next_token().type != ']') 202 204 error(_("Unterminated [+element] tag")); … … 218 220 error(_("Invalid closing tag name")); 219 221 elname = tok_->current_token().value; 222 //elname.assign(tok_->current_token().value_ptr, tok_->current_token().value_size); 220 223 if(tok_->next_token().type != ']') 221 224 error(_("Unterminated closing tag")); … … 251 254 variables.back() += ' '; 252 255 variables.back() += tok_->current_token().value; 256 //variables.back().append(tok_->current_token().value_ptr, tok_->current_token().value_size); 253 257 break; 254 258 case ',': … … 299 303 case token::QSTRING: 300 304 cfg[*curvar] += tok_->current_token().value; 305 /* 306 { 307 std::string tempStr = cfg[*curvar]; 308 tempStr.append(tok_->current_token().value_ptr, tok_->current_token().value_size); 309 cfg[*curvar] = tempStr; 310 } 311 */ 301 312 break; 302 313 default: 303 314 cfg[*curvar] += "_"; 304 315 cfg[*curvar] += tok_->current_token().value; 316 /* 317 { 318 std::string tempStr = cfg[*curvar] + "_"; 319 tempStr.append(tok_->current_token().value_ptr, tok_->current_token().value_size); 320 cfg[*curvar] = tempStr; 321 } 322 */ 305 323 break; 306 324 case token::END: … … 314 332 default: 315 333 cfg[*curvar] += tok_->current_token().leading_spaces + tok_->current_token().value; 334 /* 335 { 336 std::string tempStr = cfg[*curvar]; 337 //tempStr.append(tok_->current_token().leading_spaces_ptr, tok_->current_token().leading_spaces_size); 338 tempStr.append(tok_->current_token().value_ptr, tok_->current_token().value_size); 339 cfg[*curvar] = tempStr; 340 } 341 */ 316 342 break; 317 343 case token::QSTRING: 318 344 cfg[*curvar] += tok_->current_token().value; 345 /* 346 { 347 std::string tempStr = cfg[*curvar]; 348 tempStr.append(tok_->current_token().value_ptr, tok_->current_token().value_size); 349 cfg[*curvar] = tempStr; 350 } 351 */ 319 352 break; 320 353 case token::UNTERMINATED_QSTRING: … … 355 388 i18n_symbols["error"] = error_type; 356 389 i18n_symbols["value"] = tok_->current_token().value; 390 //i18n_symbols["value"].assign(tok_->current_token().value_ptr, tok_->current_token().value_size); 357 391 std::stringstream ss; 358 392 ss << tok_->get_start_line() << " " << tok_->get_file(); 359 393 #ifdef DEBUG 360 394 i18n_symbols["previous_value"] = tok_->previous_token().value; 395 //i18n_symbols["previous_value"].assign(tok_->previous_token().value_ptr, tok_->previous_token().value_size); 361 396 throw config::error( 362 397 lineno_string(i18n_symbols, ss.str(),
Note: See TracChangeset
for help on using the changeset viewer.