Exemplo n.º 1
0
void Csap::SaveToFile(const string_type& fileName, bool prettyPrint, const string_type& encoding)
{
	std::vector<unsigned char> result;
    string_type sTmpEnc( encoding);
    std::transform( sTmpEnc.begin(), sTmpEnc.end(), sTmpEnc.begin(), _totupper);
	XercesTreeOperations::SaveDocument(GetDocumentNode(), fileName, prettyPrint, encoding, _tcscmp(sTmpEnc.c_str(), _T("UTF-16BE")) == 0, _tcscmp(sTmpEnc.c_str(), _T("UTF-16")) == 0);
}
Exemplo n.º 2
0
bool wxXmlDocument::Save(wxOutputStream& stream, int indentstep) const
{
    if ( !IsOk() )
        return false;

    wxScopedPtr<wxMBConv> convMem, convFile;

#if wxUSE_UNICODE
    convFile.reset(new wxCSConv(GetFileEncoding()));
#else
    if ( GetFileEncoding().CmpNoCase(GetEncoding()) != 0 )
    {
        convFile.reset(new wxCSConv(GetFileEncoding()));
        convMem.reset(new wxCSConv(GetEncoding()));
    }
    //else: file and in-memory encodings are the same, no conversion needed
#endif

    wxString dec = wxString::Format(
                                    wxS("<?xml version=\"%s\" encoding=\"%s\"?>\n"),
                                    GetVersion(), GetFileEncoding()
                                   );
    bool rc = OutputString(stream, dec, convMem.get(), convFile.get());

    wxXmlNode *node = GetDocumentNode();
    if ( node )
        node = node->GetChildren();

    while( rc && node )
    {
        rc = OutputNode(stream, node, 0, convMem.get(),
                        convFile.get(), indentstep) &&
             OutputString(stream, wxS("\n"), convMem.get(), convFile.get());
        node = node->GetNext();
    }
    return rc;
}
Exemplo n.º 3
0
void Csap::DestroyDocument()
{
	XercesTreeOperations::DocumentType doc = GetDocumentNode();
	XercesTreeOperations::FreeDocument(doc);
	m_node = 0;
}
Exemplo n.º 4
0
string_type Csap::SaveToString(bool prettyPrint)
{
	return XercesTreeOperations::SaveXml(GetDocumentNode(), prettyPrint);
}
Exemplo n.º 5
0
void Csap::SaveToFile(const string_type& fileName, bool prettyPrint, const string_type& encoding, bool bBigEndian, bool bBOM)
{
	XercesTreeOperations::SaveDocument(GetDocumentNode(), fileName, prettyPrint, encoding, bBigEndian, bBOM);
}
Exemplo n.º 6
0
void Csap::SaveToFile(const string_type& fileName, bool prettyPrint)
{
	XercesTreeOperations::SaveDocument(GetDocumentNode(), fileName, prettyPrint, _T("UTF-8"), false, false);
}
Exemplo n.º 7
0
void CLocalHtmlFile::ExtractImages(CStringList &list) {
	LOG0(3, "CLocalHtmlFile::ExtractImages()");

	ExtractImages(GetDocumentNode(), list);
}
Exemplo n.º 8
0
void CLocalHtmlFile::TranslateForOffline() {
	LOG0(3, "CLocalHtmlFile::TranslateForOffline()");

	TranslateForOffline(GetDocumentNode());
}
Exemplo n.º 9
0
void CLocalHtmlFile::RewriteRelativeUrls() {
	LOG0(3, "CLocalHtmlFile::RewriteRelativeUrls()");

	RewriteRelativeUrls(GetDocumentNode());
}
Exemplo n.º 10
0
void CLocalHtmlFile::Filter() {
	LOG0(3, "CLocalHtmlFile::Filter()");

	FixTree(GetDocumentNode());
	Filter(GetDocumentNode());
}