summaryrefslogtreecommitdiff
path: root/core/fpdfapi/fpdf_parser/include
diff options
context:
space:
mode:
Diffstat (limited to 'core/fpdfapi/fpdf_parser/include')
-rw-r--r--core/fpdfapi/fpdf_parser/include/cfdf_document.h6
-rw-r--r--core/fpdfapi/fpdf_parser/include/cpdf_dictionary.h8
-rw-r--r--core/fpdfapi/fpdf_parser/include/cpdf_document.h6
3 files changed, 19 insertions, 1 deletions
diff --git a/core/fpdfapi/fpdf_parser/include/cfdf_document.h b/core/fpdfapi/fpdf_parser/include/cfdf_document.h
index 834aecd1ba..25366b0cd4 100644
--- a/core/fpdfapi/fpdf_parser/include/cfdf_document.h
+++ b/core/fpdfapi/fpdf_parser/include/cfdf_document.h
@@ -9,6 +9,8 @@
#include "core/fpdfapi/fpdf_parser/include/cpdf_indirect_object_holder.h"
#include "core/fpdfapi/fpdf_parser/include/cpdf_object.h"
+#include "core/fxcrt/include/cfx_string_pool_template.h"
+#include "core/fxcrt/include/cfx_weak_ptr.h"
#include "core/fxcrt/include/fx_basic.h"
class CPDF_Dictionary;
@@ -23,6 +25,9 @@ class CFDF_Document : public CPDF_IndirectObjectHolder {
FX_BOOL WriteBuf(CFX_ByteTextBuf& buf) const;
CPDF_Dictionary* GetRoot() const { return m_pRootDict; }
+ CFX_WeakPtr<CFX_ByteStringPool> GetByteStringPool() const {
+ return m_pByteStringPool;
+ }
protected:
CFDF_Document();
@@ -31,6 +36,7 @@ class CFDF_Document : public CPDF_IndirectObjectHolder {
CPDF_Dictionary* m_pRootDict;
IFX_FileRead* m_pFile;
FX_BOOL m_bOwnFile;
+ CFX_WeakPtr<CFX_ByteStringPool> m_pByteStringPool;
};
#endif // CORE_FPDFAPI_FPDF_PARSER_INCLUDE_CFDF_DOCUMENT_H_
diff --git a/core/fpdfapi/fpdf_parser/include/cpdf_dictionary.h b/core/fpdfapi/fpdf_parser/include/cpdf_dictionary.h
index fc69ce2f4b..501b287dfc 100644
--- a/core/fpdfapi/fpdf_parser/include/cpdf_dictionary.h
+++ b/core/fpdfapi/fpdf_parser/include/cpdf_dictionary.h
@@ -11,6 +11,8 @@
#include <set>
#include "core/fpdfapi/fpdf_parser/include/cpdf_object.h"
+#include "core/fxcrt/include/cfx_string_pool_template.h"
+#include "core/fxcrt/include/cfx_weak_ptr.h"
#include "core/fxcrt/include/fx_coordinates.h"
#include "core/fxcrt/include/fx_string.h"
@@ -21,7 +23,7 @@ class CPDF_Dictionary : public CPDF_Object {
using iterator = std::map<CFX_ByteString, CPDF_Object*>::iterator;
using const_iterator = std::map<CFX_ByteString, CPDF_Object*>::const_iterator;
- CPDF_Dictionary();
+ explicit CPDF_Dictionary(const CFX_WeakPtr<CFX_ByteStringPool>& pPool);
// CPDF_Object.
Type GetType() const override;
@@ -78,13 +80,17 @@ class CPDF_Dictionary : public CPDF_Object {
const_iterator begin() const { return m_Map.begin(); }
const_iterator end() const { return m_Map.end(); }
+ CFX_WeakPtr<CFX_ByteStringPool> GetByteStringPool() const { return m_pPool; }
+
protected:
~CPDF_Dictionary() override;
+ CFX_ByteString MaybeIntern(const CFX_ByteString& str);
CPDF_Object* CloneNonCyclic(
bool bDirect,
std::set<const CPDF_Object*>* visited) const override;
+ CFX_WeakPtr<CFX_ByteStringPool> m_pPool;
std::map<CFX_ByteString, CPDF_Object*> m_Map;
};
diff --git a/core/fpdfapi/fpdf_parser/include/cpdf_document.h b/core/fpdfapi/fpdf_parser/include/cpdf_document.h
index 1cc32dc3b2..383c6faeb4 100644
--- a/core/fpdfapi/fpdf_parser/include/cpdf_document.h
+++ b/core/fpdfapi/fpdf_parser/include/cpdf_document.h
@@ -13,6 +13,8 @@
#include "core/fpdfapi/fpdf_parser/include/cpdf_indirect_object_holder.h"
#include "core/fpdfapi/fpdf_parser/include/cpdf_object.h"
#include "core/fpdfdoc/include/cpdf_linklist.h"
+#include "core/fxcrt/include/cfx_string_pool_template.h"
+#include "core/fxcrt/include/cfx_weak_ptr.h"
#include "core/fxcrt/include/fx_basic.h"
class CFX_Font;
@@ -47,6 +49,9 @@ class CPDF_Document : public CPDF_IndirectObjectHolder {
CPDF_Parser* GetParser() const { return m_pParser.get(); }
CPDF_Dictionary* GetRoot() const { return m_pRootDict; }
CPDF_Dictionary* GetInfo() const { return m_pInfoDict; }
+ CFX_WeakPtr<CFX_ByteStringPool> GetByteStringPool() const {
+ return m_pByteStringPool;
+ }
void DeletePage(int iPage);
int GetPageCount() const;
@@ -134,6 +139,7 @@ class CPDF_Document : public CPDF_IndirectObjectHolder {
std::unique_ptr<JBig2_DocumentContext> m_pCodecContext;
std::unique_ptr<CPDF_LinkList> m_pLinksContext;
CFX_ArrayTemplate<uint32_t> m_PageList;
+ CFX_WeakPtr<CFX_ByteStringPool> m_pByteStringPool;
};
#endif // CORE_FPDFAPI_FPDF_PARSER_INCLUDE_CPDF_DOCUMENT_H_