summaryrefslogtreecommitdiff
path: root/core/fxcrt/xml_int.h
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2017-02-27 14:45:56 -0800
committerChromium commit bot <commit-bot@chromium.org>2017-02-28 00:35:05 +0000
commita99de0ec3cda8ff5b0d6383a059dd39c8626e504 (patch)
treefea2f04aca7aca32fc85c952040cf8593f40a64e /core/fxcrt/xml_int.h
parentce32acfa15071e6cd5bcce73280857014e396dd2 (diff)
downloadpdfium-a99de0ec3cda8ff5b0d6383a059dd39c8626e504.tar.xz
Clean up CXML_Element.chromium/3026
- Set more members in the ctor - Remove dead code - Use more unique_ptrs Change-Id: Idfe85d07c784a57862f9314bc85f407f817b8f2f Reviewed-on: https://pdfium-review.googlesource.com/2844 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fxcrt/xml_int.h')
-rw-r--r--core/fxcrt/xml_int.h20
1 files changed, 9 insertions, 11 deletions
diff --git a/core/fxcrt/xml_int.h b/core/fxcrt/xml_int.h
index e617a777f3..96a7da9c51 100644
--- a/core/fxcrt/xml_int.h
+++ b/core/fxcrt/xml_int.h
@@ -8,6 +8,7 @@
#define CORE_FXCRT_XML_INT_H_
#include <algorithm>
+#include <memory>
#include "core/fxcrt/fx_stream.h"
@@ -19,23 +20,21 @@ class CXML_Parser {
CXML_Parser();
~CXML_Parser();
- bool Init(uint8_t* pBuffer, size_t size);
- bool Init(const CFX_RetainPtr<IFX_SeekableReadStream>& pFileRead);
- bool Init(const CFX_RetainPtr<IFX_BufferedReadStream>& pBuffer);
- bool Init();
+ bool Init(const uint8_t* pBuffer, size_t size);
bool ReadNextBlock();
bool IsEOF();
bool HaveAvailData();
void SkipWhiteSpaces();
- void GetName(CFX_ByteString& space, CFX_ByteString& name);
+ void GetName(CFX_ByteString* space, CFX_ByteString* name);
void GetAttrValue(CFX_WideString& value);
uint32_t GetCharRef();
- void GetTagName(CFX_ByteString& space,
- CFX_ByteString& name,
- bool& bEndTag,
- bool bStartTag = false);
+ void GetTagName(bool bStartTag,
+ bool* bEndTag,
+ CFX_ByteString* space,
+ CFX_ByteString* name);
void SkipLiterals(const CFX_ByteStringC& str);
- CXML_Element* ParseElement(CXML_Element* pParent, bool bStartTag = false);
+ std::unique_ptr<CXML_Element> ParseElement(CXML_Element* pParent,
+ bool bStartTag);
void InsertContentSegment(bool bCDATA,
const CFX_WideStringC& content,
CXML_Element* pElement);
@@ -43,7 +42,6 @@ class CXML_Parser {
CFX_RetainPtr<IFX_BufferedReadStream> m_pDataAcc;
FX_FILESIZE m_nOffset;
- bool m_bSaveSpaceChars;
const uint8_t* m_pBuffer;
size_t m_dwBufferSize;
FX_FILESIZE m_nBufferOffset;