Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
cfx_xmlinstruction.cpp
Go to the documentation of this file.
1
// Copyright 2017 The PDFium Authors
2
// Use of this source code is governed by a BSD-style license that can be
3
// found in the LICENSE file.
4
5
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6
7
#
include
"core/fxcrt/xml/cfx_xmlinstruction.h"
8
9
#
include
"core/fxcrt/fx_codepage.h"
10
#
include
"core/fxcrt/fx_extension.h"
11
#
include
"core/fxcrt/xml/cfx_xmldocument.h"
12
13
CFX_XMLInstruction::
CFX_XMLInstruction
(
const
WideString
& wsTarget)
14
:
name_
(
wsTarget
) {}
15
16
CFX_XMLInstruction::~
CFX_XMLInstruction
() =
default
;
17
18
CFX_XMLNode
::
Type
CFX_XMLInstruction::
GetType
()
const
{
19
return
Type
::
kInstruction
;
20
}
21
22
CFX_XMLNode
* CFX_XMLInstruction::
Clone
(
CFX_XMLDocument
* doc) {
23
auto
* node = doc->CreateNode<CFX_XMLInstruction>(name_);
24
node->target_data_ = target_data_;
25
return
node;
26
}
27
28
void
CFX_XMLInstruction::
AppendData
(
const
WideString
& wsData) {
29
target_data_.push_back(wsData);
30
}
31
32
bool
CFX_XMLInstruction::
IsOriginalXFAVersion
()
const
{
33
return
name_.EqualsASCII(
"originalXFAVersion"
);
34
}
35
36
bool
CFX_XMLInstruction::
IsAcrobat
()
const
{
37
return
name_.EqualsASCII(
"acrobat"
);
38
}
39
40
void
CFX_XMLInstruction::
Save
(
41
const
RetainPtr
<
IFX_RetainableWriteStream
>& pXMLStream) {
42
if
(name_.EqualsASCIINoCase(
"xml"
)) {
43
pXMLStream->WriteString(
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
);
44
return
;
45
}
46
47
pXMLStream->WriteString(
"<?"
);
48
pXMLStream->WriteString(name_.ToUTF8().AsStringView());
49
pXMLStream->WriteString(
" "
);
50
51
for
(
const
WideString& target : target_data_) {
52
pXMLStream->WriteString(target.ToUTF8().AsStringView());
53
pXMLStream->WriteString(
" "
);
54
}
55
56
pXMLStream->WriteString(
"?>\n"
);
57
}
CFX_XMLDocument
Definition
cfx_xmldocument.h:17
CFX_XMLInstruction::AppendData
void AppendData(const WideString &wsData)
Definition
cfx_xmlinstruction.cpp:28
CFX_XMLInstruction::CFX_XMLInstruction
CFX_XMLInstruction(const WideString &wsTarget)
Definition
cfx_xmlinstruction.cpp:13
CFX_XMLInstruction::GetType
Type GetType() const override
Definition
cfx_xmlinstruction.cpp:18
CFX_XMLInstruction::IsAcrobat
bool IsAcrobat() const
Definition
cfx_xmlinstruction.cpp:36
CFX_XMLInstruction::IsOriginalXFAVersion
bool IsOriginalXFAVersion() const
Definition
cfx_xmlinstruction.cpp:32
CFX_XMLInstruction::Clone
CFX_XMLNode * Clone(CFX_XMLDocument *doc) override
Definition
cfx_xmlinstruction.cpp:22
CFX_XMLInstruction::~CFX_XMLInstruction
~CFX_XMLInstruction() override
CFX_XMLInstruction::Save
void Save(const RetainPtr< IFX_RetainableWriteStream > &pXMLStream) override
Definition
cfx_xmlinstruction.cpp:40
CFX_XMLNode
Definition
cfx_xmlnode.h:16
CFX_XMLNode::Type
Type
Definition
cfx_xmlnode.h:18
CFX_XMLNode::Type::kInstruction
@ kInstruction
Definition
cfx_xmlnode.h:19
IFX_RetainableWriteStream
Definition
fx_stream.h:43
fxcrt::RetainPtr
Definition
retain_ptr.h:28
WideString
fxcrt::WideString WideString
Definition
widestring.h:207
qtwebengine
src
3rdparty
chromium
third_party
pdfium
core
fxcrt
xml
cfx_xmlinstruction.cpp
Generated on
for Qt by
1.18.0