问题描述
我正在使用Rapidxml在C ++应用程序中生成XML:
xml_document<> doc;
xml_node<>* dec1 = doc.allocate_node(node_declaration);
dec1->append_attribute(doc.allocate_attribute("version","1.0"));
dec1->append_attribute(doc.allocate_attribute("encoding","utf-8"));
doc.append_node(dec1);
. . .
我将此XML转换为字符串:
std::string *s;
s = new std::string;
print(std::back_inserter(*s),doc,0);
然后我将其作为字节数组发送到设备。
我看到换行符使用字符0x0A = 10 =“ LF(新行)” 并在缩进的行中放置字符0x09 =“水平制表符”。
我需要用它代替:
- 在行中中断字符0x0D 0x0A = 13 10 = CR(返回护理)+ LF(换行)。
- 每个选项卡的缩进行的开头两个空格(0x20 0x20 = 32 32)。
是否可以配置Rapidxml以这种方式进行?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)