我想從std::istream
加載TinyXml的文件,但它不包含這樣的方法:如何從`std :: istream`加載XML文檔?
/** Load a file using the current document value.
Returns true if successful. Will delete any existing
document data before loading.
*/
bool LoadFile(TiXmlEncoding encoding = TIXML_DEFAULT_ENCODING);
/// Save a file using the current document value. Returns true if successful.
bool SaveFile() const;
/// Load a file using the given filename. Returns true if successful.
bool LoadFile(const char * filename, TiXmlEncoding encoding = TIXML_DEFAULT_ENCODING);
/// Save a file using the given filename. Returns true if successful.
bool SaveFile(const char * filename) const;
/** Load a file using the given FILE*. Returns true if successful. Note that this method
doesn't stream - the entire object pointed at by the FILE*
will be interpreted as an XML file. TinyXML doesn't stream in XML from the current
file location. Streaming may be added in the future.
*/
bool LoadFile(FILE*, TiXmlEncoding encoding = TIXML_DEFAULT_ENCODING);
我看到它包含使用FILE
功能,是有可能std::istream
轉換爲FILE
?
否,至少不以任何標準方式。然而,將FILE轉換爲istream是可行的嗎? – john