MCPcopy Create free account
hub / github.com/Kistler-Group/sdbus-cpp / _raw_xml

Method _raw_xml

tools/xml2cpp-codegen/xml.cpp:126–165  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

124}
125
126void Node::_raw_xml(std::string& xml, int& depth) const
127{
128 xml.append(depth * 2, ' ');
129 xml.append("<" + name);
130
131 for (auto it = m_attrs.begin(), itEnd = m_attrs.end(); it != itEnd; ++it)
132 {
133 xml.append(" " + it->first + "=\"" + it->second + "\"");
134 }
135
136 if (cdata.length() == 0 && children.size() == 0)
137 {
138 xml.append("/>\n");
139 }
140 else
141 {
142 xml.append(">");
143
144 if (cdata.length())
145 {
146 xml.append(cdata);
147 }
148
149 if (children.size())
150 {
151 xml.append("\n");
152 ++depth;
153
154 for (auto it = children.begin(), itEnd = children.end(); it != itEnd; ++it)
155 {
156 it->_raw_xml(xml, depth);
157 }
158
159 --depth;
160 xml.append(depth * 2, ' ');
161 }
162
163 xml.append("</" + name + ">\n");
164 }
165}
166
167Document::Document() :
168 root(nullptr),

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected