本文整理汇总了C++中ClassList::last方法的典型用法代码示例。如果您正苦于以下问题:C++ ClassList::last方法的具体用法?C++ ClassList::last怎么用?C++ ClassList::last使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ClassList
的用法示例。
在下文中一共展示了ClassList::last方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: execute_line
int NerveTool::execute_line( String& s , FILE *sout , ClassList<Nerve>& nn ) {
if( s.startsFrom( "<img" ) )
return( execute_img( s , sout , 0 , nn ) );
// parse string
int level = s.find( "*" );
if( level < 0 )
return( 1 );
if( level < 2 )
return( 13 );
s.remove( 0 , level + 1 );
level -= 2;
if( nn.count() > 0 ) {
Nerve *np = nn.last();
if( np -> level < level )
if( level != np -> level + 1 )
return( 14 );
}
s.trim();
if( s.startsFrom( "<img" ) )
return( execute_img( s , sout , level , nn ) );
if( !s.startsFrom( "*" ) )
return( 2 );
s.remove( 0 , 1 );
// name
int idx = s.find( "*" );
if( idx < 0 )
return( 3 );
String name = s.getMid( 0 , idx );
s.remove( 0 , idx + 1 );
// synonyms
String synonyms;
if( s.startsFrom( " (" ) ) {
s.remove( 0 , 2 );
idx = s.find( ")" );
if( idx < 0 )
return( 4 );
synonyms = s.getMid( 0 , idx );
s.remove( 0 , idx + 1 );
}
String origin;
String branches;
String distribution;
String modality;
String fibers;
if( s.startsFrom( "; " ) ) {
s.remove( 0 , 2 );
if( !extract_item( sout , origin , s , "ORIGIN" ) )
return( 6 );
if( !extract_item( sout , branches , s , "BRANCHES" ) )
return( 8 );
if( !extract_item( sout , distribution , s , "DISTRIBUTION" ) )
return( 7 );
if( !extract_item( sout , modality , s , "MODALITY" ) )
return( 9 );
if( !extract_item( sout , fibers , s , "FIBERS" ) )
return( 10 );
}
if( !s.isEmpty() )
return( 11 );
Nerve *n = new Nerve;
n -> fibers = fibers;
String fibersinfo;
if( !fibers.isEmpty() )
if( !extract_fibers( sout , n -> fibersinfo , fibers ) ) {
fprintf( sout , "wrong fibers=%s\n" , ( const char * )fibers );
delete n;
return( 12 );
}
n -> name = name;
n -> synonyms = synonyms;
n -> level = level;
n -> origin = origin;
n -> branches = branches;
n -> distribution = distribution;
n -> modality = modality;
nn.add( n );
return( 0 );
}