summaryrefslogtreecommitdiff
path: root/core/fpdfapi/parser/cfdf_document.h
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-11-28 17:30:09 -0800
committerCommit bot <commit-bot@chromium.org>2016-11-28 17:30:09 -0800
commit05e01698444726fae302cd335fa4880932d7c543 (patch)
tree011f7693d29e4c6726966fa1b13d5a075a1a8dea /core/fpdfapi/parser/cfdf_document.h
parent405ac0f09e1622d7ff3cf60314d290851ac9f7fd (diff)
downloadpdfium-05e01698444726fae302cd335fa4880932d7c543.tar.xz
Make FDF document creation return unique_ptrs
Review-Url: https://codereview.chromium.org/2538533003
Diffstat (limited to 'core/fpdfapi/parser/cfdf_document.h')
-rw-r--r--core/fpdfapi/parser/cfdf_document.h14
1 files changed, 9 insertions, 5 deletions
diff --git a/core/fpdfapi/parser/cfdf_document.h b/core/fpdfapi/parser/cfdf_document.h
index 075119376f..1b47368458 100644
--- a/core/fpdfapi/parser/cfdf_document.h
+++ b/core/fpdfapi/parser/cfdf_document.h
@@ -7,6 +7,8 @@
#ifndef CORE_FPDFAPI_PARSER_CFDF_DOCUMENT_H_
#define CORE_FPDFAPI_PARSER_CFDF_DOCUMENT_H_
+#include <memory>
+
#include "core/fpdfapi/parser/cpdf_indirect_object_holder.h"
#include "core/fpdfapi/parser/cpdf_object.h"
#include "core/fxcrt/fx_basic.h"
@@ -15,17 +17,19 @@ class CPDF_Dictionary;
class CFDF_Document : public CPDF_IndirectObjectHolder {
public:
- static CFDF_Document* CreateNewDoc();
- static CFDF_Document* ParseFile(IFX_SeekableReadStream* pFile,
- bool bOwnFile = false);
- static CFDF_Document* ParseMemory(const uint8_t* pData, uint32_t size);
+ static std::unique_ptr<CFDF_Document> CreateNewDoc();
+ static std::unique_ptr<CFDF_Document> ParseFile(IFX_SeekableReadStream* pFile,
+ bool bOwnFile = false);
+ static std::unique_ptr<CFDF_Document> ParseMemory(const uint8_t* pData,
+ uint32_t size);
+
+ CFDF_Document();
~CFDF_Document() override;
bool WriteBuf(CFX_ByteTextBuf& buf) const;
CPDF_Dictionary* GetRoot() const { return m_pRootDict; }
protected:
- CFDF_Document();
void ParseStream(IFX_SeekableReadStream* pFile, bool bOwnFile);
CPDF_Dictionary* m_pRootDict;