I have an html source file which I use to edit and test with an html editor. For my purposes I would like to include this file in my C++11 source code by instantiating a std::string
containing the html file content as it is.
For now, I am using the following way, which is not ideal as it require an unwanted modification to the html source code, as shown below:
std::string my_html =
#include "my.html"
;
where my.html
contains something like:
R"(
<!DOCTYPE html>
<html>
</html>
)"
Note the R"(
and )"
tokens. They are there for the only purpose of allowing the C+11 std::string
to be instantiated by the compiler.
Of course, those tokens make my html source code non-html compliant. I'd like to have them removed from the html source, yet be able to instantiate the string in some other way.
Do you know any solution? I prefer standard solutions to pre-processor tricks. However, a pre-processor help is okay in the only case the are no standard solutions.