std::string prefix;
std::string map( std::string line ) {
- if ( std::string( line, 0, 9 ) == "@TESTDIR=" )
- testdir = std::string( line, 9, line.length() - 10 ); // skip \n
- else if ( std::string( line, 0, 8 ) == "@PREFIX=" )
- prefix = std::string( line, 8, line.length() - 9 ); // skip \n
- else {
- size_t off;
- if (!testdir.empty())
- while ( (off = line.find( testdir )) != std::string::npos )
- line.replace( off, testdir.length(), "@TESTDIR@" );
-
- if (!prefix.empty())
- while ( (off = line.find( prefix )) != std::string::npos )
- line.replace( off, prefix.length(), "@PREFIX@" );
- }
return line;
}
};