Changeset 11008 for code/branches/cpp11_v2/src/libraries/util/SubString.cc
- Timestamp:
- Dec 31, 2015, 1:04:04 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/cpp11_v2/src/libraries/util/SubString.cc
r10918 r11008 265 265 bool inSafemode = false; 266 266 267 if(start_state != S L_NORMAL && tokens.size() > 0)267 if(start_state != SPLIT_LINE_STATE::NORMAL && tokens.size() > 0) 268 268 { 269 269 token = tokens[tokens.size()-1]; 270 270 tokens.pop_back(); 271 271 } 272 if(start_state != S L_NORMAL && bTokenInSafemode.size() > 0)272 if(start_state != SPLIT_LINE_STATE::NORMAL && bTokenInSafemode.size() > 0) 273 273 { 274 274 inSafemode = bTokenInSafemode[bTokenInSafemode.size()-1]; … … 280 280 switch(state) 281 281 { 282 case S L_NORMAL:282 case SPLIT_LINE_STATE::NORMAL: 283 283 if(line[i] == escapeChar) 284 284 { 285 state = S L_ESCAPE;285 state = SPLIT_LINE_STATE::ESCAPE; 286 286 if (!bRemoveEscapeChar) 287 287 token += line[i]; … … 290 290 else if(line[i] == safemodeChar) 291 291 { 292 state = S L_SAFEMODE;292 state = SPLIT_LINE_STATE::SAFEMODE; 293 293 inSafemode = true; 294 294 if (!bRemoveSafemodeChar) … … 298 298 else if(line[i] == openparenthesisChar) 299 299 { 300 state = S L_PARENTHESES;300 state = SPLIT_LINE_STATE::PARENTHESES; 301 301 inSafemode = true; 302 302 if (!bRemoveParenthesisChars) … … 318 318 } 319 319 token += line[i]; // EAT 320 state = S L_COMMENT;320 state = SPLIT_LINE_STATE::COMMENT; 321 321 } 322 322 else if(delimiters.find(line[i]) != std::string::npos) … … 334 334 inSafemode = false; 335 335 } 336 state = S L_NORMAL;336 state = SPLIT_LINE_STATE::NORMAL; 337 337 } 338 338 else … … 353 353 } 354 354 break; 355 case S L_ESCAPE:355 case SPLIT_LINE_STATE::ESCAPE: 356 356 if (!bRemoveSafemodeChar) 357 357 token += line[i]; … … 368 368 else token += line[i]; // EAT 369 369 } 370 state = S L_NORMAL;371 break; 372 case S L_SAFEMODE:370 state = SPLIT_LINE_STATE::NORMAL; 371 break; 372 case SPLIT_LINE_STATE::SAFEMODE: 373 373 if(line[i] == safemodeChar) 374 374 { 375 state = S L_NORMAL;375 state = SPLIT_LINE_STATE::NORMAL; 376 376 if (!bRemoveSafemodeChar) 377 377 token += line[i]; … … 379 379 else if(line[i] == escapeChar) 380 380 { 381 state = S L_SAFEESCAPE;381 state = SPLIT_LINE_STATE::SAFEESCAPE; 382 382 } 383 383 else … … 387 387 break; 388 388 389 case S L_SAFEESCAPE:389 case SPLIT_LINE_STATE::SAFEESCAPE: 390 390 if(line[i] == 'n') token += '\n'; 391 391 else if(line[i] == 't') token += '\t'; … … 397 397 else if(line[i] == '?') token += '\?'; 398 398 else token += line[i]; // EAT 399 state = S L_SAFEMODE;400 break; 401 402 case S L_PARENTHESES:399 state = SPLIT_LINE_STATE::SAFEMODE; 400 break; 401 402 case SPLIT_LINE_STATE::PARENTHESES: 403 403 if(line[i] == closeparenthesisChar) 404 404 { 405 state = S L_NORMAL;405 state = SPLIT_LINE_STATE::NORMAL; 406 406 if (!bRemoveParenthesisChars) 407 407 token += line[i]; … … 409 409 else if(line[i] == escapeChar) 410 410 { 411 state = S L_PARENTHESESESCAPE;411 state = SPLIT_LINE_STATE::PARENTHESESESCAPE; 412 412 } 413 413 else … … 417 417 break; 418 418 419 case S L_PARENTHESESESCAPE:419 case SPLIT_LINE_STATE::PARENTHESESESCAPE: 420 420 if(line[i] == 'n') token += '\n'; 421 421 else if(line[i] == 't') token += '\t'; … … 427 427 else if(line[i] == '?') token += '\?'; 428 428 else token += line[i]; // EAT 429 state = S L_PARENTHESES;430 break; 431 432 case S L_COMMENT:429 state = SPLIT_LINE_STATE::PARENTHESES; 430 break; 431 432 case SPLIT_LINE_STATE::COMMENT: 433 433 if(line[i] == '\n') 434 434 { … … 441 441 inSafemode = false; 442 442 } 443 state = S L_NORMAL;443 state = SPLIT_LINE_STATE::NORMAL; 444 444 } 445 445 else
Note: See TracChangeset
for help on using the changeset viewer.