summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-12-01 14:51:52 -0800
committerCommit bot <commit-bot@chromium.org>2016-12-01 14:51:52 -0800
commitd912f6ba083fed382a13c47aa06299e86d0b8c6b (patch)
treeab99a7b69358e98905cb69ff2167b4d64f25382b /core
parentbea049784abf7c32d0b9758fc77d0e601d5c232b (diff)
downloadpdfium-d912f6ba083fed382a13c47aa06299e86d0b8c6b.tar.xz
Make concrete stream classes private to .cpp, part 2
Fix naming to say "Stream" Review-Url: https://codereview.chromium.org/2543043002
Diffstat (limited to 'core')
-rw-r--r--core/fxcrt/fx_stream.h2
-rw-r--r--core/fxcrt/fx_xml.h2
-rw-r--r--core/fxcrt/fx_xml_parser.cpp49
-rw-r--r--core/fxcrt/xml_int.h47
4 files changed, 50 insertions, 50 deletions
diff --git a/core/fxcrt/fx_stream.h b/core/fxcrt/fx_stream.h
index fe92c939d9..e938ec18df 100644
--- a/core/fxcrt/fx_stream.h
+++ b/core/fxcrt/fx_stream.h
@@ -151,7 +151,7 @@ class IFX_MemoryStream : public IFX_SeekableStream {
virtual void DetachBuffer() = 0;
};
-class IFX_BufferRead : public IFX_ReadStream {
+class IFX_BufferedReadStream : public IFX_ReadStream {
public:
// IFX_ReadStream:
void Release() override = 0;
diff --git a/core/fxcrt/fx_xml.h b/core/fxcrt/fx_xml.h
index a7375b9e90..03337d0142 100644
--- a/core/fxcrt/fx_xml.h
+++ b/core/fxcrt/fx_xml.h
@@ -61,7 +61,7 @@ class CXML_Element {
static CXML_Element* Parse(IFX_SeekableReadStream* pFile,
bool bSaveSpaceChars = false,
FX_FILESIZE* pParsedSize = nullptr);
- static CXML_Element* Parse(IFX_BufferRead* pBuffer,
+ static CXML_Element* Parse(IFX_BufferedReadStream* pBuffer,
bool bSaveSpaceChars = false,
FX_FILESIZE* pParsedSize = nullptr);
diff --git a/core/fxcrt/fx_xml_parser.cpp b/core/fxcrt/fx_xml_parser.cpp
index 3391086e90..803ba597e5 100644
--- a/core/fxcrt/fx_xml_parser.cpp
+++ b/core/fxcrt/fx_xml_parser.cpp
@@ -68,7 +68,26 @@ bool g_FXCRT_XML_IsNameChar(uint8_t ch) {
return !!(g_FXCRT_XML_ByteTypes[ch] & FXCRTM_XML_CHARTYPE_NameChar);
}
-} // namespace
+class CXML_DataBufAcc : public IFX_BufferedReadStream {
+ public:
+ CXML_DataBufAcc(const uint8_t* pBuffer, size_t size);
+ ~CXML_DataBufAcc() override;
+
+ // IFX_BufferedReadStream
+ void Release() override;
+ bool IsEOF() override;
+ FX_FILESIZE GetPosition() override;
+ size_t ReadBlock(void* buffer, size_t size) override;
+ bool ReadNextBlock(bool bRestart) override;
+ const uint8_t* GetBlockBuffer() override;
+ size_t GetBlockSize() override;
+ FX_FILESIZE GetBlockOffset() override;
+
+ private:
+ const uint8_t* m_pBuffer;
+ size_t m_dwSize;
+ size_t m_dwCurPos;
+};
CXML_DataBufAcc::CXML_DataBufAcc(const uint8_t* pBuffer, size_t size)
: m_pBuffer(pBuffer), m_dwSize(size), m_dwCurPos(0) {}
@@ -114,6 +133,28 @@ FX_FILESIZE CXML_DataBufAcc::GetBlockOffset() {
return 0;
}
+class CXML_DataStmAcc : public IFX_BufferedReadStream {
+ public:
+ explicit CXML_DataStmAcc(IFX_SeekableReadStream* pFileRead);
+ ~CXML_DataStmAcc() override;
+
+ // IFX_BufferedReadStream
+ void Release() override;
+ bool IsEOF() override;
+ FX_FILESIZE GetPosition() override;
+ size_t ReadBlock(void* buffer, size_t size) override;
+ bool ReadNextBlock(bool bRestart) override;
+ const uint8_t* GetBlockBuffer() override;
+ size_t GetBlockSize() override;
+ FX_FILESIZE GetBlockOffset() override;
+
+ private:
+ IFX_SeekableReadStream* m_pFileRead;
+ uint8_t* m_pBuffer;
+ FX_FILESIZE m_nStart;
+ size_t m_dwSize;
+};
+
CXML_DataStmAcc::CXML_DataStmAcc(IFX_SeekableReadStream* pFileRead)
: m_pFileRead(pFileRead), m_pBuffer(nullptr), m_nStart(0), m_dwSize(0) {
ASSERT(m_pFileRead);
@@ -169,6 +210,8 @@ FX_FILESIZE CXML_DataStmAcc::GetBlockOffset() {
return m_nStart;
}
+} // namespace
+
CXML_Parser::CXML_Parser()
: m_pDataAcc(nullptr),
m_bOwnedStream(false),
@@ -195,7 +238,7 @@ bool CXML_Parser::Init(IFX_SeekableReadStream* pFileRead) {
return Init(true);
}
-bool CXML_Parser::Init(IFX_BufferRead* pBuffer) {
+bool CXML_Parser::Init(IFX_BufferedReadStream* pBuffer) {
if (!pBuffer)
return false;
@@ -667,7 +710,7 @@ CXML_Element* CXML_Element::Parse(IFX_SeekableReadStream* pFile,
}
return XML_ContinueParse(parser, bSaveSpaceChars, pParsedSize);
}
-CXML_Element* CXML_Element::Parse(IFX_BufferRead* pBuffer,
+CXML_Element* CXML_Element::Parse(IFX_BufferedReadStream* pBuffer,
bool bSaveSpaceChars,
FX_FILESIZE* pParsedSize) {
CXML_Parser parser;
diff --git a/core/fxcrt/xml_int.h b/core/fxcrt/xml_int.h
index d65fdad58c..f5beaef9ae 100644
--- a/core/fxcrt/xml_int.h
+++ b/core/fxcrt/xml_int.h
@@ -14,49 +14,6 @@
class CFX_UTF8Decoder;
class CXML_Element;
-class CXML_DataBufAcc : public IFX_BufferRead {
- public:
- CXML_DataBufAcc(const uint8_t* pBuffer, size_t size);
- ~CXML_DataBufAcc() override;
-
- // IFX_BufferRead
- void Release() override;
- bool IsEOF() override;
- FX_FILESIZE GetPosition() override;
- size_t ReadBlock(void* buffer, size_t size) override;
- bool ReadNextBlock(bool bRestart = false) override;
- const uint8_t* GetBlockBuffer() override;
- size_t GetBlockSize() override;
- FX_FILESIZE GetBlockOffset() override;
-
- protected:
- const uint8_t* m_pBuffer;
- size_t m_dwSize;
- size_t m_dwCurPos;
-};
-
-class CXML_DataStmAcc : public IFX_BufferRead {
- public:
- explicit CXML_DataStmAcc(IFX_SeekableReadStream* pFileRead);
- ~CXML_DataStmAcc() override;
-
- // IFX_BufferRead
- void Release() override;
- bool IsEOF() override;
- FX_FILESIZE GetPosition() override;
- size_t ReadBlock(void* buffer, size_t size) override;
- bool ReadNextBlock(bool bRestart = false) override;
- const uint8_t* GetBlockBuffer() override;
- size_t GetBlockSize() override;
- FX_FILESIZE GetBlockOffset() override;
-
- protected:
- IFX_SeekableReadStream* m_pFileRead;
- uint8_t* m_pBuffer;
- FX_FILESIZE m_nStart;
- size_t m_dwSize;
-};
-
class CXML_Parser {
public:
CXML_Parser();
@@ -64,7 +21,7 @@ class CXML_Parser {
bool Init(uint8_t* pBuffer, size_t size);
bool Init(IFX_SeekableReadStream* pFileRead);
- bool Init(IFX_BufferRead* pBuffer);
+ bool Init(IFX_BufferedReadStream* pBuffer);
bool Init(bool bOwndedStream);
bool ReadNextBlock();
bool IsEOF();
@@ -84,7 +41,7 @@ class CXML_Parser {
CXML_Element* pElement);
void InsertCDATASegment(CFX_UTF8Decoder& decoder, CXML_Element* pElement);
- IFX_BufferRead* m_pDataAcc;
+ IFX_BufferedReadStream* m_pDataAcc;
bool m_bOwnedStream;
FX_FILESIZE m_nOffset;
bool m_bSaveSpaceChars;