Fix the parsing string to tree.

This commit is contained in:
akl 2014-05-23 10:09:17 +04:00
parent 0fd903e83e
commit 48a0c1cf09

View File

@ -1024,16 +1024,16 @@ LevelsList parseWard( const std::string& theData, std::size_t& theCursor )
for( int level = 0; level < levelsListStr.size(); level++ ) { for( int level = 0; level < levelsListStr.size(); level++ ) {
std::cout<<" Level" << level + 1 << ":" << std::endl; std::cout<<" Level" << level + 1 << ":" << std::endl;
std::vector<std::string> namesListStr; std::vector<std::string> namesListStr;
ss.str( levelsListStr[level] ); std::stringstream ss1( levelsListStr[level] );
while ( std::getline( ss, substr, ',' ) ) { while ( std::getline( ss1, substr, ',' ) ) {
if ( !substr.empty() ) if ( !substr.empty() )
namesListStr.push_back( substr ); namesListStr.push_back( substr );
} }
LevelInfo levelInfoData; LevelInfo levelInfoData;
for( int node = 0; node < namesListStr.size(); node++ ) { for( int node = 0; node < namesListStr.size(); node++ ) {
std::vector<std::string> linksListStr; std::vector<std::string> linksListStr;
ss.str( namesListStr[node] ); std::stringstream ss2( namesListStr[node] );
while ( std::getline( ss, substr, '_' ) ) { while ( std::getline( ss2, substr, '_' ) ) {
if ( !substr.empty() ) if ( !substr.empty() )
linksListStr.push_back( substr ); linksListStr.push_back( substr );
} }