MCPcopy Create free account
hub / github.com/ImageEngine/cortex / parse

Method parse

src/IECore/FrameList.cpp:80–112  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

78}
79
80FrameListPtr FrameList::parse( const std::string &frameList )
81{
82 std::string s;
83
84 /// Strip whitespace
85 for ( std::string::const_iterator it = frameList.begin(); it != frameList.end(); ++it )
86 {
87 if ( *it == ' ' || *it == '\n' || *it == '\r' || *it == '\n' )
88 {
89 continue;
90 }
91
92 s += *it;
93 }
94
95 /// Strip enclosing brackets
96 if ( s.size() >= 2 && s[0] == '(' && s[ s.size() - 1 ] == ')' )
97 {
98 s = s.substr( 1, s.size() - 2 );
99 }
100
101 ParserList *l = parserList();
102 for ( ParserList::const_iterator it = l->begin(); it != l->end(); ++it )
103 {
104 FrameListPtr f = (*it)( s );
105 if ( f )
106 {
107 return f;
108 }
109 }
110
111 throw Exception( ( boost::format( "\"%s\" does not define a valid frame list." ) % ( frameList ) ).str() );
112}
113
114bool FrameList::isEqualTo( ConstFrameListPtr other ) const
115{

Callers 15

testSerialiseAndParseMethod · 0.45
testParserMethod · 0.45
testParserMethod · 0.45
testMethod · 0.45
testFrameRangeMethod · 0.45
testParsingMethod · 0.45
testParsingMethod · 0.45
testParsingPrecedenceMethod · 0.45
testSerialiseAndParseMethod · 0.45

Calls 3

beginMethod · 0.45
endMethod · 0.45
sizeMethod · 0.45

Tested by 2

testSerialiseAndParseMethod · 0.36
testSerialiseAndParseMethod · 0.36