paip.c++ tree parse tpath解析器

paip.c++ tree parse tpath解析器


作者Attilax ,  EMAIL:1466519819@qq.com
来源:attilax的专栏
地址:http://blog.csdn.net/attilax

主要算法:L

string Lastpath="";
 string lastname="";
 string curpath="";
 string curname="";
 string parentpath=""    ;
 
 while(getline(file,temp))
{
if(curlevel> lastlevel )
   {
   // curpath=   Lastpath+   "/"+curname;
  parentpath=Lastpath;
   }
    else if(curlevel< lastlevel )
   {
   parentpath= getLevelReduceNodeparentpath( Lastpath,curlevel);
   }
  
    if( parentpath=="")
      curpath= curname;
   else
    curpath=   parentpath+   "/"+curname;
   
   
 //set last info  
   Lastpath=curpath;
   lastname=curname;
   lastlevel=curlevel;

 i++;
 if(i>=line)
       break;
  
}
return     curpath;
 

原文地址:https://www.cnblogs.com/attilax/p/15199478.html