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

Function matchInternal

src/IECore/StringAlgo.cpp:66–106  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

64const InternedString g_ellipsisSubstitute( "!!!" );
65
66bool matchInternal(
67 vector<InternedString>::const_iterator pathBegin,
68 vector<InternedString>::const_iterator pathEnd,
69 StringAlgo::MatchPatternPath::const_iterator matchPathBegin,
70 StringAlgo::MatchPatternPath::const_iterator matchPathEnd
71)
72{
73 while( true )
74 {
75 if( matchPathBegin == matchPathEnd )
76 {
77 return pathBegin == pathEnd;
78 }
79 else if( *matchPathBegin == g_ellipsis )
80 {
81 auto nextMatchPathBegin = std::next( matchPathBegin );
82 if( nextMatchPathBegin == matchPathEnd )
83 {
84 return true;
85 }
86 for( auto pb = pathBegin; pb != pathEnd; ++pb )
87 {
88 if( matchInternal( pb, pathEnd, nextMatchPathBegin, matchPathEnd ) )
89 {
90 return true;
91 }
92 }
93 return false;
94 }
95 else if( pathBegin == pathEnd )
96 {
97 return false;
98 }
99 else if( !StringAlgo::match( *pathBegin, *matchPathBegin ) )
100 {
101 return false;
102 }
103 ++pathBegin;
104 ++matchPathBegin;
105 }
106}
107
108#if BOOST_VERSION > 105500
109

Callers 1

matchFunction · 0.85

Calls 1

matchFunction · 0.85

Tested by

no test coverage detected