diff options
author | Jane Liu <janeliulwq@google.com> | 2017-07-24 11:47:23 -0400 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-07-24 16:36:43 +0000 |
commit | a5d2929220bb08bfdc34505ca4edf5be6d9de94f (patch) | |
tree | 15981c4b254994410bab3a2129a42e607a13bfa1 /core/fpdfdoc/cpdf_nametree.h | |
parent | 72cc6c69b65b20c007032148c909c75cf1ae6564 (diff) | |
download | pdfium-a5d2929220bb08bfdc34505ca4edf5be6d9de94f.tar.xz |
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 <dsinclair@chromium.org>
Commit-Queue: Jane Liu <janeliulwq@google.com>
Diffstat (limited to 'core/fpdfdoc/cpdf_nametree.h')
-rw-r--r-- | core/fpdfdoc/cpdf_nametree.h | 5 |
1 files changed, 5 insertions, 0 deletions
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 <memory> + #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<CPDF_Object> 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); |