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_globaldata.h
Go to the documentation of this file.
1
// Copyright 2014 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
#
ifndef
FXJS_CFX_GLOBALDATA_H_
8
#
define
FXJS_CFX_GLOBALDATA_H_
9
10
#
include
<
memory
>
11
#
include
<
optional
>
12
#
include
<
vector
>
13
14
#
include
"core/fxcrt/binary_buffer.h"
15
#
include
"core/fxcrt/span.h"
16
#
include
"core/fxcrt/unowned_ptr.h"
17
#
include
"fxjs/cfx_keyvalue.h"
18
19
class
CFX_GlobalData
{
20
public
:
21
class
Delegate
{
22
public
:
23
virtual
~
Delegate
() =
default
;
24
25
virtual
bool
StoreBuffer
(pdfium::span<
const
uint8_t> pBuffer) = 0;
26
virtual
std
::
optional
<
pdfium
::
span
<
uint8_t
>>
LoadBuffer
() = 0;
27
virtual
void
BufferDone
() = 0;
28
};
29
30
class
Element
{
31
public
:
32
Element
();
33
~
Element
();
34
35
CFX_KeyValue
data
;
36
bool
bPersistent
=
false
;
37
};
38
39
static
CFX_GlobalData
*
GetRetainedInstance
(
Delegate
* pDelegate);
40
bool
Release
();
41
42
void
SetGlobalVariableNumber
(
ByteString
propname,
double
dData);
43
void
SetGlobalVariableBoolean
(
ByteString
propname,
bool
bData);
44
void
SetGlobalVariableString
(
ByteString
propname,
const
ByteString
& sData);
45
void
SetGlobalVariableObject
(
46
ByteString
propname,
47
std::vector<std::unique_ptr<CFX_KeyValue>> array);
48
void
SetGlobalVariableNull
(
ByteString
propname);
49
bool
SetGlobalVariablePersistent
(
ByteString
propname,
bool
bPersistent);
50
bool
DeleteGlobalVariable
(
ByteString
propname);
51
52
int32_t
GetSize
()
const
;
53
Element
*
GetAt
(
int
index);
54
55
// Exposed for testing.
56
Element
*
GetGlobalVariable
(
const
ByteString
& sPropname);
57
58
private
:
59
using
iterator
=
std
::
vector
<
std
::
unique_ptr
<
Element
>>::
iterator
;
60
61
explicit
CFX_GlobalData(
Delegate
* pDelegate);
62
~CFX_GlobalData();
63
64
bool
LoadGlobalPersistentVariables();
65
bool
LoadGlobalPersistentVariablesFromBuffer(pdfium::span<uint8_t> buffer);
66
bool
SaveGlobalPersisitentVariables();
67
iterator FindGlobalVariable(
const
ByteString
& sPropname);
68
69
size_t m_RefCount = 0;
70
UnownedPtr
<
Delegate
>
const
m_pDelegate;
71
std::vector<std::unique_ptr<Element>> m_arrayGlobalData;
72
};
73
74
#
endif
// FXJS_CFX_GLOBALDATA_H_
ByteString
fxcrt::ByteString ByteString
Definition
bytestring.h:180
CFX_GlobalData::Delegate
Definition
cfx_globaldata.h:21
CFX_GlobalData::Delegate::~Delegate
virtual ~Delegate()=default
CFX_GlobalData::Delegate::StoreBuffer
virtual bool StoreBuffer(pdfium::span< const uint8_t > pBuffer)=0
CFX_GlobalData::Delegate::BufferDone
virtual void BufferDone()=0
CFX_GlobalData::Delegate::LoadBuffer
virtual std::optional< pdfium::span< uint8_t > > LoadBuffer()=0
CFX_GlobalData::Element
Definition
cfx_globaldata.h:30
CFX_GlobalData::Element::Element
Element()
CFX_GlobalData::Element::bPersistent
bool bPersistent
Definition
cfx_globaldata.h:36
CFX_GlobalData::Element::~Element
~Element()
CFX_GlobalData::Element::data
CFX_KeyValue data
Definition
cfx_globaldata.h:35
CFX_GlobalData
Definition
cfx_globaldata.h:19
CFX_GlobalData::Release
bool Release()
Definition
cfx_globaldata.cpp:95
CFX_GlobalData::SetGlobalVariablePersistent
bool SetGlobalVariablePersistent(ByteString propname, bool bPersistent)
Definition
cfx_globaldata.cpp:216
CFX_GlobalData::GetAt
Element * GetAt(int index)
Definition
cfx_globaldata.cpp:245
CFX_GlobalData::SetGlobalVariableObject
void SetGlobalVariableObject(ByteString propname, std::vector< std::unique_ptr< CFX_KeyValue > > array)
Definition
cfx_globaldata.cpp:182
CFX_GlobalData::SetGlobalVariableNull
void SetGlobalVariableNull(ByteString propname)
Definition
cfx_globaldata.cpp:201
CFX_GlobalData::SetGlobalVariableNumber
void SetGlobalVariableNumber(ByteString propname, double dData)
Definition
cfx_globaldata.cpp:128
CFX_GlobalData::DeleteGlobalVariable
bool DeleteGlobalVariable(ByteString propname)
Definition
cfx_globaldata.cpp:229
CFX_GlobalData::GetRetainedInstance
static CFX_GlobalData * GetRetainedInstance(Delegate *pDelegate)
Definition
cfx_globaldata.cpp:87
CFX_GlobalData::SetGlobalVariableBoolean
void SetGlobalVariableBoolean(ByteString propname, bool bData)
Definition
cfx_globaldata.cpp:146
CFX_GlobalData::GetGlobalVariable
Element * GetGlobalVariable(const ByteString &sPropname)
Definition
cfx_globaldata.cpp:122
CFX_GlobalData::SetGlobalVariableString
void SetGlobalVariableString(ByteString propname, const ByteString &sData)
Definition
cfx_globaldata.cpp:164
CFX_GlobalData::GetSize
int32_t GetSize() const
Definition
cfx_globaldata.cpp:241
CFX_KeyValue
Definition
cfx_keyvalue.h:37
CFX_Value
Definition
cfx_keyvalue.h:17
CFX_Value::DataType
DataType
Definition
cfx_keyvalue.h:19
CFX_Value::DataType::kObject
@ kObject
Definition
cfx_keyvalue.h:23
CFX_Value::DataType::kString
@ kString
Definition
cfx_keyvalue.h:22
CFX_Value::DataType::kBoolean
@ kBoolean
Definition
cfx_keyvalue.h:21
CFX_Value::DataType::kNumber
@ kNumber
Definition
cfx_keyvalue.h:20
CFX_Value::DataType::kNull
@ kNull
Definition
cfx_keyvalue.h:24
fxcrt::BinaryBuffer
Definition
binary_buffer.h:19
fxcrt::BinaryBuffer::AppendUint16
void AppendUint16(uint16_t value)
Definition
binary_buffer.cpp:111
fxcrt::BinaryBuffer::AppendDouble
void AppendDouble(double value)
Definition
binary_buffer.cpp:119
fxcrt::BinaryBuffer::AppendString
void AppendString(const ByteString &str)
Definition
binary_buffer.cpp:103
fxcrt::BinaryBuffer::AppendUint32
void AppendUint32(uint32_t value)
Definition
binary_buffer.cpp:115
fxcrt::ByteString::TrimWhitespace
void TrimWhitespace()
Definition
bytestring.cpp:364
fxcrt::UnownedPtr
Definition
unowned_ptr.h:76
pdfium::CFDETextOutLargeBitmapTest
Definition
cfde_textout_unittest.cpp:117
UNSAFE_TODO
#define UNSAFE_TODO(...)
Definition
compiler_specific.h:102
FXSYS_memcpy
UNSAFE_BUFFER_USAGE void * FXSYS_memcpy(void *ptr1, const void *ptr2, size_t len)
Definition
fx_memcpy_wrappers.h:33
fxcrt
Definition
stl_util.h:17
std
[33]
Definition
src_corelib_tools_qhash.cpp:421
qtwebengine
src
3rdparty
chromium
third_party
pdfium
fxjs
cfx_globaldata.h
Generated on
for Qt by
1.18.0