diff options
author | Tom Sepez <tsepez@chromium.org> | 2015-07-27 11:55:29 -0700 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2015-07-27 11:55:29 -0700 |
commit | ff46aaf499edcf153ee2f57c7016587aa96dcfa0 (patch) | |
tree | 0a0d92713af476897899b126d180cc6294433d10 /core/src/fxcrt/xml_int.h | |
parent | aafeff816e22c1333c17d8a0eb4fe8927c28142d (diff) | |
download | pdfium-ff46aaf499edcf153ee2f57c7016587aa96dcfa0.tar.xz |
FX Bool considered harmful, part 3
Try to reland this patch after fixing underlying issues that
caused it to be reverted.
fx_system.h is the only manual edit.
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1258093002 .
Diffstat (limited to 'core/src/fxcrt/xml_int.h')
-rw-r--r-- | core/src/fxcrt/xml_int.h | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/core/src/fxcrt/xml_int.h b/core/src/fxcrt/xml_int.h index 109c7a43d2..ec8bdc2850 100644 --- a/core/src/fxcrt/xml_int.h +++ b/core/src/fxcrt/xml_int.h @@ -23,7 +23,7 @@ public: { delete this; } - virtual FX_BOOL IsEOF() + virtual bool IsEOF() { return m_dwCurPos >= m_dwSize; } @@ -35,16 +35,16 @@ public: { return 0; } - virtual FX_BOOL ReadNextBlock(FX_BOOL bRestart = FALSE) + virtual bool ReadNextBlock(bool bRestart = false) { if (bRestart) { m_dwCurPos = 0; } if (m_dwCurPos < m_dwSize) { m_dwCurPos = m_dwSize; - return TRUE; + return true; } - return FALSE; + return false; } virtual const uint8_t* GetBlockBuffer() { @@ -85,7 +85,7 @@ public: { delete this; } - virtual FX_BOOL IsEOF() + virtual bool IsEOF() { return m_nStart + (FX_FILESIZE)m_dwSize >= m_pFileRead->GetSize(); } @@ -97,7 +97,7 @@ public: { return 0; } - virtual FX_BOOL ReadNextBlock(FX_BOOL bRestart = FALSE) + virtual bool ReadNextBlock(bool bRestart = false) { if (bRestart) { m_nStart = 0; @@ -105,7 +105,7 @@ public: FX_FILESIZE nLength = m_pFileRead->GetSize(); m_nStart += (FX_FILESIZE)m_dwSize; if (m_nStart >= nLength) { - return FALSE; + return false; } m_dwSize = (size_t)FX_MIN(FX_XMLDATASTREAM_BufferSize, nLength - m_nStart); if (!m_pBuffer) { @@ -136,28 +136,28 @@ class CXML_Parser public: ~CXML_Parser(); IFX_BufferRead* m_pDataAcc; - FX_BOOL m_bOwnedStream; + bool m_bOwnedStream; FX_FILESIZE m_nOffset; - FX_BOOL m_bSaveSpaceChars; + bool m_bSaveSpaceChars; const uint8_t* m_pBuffer; size_t m_dwBufferSize; FX_FILESIZE m_nBufferOffset; size_t m_dwIndex; - FX_BOOL Init(uint8_t* pBuffer, size_t size); - FX_BOOL Init(IFX_FileRead *pFileRead); - FX_BOOL Init(IFX_BufferRead *pBuffer); - FX_BOOL Init(FX_BOOL bOwndedStream); - FX_BOOL ReadNextBlock(); - FX_BOOL IsEOF(); - FX_BOOL HaveAvailData(); + bool Init(uint8_t* pBuffer, size_t size); + bool Init(IFX_FileRead *pFileRead); + bool Init(IFX_BufferRead *pBuffer); + bool Init(bool bOwndedStream); + bool ReadNextBlock(); + bool IsEOF(); + bool HaveAvailData(); void SkipWhiteSpaces(); void GetName(CFX_ByteString& space, CFX_ByteString& name); void GetAttrValue(CFX_WideString &value); FX_DWORD GetCharRef(); - void GetTagName(CFX_ByteString &space, CFX_ByteString &name, FX_BOOL &bEndTag, FX_BOOL bStartTag = FALSE); + void GetTagName(CFX_ByteString &space, CFX_ByteString &name, bool &bEndTag, bool bStartTag = false); void SkipLiterals(const CFX_ByteStringC& str); - CXML_Element* ParseElement(CXML_Element* pParent, FX_BOOL bStartTag = FALSE); - void InsertContentSegment(FX_BOOL bCDATA, const CFX_WideStringC& content, CXML_Element* pElement); + CXML_Element* ParseElement(CXML_Element* pParent, bool bStartTag = false); + void InsertContentSegment(bool bCDATA, const CFX_WideStringC& content, CXML_Element* pElement); void InsertCDATASegment(CFX_UTF8Decoder& decoder, CXML_Element* pElement); }; void FX_XML_SplitQualifiedName(const CFX_ByteStringC& bsFullName, CFX_ByteStringC &bsSpace, CFX_ByteStringC &bsName); |