reinstate previous regex
This commit is contained in:
parent
a1ab2232f3
commit
363bf42b95
@ -76,22 +76,14 @@ inline void PrepareConfigFile(
|
|||||||
const boost::filesystem::path& path,
|
const boost::filesystem::path& path,
|
||||||
std::string& output
|
std::string& output
|
||||||
) {
|
) {
|
||||||
BOOST_ASSERT_MSG( output.empty(), "output string not empty");
|
|
||||||
std::ifstream config_stream( path.string().c_str() );
|
std::ifstream config_stream( path.string().c_str() );
|
||||||
std::string input_string(
|
std::string input_str(
|
||||||
(std::istreambuf_iterator<char>(config_stream)),
|
(std::istreambuf_iterator<char>(config_stream)),
|
||||||
std::istreambuf_iterator<char>()
|
std::istreambuf_iterator<char>()
|
||||||
);
|
);
|
||||||
boost::regex regex( "^([^=]*)" ); //match from start of line to '='
|
boost::regex regex( "^([^=]*)" ); //match from start of line to '='
|
||||||
std::string format( "\\L$1\\E" ); //replace with downcased substring
|
std::string format( "\\L$1\\E" ); //replace with downcased substring
|
||||||
|
output = boost::regex_replace( input_str, regex, format );
|
||||||
boost::regex_replace(
|
|
||||||
output.begin(),
|
|
||||||
input_string.begin(),
|
|
||||||
input_string.end(),
|
|
||||||
regex,
|
|
||||||
format
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user