开发者

How to store an XML file content into a std::string or CString, at compilation time?

The XML contains symbols that the C++ may misinterpret (like the // in http://www.w3.org/2000/10/XMLSchema)

I am wondering if you know about clean ways to include some hard-coded XML into a std::strin开发者_StackOverflow中文版g or a CString, at compile time.

(in deed I'm trying to encode an .xsd file for validating some xml input, because I don't want to depend upon the presence or not of this xsd file, so I want it to be compiled in the binary)


const char* XML_STRING = "<?xml version=\"1.0\"?><Test></Test>";

std::string aTestXmlStr(XML_STRING);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜