MCPcopy Create free account
hub / github.com/RetroShare/RetroShare / convertFromString

Method convertFromString

plugins/FeedReader/util/XMLWrapper.cpp:143–163  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

141}
142
143bool XMLWrapper::convertFromString(const char *text, xmlChar *&xmlText)
144{
145 bool result = false;
146
147 xmlBufferPtr in = xmlBufferCreateStatic((void*) text, strlen(text));
148 xmlBufferPtr out = xmlBufferCreate();
149 int ret = xmlCharEncInFunc(mCharEncodingHandler, out, in);
150 if (ret >= 0) {
151 result = true;
152#if LIBXML_VERSION >= 20800
153 xmlText = xmlBufferDetach(out);
154#else
155 xmlText = xmlStrdup(xmlBufferContent(out));
156#endif
157 }
158
159 xmlBufferFree(in);
160 xmlBufferFree(out);
161
162 return result;
163}
164
165xmlDocPtr XMLWrapper::getDocument() const
166{

Callers 1

compileMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected