Advertisement
Guest User

Untitled

a guest
Aug 4th, 2015
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. tag = value
  2. tag2 = value2
  3. tag3 = value3
  4.  
  5. tag = value
  6. value continuation
  7. tag2 = value2
  8. value continuation2
  9. # comment for tag3
  10. tag3 = value3
  11.  
  12. tag : "valuenvalue continuation"
  13. tag2 : "value2nvalue continuation2"
  14. tag3 : "value3"
  15.  
  16. while( std::getline( istr, line ) )
  17. {
  18. ++lineCount;
  19. if( line[0] == '#' )
  20. currentComment.push_back( line );
  21. else if( isspace( line[0]) || line[0] == '' )
  22. currentComment.clear( );
  23. else
  24. {
  25. auto tag = Utils::string::splitString( line, '=' );
  26. if( tag.size() != 2 || line[line.size() - 1] == '=')
  27. {
  28. std::cerr << "Wrong tag syntax in line #" << lineCount << std::endl;
  29. return nullptr;
  30. }
  31. tagLines.push_back( line );
  32. currentComment.clear( );
  33. }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement