| 94 | } |
| 95 | |
| 96 | bool stringFindSubstitutions( const std::string &target, std::unordered_set< InternedString > &requestedAttributes ) |
| 97 | { |
| 98 | bool found = false; |
| 99 | boost::sregex_iterator matches( target.begin(), target.end(), attributeRegex(), boost::match_default ); |
| 100 | for( boost::sregex_iterator i = matches; i != boost::sregex_iterator(); i++ ) |
| 101 | { |
| 102 | found = true; |
| 103 | |
| 104 | // The one group in the expression gives us the token we're looking for |
| 105 | requestedAttributes.insert( InternedString( (*i)[1] ) ); |
| 106 | } |
| 107 | |
| 108 | // Strings with escaped substitutions don't require attributes, but we do need call |
| 109 | // stringApplySubstitutions on them so that the escape symbols get removed |
| 110 | if( target.find( "\\<" ) != string::npos ) |
| 111 | { |
| 112 | found = true; |
| 113 | } |
| 114 | if( target.find( "\\>" ) != string::npos ) |
| 115 | { |
| 116 | found = true; |
| 117 | } |
| 118 | return found; |
| 119 | } |
| 120 | |
| 121 | std::string stringApplySubstitutions( const std::string &target, const IECore::CompoundObject *attributes ) |
| 122 | { |
no test coverage detected