Ignore:
Timestamp:
2010-05-28 07:39:52 (2 years ago)
Author:
kpoole
Message:

Episode 5

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Classes/serialization/parser.cpp

    r4 r26  
    114114    elements.push(element(&cfg_, "")); 
    115115     
    116     leading_spaces_buffer.reserve(1024); 
    117     value_buffer.reserve(10*1024); 
     116    //leading_spaces_buffer.reserve(1024); 
     117    //value_buffer.reserve(10*1024); 
    118118 
    119119    do { 
     
    186186    case token::STRING: // [element] 
    187187        elname = tok_->current_token().value; 
     188        //elname.assign(tok_->current_token().value_ptr, tok_->current_token().value_size); 
    188189        if (tok_->next_token().type != ']') 
    189190            error(_("Unterminated [element] tag")); 
     
    199200            error(_("Invalid tag name")); 
    200201        elname = tok_->current_token().value; 
     202        //elname.assign(tok_->current_token().value_ptr, tok_->current_token().value_size); 
    201203        if (tok_->next_token().type != ']') 
    202204            error(_("Unterminated [+element] tag")); 
     
    218220            error(_("Invalid closing tag name")); 
    219221        elname = tok_->current_token().value; 
     222        //elname.assign(tok_->current_token().value_ptr, tok_->current_token().value_size); 
    220223        if(tok_->next_token().type != ']') 
    221224            error(_("Unterminated closing tag")); 
     
    251254                variables.back() += ' '; 
    252255            variables.back() += tok_->current_token().value; 
     256            //variables.back().append(tok_->current_token().value_ptr, tok_->current_token().value_size); 
    253257            break; 
    254258        case ',': 
     
    299303            case token::QSTRING: 
    300304                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                 */ 
    301312                break; 
    302313            default: 
    303314                cfg[*curvar] += "_"; 
    304315                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                     */ 
    305323                break; 
    306324            case token::END: 
     
    314332        default: 
    315333            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                 */ 
    316342            break; 
    317343        case token::QSTRING: 
    318344            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                 */ 
    319352            break; 
    320353        case token::UNTERMINATED_QSTRING: 
     
    355388    i18n_symbols["error"] = error_type; 
    356389    i18n_symbols["value"] = tok_->current_token().value; 
     390    //i18n_symbols["value"].assign(tok_->current_token().value_ptr, tok_->current_token().value_size); 
    357391    std::stringstream ss; 
    358392    ss << tok_->get_start_line() << " " << tok_->get_file(); 
    359393#ifdef DEBUG 
    360394    i18n_symbols["previous_value"] = tok_->previous_token().value; 
     395    //i18n_symbols["previous_value"].assign(tok_->previous_token().value_ptr, tok_->previous_token().value_size); 
    361396    throw config::error( 
    362397        lineno_string(i18n_symbols, ss.str(), 
Note: See TracChangeset for help on using the changeset viewer.