From a5d2929220bb08bfdc34505ca4edf5be6d9de94f Mon Sep 17 00:00:00 2001 From: Jane Liu Date: Mon, 24 Jul 2017 11:47:23 -0400 Subject: Added CPDF_NameTree::AddValueAndName() 1. Added CPDF_NameTree::AddValueAndName() for inserting new name and values pairs into a nametree while following nametree order rules. This function will be used for the API for adding embedded files. * Added anonymous helper functions. * Added two unit tests. Bug=pdfium:174 Change-Id: Ic3e2f32f7147ef5c164cf5c2a28e0a652ffed74a Reviewed-on: https://pdfium-review.googlesource.com/8271 Reviewed-by: dsinclair Commit-Queue: Jane Liu --- core/fpdfdoc/cpdf_nametree.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'core/fpdfdoc/cpdf_nametree.h') diff --git a/core/fpdfdoc/cpdf_nametree.h b/core/fpdfdoc/cpdf_nametree.h index a56f511783..28239233ea 100644 --- a/core/fpdfdoc/cpdf_nametree.h +++ b/core/fpdfdoc/cpdf_nametree.h @@ -7,6 +7,8 @@ #ifndef CORE_FPDFDOC_CPDF_NAMETREE_H_ #define CORE_FPDFDOC_CPDF_NAMETREE_H_ +#include + #include "core/fxcrt/cfx_unowned_ptr.h" #include "core/fxcrt/fx_string.h" @@ -21,6 +23,9 @@ class CPDF_NameTree { CPDF_NameTree(CPDF_Document* pDoc, const CFX_ByteString& category); ~CPDF_NameTree(); + bool AddValueAndName(std::unique_ptr pObj, + const CFX_WideString& name); + CPDF_Object* LookupValueAndName(int nIndex, CFX_WideString* csName) const; CPDF_Object* LookupValue(const CFX_WideString& csName) const; CPDF_Array* LookupNamedDest(CPDF_Document* pDoc, const CFX_WideString& sName); -- cgit v1.2.3