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
cxfa_arraynodelist.cpp
Go to the documentation of this file.
1
// Copyright 2016 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
"xfa/fxfa/parser/cxfa_arraynodelist.h"
8
9
#
include
<
utility
>
10
#
include
<
vector
>
11
12
#
include
"fxjs/gc/container_trace.h"
13
#
include
"xfa/fxfa/parser/cxfa_node.h"
14
15
CXFA_ArrayNodeList::CXFA_ArrayNodeList(CXFA_Document* pDocument)
16
:
CXFA_TreeList
(
pDocument
)
{}
17
18
CXFA_ArrayNodeList::~
CXFA_ArrayNodeList
() =
default
;
19
20
void
CXFA_ArrayNodeList::
Trace
(
cppgc
::Visitor* visitor)
const
{
21
CXFA_TreeList
::
Trace
(visitor);
22
ContainerTrace(visitor, m_array);
23
}
24
25
void
CXFA_ArrayNodeList::
SetArrayNodeList
(
26
const
std::vector<CXFA_Node*>& srcArray) {
27
if
(!srcArray.empty()) {
28
m_array =
29
std::vector<cppgc::Member<CXFA_Node>>(srcArray.begin(), srcArray.end());
30
}
31
}
32
33
size_t
CXFA_ArrayNodeList::
GetLength
() {
34
return
m_array.size();
35
}
36
37
bool
CXFA_ArrayNodeList::
Append
(
CXFA_Node
* pNode) {
38
m_array.push_back(pNode);
39
return
true
;
40
}
41
42
bool
CXFA_ArrayNodeList::
Insert
(
CXFA_Node
* pNewNode,
CXFA_Node
* pBeforeNode) {
43
if
(!pBeforeNode) {
44
m_array.push_back(pNewNode);
45
return
true
;
46
}
47
48
auto
it =
std
::find(m_array.begin(), m_array.end(), pBeforeNode);
49
if
(it == m_array.end())
50
return
false
;
51
52
m_array.insert(it, pNewNode);
53
return
true
;
54
}
55
56
void
CXFA_ArrayNodeList::
Remove
(
CXFA_Node
* pNode) {
57
auto
it =
std
::find(m_array.begin(), m_array.end(), pNode);
58
if
(it != m_array.end())
59
m_array.erase(it);
60
}
61
62
CXFA_Node
* CXFA_ArrayNodeList::
Item
(size_t index) {
63
return
index < m_array.size() ? m_array[index] :
nullptr
;
64
}
CXFA_ArrayNodeList::GetLength
size_t GetLength() override
Definition
cxfa_arraynodelist.cpp:33
CXFA_ArrayNodeList::Item
CXFA_Node * Item(size_t iIndex) override
Definition
cxfa_arraynodelist.cpp:62
CXFA_ArrayNodeList::~CXFA_ArrayNodeList
~CXFA_ArrayNodeList() override
CXFA_ArrayNodeList::Append
bool Append(CXFA_Node *pNode) override
Definition
cxfa_arraynodelist.cpp:37
CXFA_ArrayNodeList::SetArrayNodeList
void SetArrayNodeList(const std::vector< CXFA_Node * > &srcArray)
Definition
cxfa_arraynodelist.cpp:25
CXFA_ArrayNodeList::Remove
void Remove(CXFA_Node *pNode) override
Definition
cxfa_arraynodelist.cpp:56
CXFA_ArrayNodeList::Trace
void Trace(cppgc::Visitor *visitor) const override
Definition
cxfa_arraynodelist.cpp:20
CXFA_ArrayNodeList::Insert
bool Insert(CXFA_Node *pNewNode, CXFA_Node *pBeforeNode) override
Definition
cxfa_arraynodelist.cpp:42
CXFA_Node
Definition
cxfa_node.h:94
CXFA_Object::Trace
virtual void Trace(cppgc::Visitor *visitor) const
Definition
cxfa_object.cpp:33
CXFA_TreeList
Definition
cxfa_treelist.h:15
CXFA_TreeList::CXFA_TreeList
CXFA_TreeList(CXFA_Document *pDocument)
Definition
cxfa_treelist.cpp:14
cppgc
Definition
heap.h:12
std
[33]
Definition
src_corelib_tools_qhash.cpp:421
qtwebengine
src
3rdparty
chromium
third_party
pdfium
xfa
fxfa
parser
cxfa_arraynodelist.cpp
Generated on
for Qt by
1.18.0