summaryrefslogtreecommitdiff
path: root/xfa/fde/xml
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-11-02 15:43:18 -0700
committerCommit bot <commit-bot@chromium.org>2016-11-02 15:43:19 -0700
commitd19e912dd469e4bdad9f3020e1f6eb98f10f3470 (patch)
tree239cb568a80445f14a1ab9b63dcaaddcce67e1cc /xfa/fde/xml
parent12f3e4a58f05850b93af35619cb04f0231d86acc (diff)
downloadpdfium-d19e912dd469e4bdad9f3020e1f6eb98f10f3470.tar.xz
Remove FX_BOOL from xfa.
Review-Url: https://codereview.chromium.org/2467203003
Diffstat (limited to 'xfa/fde/xml')
-rw-r--r--xfa/fde/xml/cfx_saxreader.cpp32
-rw-r--r--xfa/fde/xml/cfx_saxreader.h16
-rw-r--r--xfa/fde/xml/fde_xml.h2
-rw-r--r--xfa/fde/xml/fde_xml_imp.cpp103
-rw-r--r--xfa/fde/xml/fde_xml_imp.h48
5 files changed, 100 insertions, 101 deletions
diff --git a/xfa/fde/xml/cfx_saxreader.cpp b/xfa/fde/xml/cfx_saxreader.cpp
index 8f18451ea0..b4d48d2937 100644
--- a/xfa/fde/xml/cfx_saxreader.cpp
+++ b/xfa/fde/xml/cfx_saxreader.cpp
@@ -70,45 +70,45 @@ CFX_SAXFile::CFX_SAXFile()
m_pBuf(nullptr),
m_dwBufSize(0),
m_dwBufIndex(0) {}
-FX_BOOL CFX_SAXFile::StartFile(IFX_SeekableReadStream* pFile,
- uint32_t dwStart,
- uint32_t dwLen) {
+bool CFX_SAXFile::StartFile(IFX_SeekableReadStream* pFile,
+ uint32_t dwStart,
+ uint32_t dwLen) {
ASSERT(!m_pFile && pFile);
uint32_t dwSize = pFile->GetSize();
if (dwStart >= dwSize) {
- return FALSE;
+ return false;
}
if (dwLen == static_cast<uint32_t>(-1) || dwStart + dwLen > dwSize) {
dwLen = dwSize - dwStart;
}
if (dwLen == 0) {
- return FALSE;
+ return false;
}
m_dwBufSize = std::min(dwLen, kSaxFileBufSize);
m_pBuf = FX_Alloc(uint8_t, m_dwBufSize);
if (!pFile->ReadBlock(m_pBuf, dwStart, m_dwBufSize)) {
- return FALSE;
+ return false;
}
m_dwStart = dwStart;
m_dwEnd = dwStart + dwLen;
m_dwCur = dwStart;
m_pFile = pFile;
m_dwBufIndex = 0;
- return TRUE;
+ return true;
}
-FX_BOOL CFX_SAXFile::ReadNextBlock() {
+bool CFX_SAXFile::ReadNextBlock() {
ASSERT(m_pFile);
uint32_t dwSize = m_dwEnd - m_dwCur;
if (dwSize == 0) {
- return FALSE;
+ return false;
}
m_dwBufSize = std::min(dwSize, kSaxFileBufSize);
if (!m_pFile->ReadBlock(m_pBuf, m_dwCur, m_dwBufSize)) {
- return FALSE;
+ return false;
}
m_dwBufIndex = 0;
- return TRUE;
+ return true;
}
void CFX_SAXFile::Reset() {
@@ -210,7 +210,7 @@ void CFX_SAXReader::ReallocNameBuffer() {
m_pszName = (uint8_t*)FX_Realloc(uint8_t, m_pszName, m_iNameSize);
}
-FX_BOOL CFX_SAXReader::SkipSpace(uint8_t ch) {
+bool CFX_SAXReader::SkipSpace(uint8_t ch) {
return (m_dwParseMode & CFX_SaxParseMode_NotSkipSpace) == 0 && ch < 0x21;
}
@@ -226,7 +226,7 @@ int32_t CFX_SAXReader::StartParse(IFX_SeekableReadStream* pFile,
m_iState = 0;
m_eMode = CFX_SaxMode::Text;
m_ePrevMode = CFX_SaxMode::Text;
- m_bCharData = FALSE;
+ m_bCharData = false;
m_dwDataOffset = 0;
m_dwParseMode = dwParseMode;
m_Stack.emplace(new CFX_SAXItem(++m_dwItemID));
@@ -637,11 +637,11 @@ void CFX_SAXReader::SkipNode() {
m_dwDataOffset += 7;
FXSYS_memmove(m_pszData, m_pszData + 7,
m_iDataLength * sizeof(uint8_t));
- m_bCharData = TRUE;
+ m_bCharData = true;
if (m_pHandler) {
NotifyData();
}
- m_bCharData = FALSE;
+ m_bCharData = false;
} else {
Pop();
}
@@ -728,7 +728,7 @@ void CFX_SAXReader::SkipCurrentNode() {
if (!pItem)
return;
- pItem->m_bSkip = TRUE;
+ pItem->m_bSkip = true;
}
void CFX_SAXReader::SetHandler(CXFA_SAXReaderHandler* pHandler) {
diff --git a/xfa/fde/xml/cfx_saxreader.h b/xfa/fde/xml/cfx_saxreader.h
index 10ba69f1f5..667813cf76 100644
--- a/xfa/fde/xml/cfx_saxreader.h
+++ b/xfa/fde/xml/cfx_saxreader.h
@@ -27,21 +27,21 @@ class CFX_SAXItem {
};
explicit CFX_SAXItem(uint32_t id)
- : m_pNode(nullptr), m_eNode(Type::Unknown), m_dwID(id), m_bSkip(FALSE) {}
+ : m_pNode(nullptr), m_eNode(Type::Unknown), m_dwID(id), m_bSkip(false) {}
CXFA_SAXContext* m_pNode;
Type m_eNode;
const uint32_t m_dwID;
- FX_BOOL m_bSkip;
+ bool m_bSkip;
};
class CFX_SAXFile {
public:
CFX_SAXFile();
- FX_BOOL StartFile(IFX_SeekableReadStream* pFile,
- uint32_t dwStart,
- uint32_t dwLen);
- FX_BOOL ReadNextBlock();
+ bool StartFile(IFX_SeekableReadStream* pFile,
+ uint32_t dwStart,
+ uint32_t dwLen);
+ bool ReadNextBlock();
void Reset();
IFX_SeekableReadStream* m_pFile;
uint32_t m_dwStart;
@@ -102,7 +102,7 @@ class CFX_SAXReader {
void Push();
void Pop();
CFX_SAXItem* GetCurrentItem() const;
- FX_BOOL SkipSpace(uint8_t ch);
+ bool SkipSpace(uint8_t ch);
void SkipNode();
void NotifyData();
void NotifyEnter();
@@ -122,7 +122,7 @@ class CFX_SAXReader {
uint32_t m_dwItemID;
CFX_SaxMode m_eMode;
CFX_SaxMode m_ePrevMode;
- FX_BOOL m_bCharData;
+ bool m_bCharData;
uint8_t m_CurByte;
uint32_t m_dwDataOffset;
CFX_ByteArray m_SkipStack;
diff --git a/xfa/fde/xml/fde_xml.h b/xfa/fde/xml/fde_xml.h
index 3be4020bbc..e773b30851 100644
--- a/xfa/fde/xml/fde_xml.h
+++ b/xfa/fde/xml/fde_xml.h
@@ -40,6 +40,6 @@ struct FDE_XMLNODE {
FDE_XMLNODETYPE eNodeType;
};
-FX_BOOL FDE_IsXMLValidChar(FX_WCHAR ch);
+bool FDE_IsXMLValidChar(FX_WCHAR ch);
#endif // XFA_FDE_XML_FDE_XML_H_
diff --git a/xfa/fde/xml/fde_xml_imp.cpp b/xfa/fde/xml/fde_xml_imp.cpp
index ea4fe97dac..cf145fdb65 100644
--- a/xfa/fde/xml/fde_xml_imp.cpp
+++ b/xfa/fde/xml/fde_xml_imp.cpp
@@ -42,7 +42,7 @@ const FDE_XMLNAMECHAR g_XMLNameChars[] = {
{0xF900, 0xFDCF, true}, {0xFDF0, 0xFFFD, true},
};
-bool FDE_IsXMLNameChar(FX_WCHAR ch, FX_BOOL bFirstChar) {
+bool FDE_IsXMLNameChar(FX_WCHAR ch, bool bFirstChar) {
int32_t iStart = 0;
int32_t iEnd = FX_ArraySize(g_XMLNameChars) - 1;
while (iStart <= iEnd) {
@@ -60,7 +60,7 @@ bool FDE_IsXMLNameChar(FX_WCHAR ch, FX_BOOL bFirstChar) {
} // namespace
-FX_BOOL FDE_IsXMLValidChar(FX_WCHAR ch) {
+bool FDE_IsXMLValidChar(FX_WCHAR ch) {
int32_t iStart = 0;
int32_t iEnd = FX_ArraySize(g_XMLValidCharRange) - 1;
while (iStart <= iEnd) {
@@ -70,10 +70,10 @@ FX_BOOL FDE_IsXMLValidChar(FX_WCHAR ch) {
} else if (ch > g_XMLValidCharRange[iMid][1]) {
iStart = iMid + 1;
} else {
- return TRUE;
+ return true;
}
}
- return FALSE;
+ return false;
}
CFDE_XMLNode::CFDE_XMLNode()
@@ -141,7 +141,7 @@ int32_t CFDE_XMLNode::GetChildNodeIndex(CFDE_XMLNode* pNode) const {
CFDE_XMLNode* CFDE_XMLNode::GetPath(const FX_WCHAR* pPath,
int32_t iLength,
- FX_BOOL bQualifiedName) const {
+ bool bQualifiedName) const {
ASSERT(pPath);
if (iLength < 0) {
iLength = FXSYS_wcslen(pPath);
@@ -303,7 +303,7 @@ CFDE_XMLNode* CFDE_XMLNode::GetNodeItem(CFDE_XMLNode::NodeItem eItem) const {
while (pItem->m_pParent) {
pItem = pItem->m_pParent;
}
- while (TRUE) {
+ while (true) {
while (pItem->m_pNext)
pItem = pItem->m_pNext;
if (!pItem->m_pChild)
@@ -339,8 +339,8 @@ int32_t CFDE_XMLNode::GetNodeLevel() const {
return iLevel;
}
-FX_BOOL CFDE_XMLNode::InsertNodeItem(CFDE_XMLNode::NodeItem eItem,
- CFDE_XMLNode* pNode) {
+bool CFDE_XMLNode::InsertNodeItem(CFDE_XMLNode::NodeItem eItem,
+ CFDE_XMLNode* pNode) {
switch (eItem) {
case CFDE_XMLNode::NextSibling: {
pNode->m_pParent = m_pParent;
@@ -350,7 +350,7 @@ FX_BOOL CFDE_XMLNode::InsertNodeItem(CFDE_XMLNode::NodeItem eItem,
m_pNext->m_pPrior = pNode;
}
m_pNext = pNode;
- return TRUE;
+ return true;
}
case CFDE_XMLNode::PriorSibling: {
pNode->m_pParent = m_pParent;
@@ -362,10 +362,10 @@ FX_BOOL CFDE_XMLNode::InsertNodeItem(CFDE_XMLNode::NodeItem eItem,
m_pParent->m_pChild = pNode;
}
m_pPrior = pNode;
- return TRUE;
+ return true;
}
default:
- return FALSE;
+ return false;
}
}
@@ -390,7 +390,7 @@ CFDE_XMLNode* CFDE_XMLNode::RemoveNodeItem(CFDE_XMLNode::NodeItem eItem) {
return pNode;
}
-CFDE_XMLNode* CFDE_XMLNode::Clone(FX_BOOL bRecursive) {
+CFDE_XMLNode* CFDE_XMLNode::Clone(bool bRecursive) {
return nullptr;
}
@@ -509,11 +509,11 @@ void CFDE_XMLNode::CloneChildren(CFDE_XMLNode* pClone) {
return;
}
CFDE_XMLNode* pNext = m_pChild;
- CFDE_XMLNode* pCloneNext = pNext->Clone(TRUE);
+ CFDE_XMLNode* pCloneNext = pNext->Clone(true);
pClone->InsertChildNode(pCloneNext);
pNext = pNext->m_pNext;
while (pNext) {
- CFDE_XMLNode* pChild = pNext->Clone(TRUE);
+ CFDE_XMLNode* pChild = pNext->Clone(true);
pCloneNext->InsertNodeItem(CFDE_XMLNode::NextSibling, pChild);
pCloneNext = pChild;
pNext = pNext->m_pNext;
@@ -533,7 +533,7 @@ FDE_XMLNODETYPE CFDE_XMLInstruction::GetType() const {
return FDE_XMLNODE_Instruction;
}
-CFDE_XMLNode* CFDE_XMLInstruction::Clone(FX_BOOL bRecursive) {
+CFDE_XMLNode* CFDE_XMLInstruction::Clone(bool bRecursive) {
CFDE_XMLInstruction* pClone = new CFDE_XMLInstruction(m_wsTarget);
if (!pClone) {
return pClone;
@@ -550,30 +550,30 @@ int32_t CFDE_XMLInstruction::CountAttributes() const {
return m_Attributes.GetSize() / 2;
}
-FX_BOOL CFDE_XMLInstruction::GetAttribute(int32_t index,
- CFX_WideString& wsAttriName,
- CFX_WideString& wsAttriValue) const {
+bool CFDE_XMLInstruction::GetAttribute(int32_t index,
+ CFX_WideString& wsAttriName,
+ CFX_WideString& wsAttriValue) const {
int32_t iCount = m_Attributes.GetSize();
ASSERT(index > -1 && index < iCount / 2);
for (int32_t i = 0; i < iCount; i += 2) {
if (index == 0) {
wsAttriName = m_Attributes[i];
wsAttriValue = m_Attributes[i + 1];
- return TRUE;
+ return true;
}
index--;
}
- return FALSE;
+ return false;
}
-FX_BOOL CFDE_XMLInstruction::HasAttribute(const FX_WCHAR* pwsAttriName) const {
+bool CFDE_XMLInstruction::HasAttribute(const FX_WCHAR* pwsAttriName) const {
int32_t iCount = m_Attributes.GetSize();
for (int32_t i = 0; i < iCount; i += 2) {
if (m_Attributes[i].Compare(pwsAttriName) == 0) {
- return TRUE;
+ return true;
}
}
- return FALSE;
+ return false;
}
void CFDE_XMLInstruction::GetString(const FX_WCHAR* pwsAttriName,
@@ -655,13 +655,12 @@ int32_t CFDE_XMLInstruction::CountData() const {
return m_TargetData.GetSize();
}
-FX_BOOL CFDE_XMLInstruction::GetData(int32_t index,
- CFX_WideString& wsData) const {
+bool CFDE_XMLInstruction::GetData(int32_t index, CFX_WideString& wsData) const {
if (index < 0 || index >= m_TargetData.GetSize()) {
- return FALSE;
+ return false;
}
wsData = m_TargetData[index];
- return TRUE;
+ return true;
}
void CFDE_XMLInstruction::AppendData(const CFX_WideString& wsData) {
@@ -691,7 +690,7 @@ FDE_XMLNODETYPE CFDE_XMLElement::GetType() const {
return FDE_XMLNODE_Element;
}
-CFDE_XMLNode* CFDE_XMLElement::Clone(FX_BOOL bRecursive) {
+CFDE_XMLNode* CFDE_XMLElement::Clone(bool bRecursive) {
CFDE_XMLElement* pClone = new CFDE_XMLElement(m_wsTag);
if (!pClone) {
return nullptr;
@@ -766,30 +765,30 @@ int32_t CFDE_XMLElement::CountAttributes() const {
return m_Attributes.GetSize() / 2;
}
-FX_BOOL CFDE_XMLElement::GetAttribute(int32_t index,
- CFX_WideString& wsAttriName,
- CFX_WideString& wsAttriValue) const {
+bool CFDE_XMLElement::GetAttribute(int32_t index,
+ CFX_WideString& wsAttriName,
+ CFX_WideString& wsAttriValue) const {
int32_t iCount = m_Attributes.GetSize();
ASSERT(index > -1 && index < iCount / 2);
for (int32_t i = 0; i < iCount; i += 2) {
if (index == 0) {
wsAttriName = m_Attributes[i];
wsAttriValue = m_Attributes[i + 1];
- return TRUE;
+ return true;
}
index--;
}
- return FALSE;
+ return false;
}
-FX_BOOL CFDE_XMLElement::HasAttribute(const FX_WCHAR* pwsAttriName) const {
+bool CFDE_XMLElement::HasAttribute(const FX_WCHAR* pwsAttriName) const {
int32_t iCount = m_Attributes.GetSize();
for (int32_t i = 0; i < iCount; i += 2) {
if (m_Attributes[i].Compare(pwsAttriName) == 0) {
- return TRUE;
+ return true;
}
}
- return FALSE;
+ return false;
}
void CFDE_XMLElement::GetString(const FX_WCHAR* pwsAttriName,
@@ -904,7 +903,7 @@ FDE_XMLNODETYPE CFDE_XMLText::GetType() const {
return FDE_XMLNODE_Text;
}
-CFDE_XMLNode* CFDE_XMLText::Clone(FX_BOOL bRecursive) {
+CFDE_XMLNode* CFDE_XMLText::Clone(bool bRecursive) {
CFDE_XMLText* pClone = new CFDE_XMLText(m_wsText);
return pClone;
}
@@ -922,7 +921,7 @@ FDE_XMLNODETYPE CFDE_XMLCharData::GetType() const {
return FDE_XMLNODE_CharData;
}
-CFDE_XMLNode* CFDE_XMLCharData::Clone(FX_BOOL bRecursive) {
+CFDE_XMLNode* CFDE_XMLCharData::Clone(bool bRecursive) {
CFDE_XMLCharData* pClone = new CFDE_XMLCharData(m_wsCharData);
return pClone;
}
@@ -931,16 +930,16 @@ CFDE_XMLCharData::~CFDE_XMLCharData() {}
CFDE_XMLDoc::CFDE_XMLDoc()
: m_pRoot(nullptr), m_pSyntaxParser(nullptr), m_pXMLParser(nullptr) {
- Reset(TRUE);
+ Reset(true);
CFDE_XMLInstruction* pXML = new CFDE_XMLInstruction(L"xml");
m_pRoot->InsertChildNode(pXML);
}
CFDE_XMLDoc::~CFDE_XMLDoc() {
- Reset(FALSE);
+ Reset(false);
}
-void CFDE_XMLDoc::Reset(FX_BOOL bInitRoot) {
+void CFDE_XMLDoc::Reset(bool bInitRoot) {
m_iStatus = 0;
m_pStream = nullptr;
if (bInitRoot) {
@@ -968,11 +967,11 @@ void CFDE_XMLDoc::ReleaseParser() {
}
}
-FX_BOOL CFDE_XMLDoc::LoadXML(CFDE_XMLParser* pXMLParser) {
+bool CFDE_XMLDoc::LoadXML(CFDE_XMLParser* pXMLParser) {
if (!pXMLParser)
- return FALSE;
+ return false;
- Reset(TRUE);
+ Reset(true);
m_pXMLParser = pXMLParser;
return !!m_pXMLParser;
}
@@ -1097,7 +1096,7 @@ void CFDE_XMLDoc::SaveXMLNode(IFX_Stream* pXMLStream, CFDE_XMLNode* pINode) {
}
}
-void CFDE_XMLDoc::SaveXML(IFX_Stream* pXMLStream, FX_BOOL bSaveBOM) {
+void CFDE_XMLDoc::SaveXML(IFX_Stream* pXMLStream, bool bSaveBOM) {
if (!pXMLStream || pXMLStream == m_pStream) {
m_pStream->Seek(FX_STREAMSEEK_Begin, 0);
pXMLStream = m_pStream;
@@ -1150,14 +1149,14 @@ FX_WCHAR* CFDE_BlockBuffer::GetAvailableBlock(int32_t& iIndexInBlock) {
return m_BlockArray[iRealIndex / m_iAllocStep];
}
-FX_BOOL CFDE_BlockBuffer::InitBuffer(int32_t iBufferSize) {
+bool CFDE_BlockBuffer::InitBuffer(int32_t iBufferSize) {
ClearBuffer();
int32_t iNumOfBlock = (iBufferSize - 1) / m_iAllocStep + 1;
for (int32_t i = 0; i < iNumOfBlock; i++) {
m_BlockArray.Add(FX_Alloc(FX_WCHAR, m_iAllocStep));
}
m_iBufferSize = iNumOfBlock * m_iAllocStep;
- return TRUE;
+ return true;
}
void CFDE_BlockBuffer::SetTextChar(int32_t iIndex, FX_WCHAR ch) {
@@ -1183,12 +1182,12 @@ void CFDE_BlockBuffer::SetTextChar(int32_t iIndex, FX_WCHAR ch) {
}
}
-int32_t CFDE_BlockBuffer::DeleteTextChars(int32_t iCount, FX_BOOL bDirection) {
+int32_t CFDE_BlockBuffer::DeleteTextChars(int32_t iCount, bool bDirection) {
if (iCount <= 0) {
return m_iDataLength;
}
if (iCount >= m_iDataLength) {
- Reset(FALSE);
+ Reset(false);
return 0;
}
if (bDirection) {
@@ -1271,7 +1270,7 @@ CFDE_XMLSyntaxParser::CFDE_XMLSyntaxParser()
m_iParsedBytes(0),
m_pBuffer(nullptr),
m_iBufferChars(0),
- m_bEOS(FALSE),
+ m_bEOS(false),
m_pStart(nullptr),
m_pEnd(nullptr),
m_XMLNodeStack(16),
@@ -1328,7 +1327,7 @@ FDE_XmlSyntaxResult CFDE_XMLSyntaxParser::DoSyntaxParse() {
int32_t iPos;
FDE_XmlSyntaxResult syntaxParserResult = FDE_XmlSyntaxResult::None;
- while (TRUE) {
+ while (true) {
if (m_pStart >= m_pEnd) {
if (m_bEOS || m_iCurrentPos >= iStreamLength) {
m_syntaxParserResult = FDE_XmlSyntaxResult::EndOfString;
@@ -1906,7 +1905,7 @@ void CFDE_XMLSyntaxParser::ParseTextChar(FX_WCHAR character) {
}
}
}
- m_BlockBuffer.DeleteTextChars(m_iDataLength - m_iEntityStart, FALSE);
+ m_BlockBuffer.DeleteTextChars(m_iDataLength - m_iEntityStart, false);
m_pCurrentBlock = m_BlockBuffer.GetAvailableBlock(m_iIndexInBlock);
m_iEntityStart = -1;
} else {
diff --git a/xfa/fde/xml/fde_xml_imp.h b/xfa/fde/xml/fde_xml_imp.h
index 2ce95a0f41..1119ef2ff5 100644
--- a/xfa/fde/xml/fde_xml_imp.h
+++ b/xfa/fde/xml/fde_xml_imp.h
@@ -44,7 +44,7 @@ class CFDE_XMLNode : public CFX_Target {
virtual void Release();
virtual FDE_XMLNODETYPE GetType() const;
- virtual CFDE_XMLNode* Clone(FX_BOOL bRecursive);
+ virtual CFDE_XMLNode* Clone(bool bRecursive);
int32_t CountChildNodes() const;
CFDE_XMLNode* GetChildNode(int32_t index) const;
@@ -56,11 +56,11 @@ class CFDE_XMLNode : public CFX_Target {
CFDE_XMLNode* GetPath(const FX_WCHAR* pPath,
int32_t iLength = -1,
- FX_BOOL bQualifiedName = TRUE) const;
+ bool bQualifiedName = true) const;
int32_t GetNodeLevel() const;
CFDE_XMLNode* GetNodeItem(CFDE_XMLNode::NodeItem eItem) const;
- FX_BOOL InsertNodeItem(CFDE_XMLNode::NodeItem eItem, CFDE_XMLNode* pNode);
+ bool InsertNodeItem(CFDE_XMLNode::NodeItem eItem, CFDE_XMLNode* pNode);
CFDE_XMLNode* RemoveNodeItem(CFDE_XMLNode::NodeItem eItem);
void SaveXMLNode(IFX_Stream* pXMLStream);
@@ -79,14 +79,14 @@ class CFDE_XMLInstruction : public CFDE_XMLNode {
// CFDE_XMLNode
void Release() override;
FDE_XMLNODETYPE GetType() const override;
- CFDE_XMLNode* Clone(FX_BOOL bRecursive) override;
+ CFDE_XMLNode* Clone(bool bRecursive) override;
void GetTargetName(CFX_WideString& wsTarget) const { wsTarget = m_wsTarget; }
int32_t CountAttributes() const;
- FX_BOOL GetAttribute(int32_t index,
- CFX_WideString& wsAttriName,
- CFX_WideString& wsAttriValue) const;
- FX_BOOL HasAttribute(const FX_WCHAR* pwsAttriName) const;
+ bool GetAttribute(int32_t index,
+ CFX_WideString& wsAttriName,
+ CFX_WideString& wsAttriValue) const;
+ bool HasAttribute(const FX_WCHAR* pwsAttriName) const;
void GetString(const FX_WCHAR* pwsAttriName,
CFX_WideString& wsAttriValue,
const FX_WCHAR* pwsDefValue = nullptr) const;
@@ -98,7 +98,7 @@ class CFDE_XMLInstruction : public CFDE_XMLNode {
void SetFloat(const FX_WCHAR* pwsAttriName, FX_FLOAT fAttriValue);
void RemoveAttribute(const FX_WCHAR* pwsAttriName);
int32_t CountData() const;
- FX_BOOL GetData(int32_t index, CFX_WideString& wsData) const;
+ bool GetData(int32_t index, CFX_WideString& wsData) const;
void AppendData(const CFX_WideString& wsData);
void RemoveData(int32_t index);
@@ -115,7 +115,7 @@ class CFDE_XMLElement : public CFDE_XMLNode {
// CFDE_XMLNode
void Release() override;
FDE_XMLNODETYPE GetType() const override;
- CFDE_XMLNode* Clone(FX_BOOL bRecursive) override;
+ CFDE_XMLNode* Clone(bool bRecursive) override;
void GetTagName(CFX_WideString& wsTag) const;
void GetLocalTagName(CFX_WideString& wsTag) const;
@@ -124,10 +124,10 @@ class CFDE_XMLElement : public CFDE_XMLNode {
void GetNamespaceURI(CFX_WideString& wsNamespace) const;
int32_t CountAttributes() const;
- FX_BOOL GetAttribute(int32_t index,
- CFX_WideString& wsAttriName,
- CFX_WideString& wsAttriValue) const;
- FX_BOOL HasAttribute(const FX_WCHAR* pwsAttriName) const;
+ bool GetAttribute(int32_t index,
+ CFX_WideString& wsAttriName,
+ CFX_WideString& wsAttriValue) const;
+ bool HasAttribute(const FX_WCHAR* pwsAttriName) const;
void RemoveAttribute(const FX_WCHAR* pwsAttriName);
void GetString(const FX_WCHAR* pwsAttriName,
@@ -157,7 +157,7 @@ class CFDE_XMLText : public CFDE_XMLNode {
// CFDE_XMLNode
void Release() override;
FDE_XMLNODETYPE GetType() const override;
- CFDE_XMLNode* Clone(FX_BOOL bRecursive) override;
+ CFDE_XMLNode* Clone(bool bRecursive) override;
void GetText(CFX_WideString& wsText) const { wsText = m_wsText; }
void SetText(const CFX_WideString& wsText) { m_wsText = wsText; }
@@ -178,7 +178,7 @@ class CFDE_XMLCharData : public CFDE_XMLDeclaration {
void Release() override;
FDE_XMLNODETYPE GetType() const override;
- CFDE_XMLNode* Clone(FX_BOOL bRecursive) override;
+ CFDE_XMLNode* Clone(bool bRecursive) override;
void GetCharData(CFX_WideString& wsCharData) const {
wsCharData = m_wsCharData;
@@ -193,15 +193,15 @@ class CFDE_XMLDoc : public CFX_Target {
CFDE_XMLDoc();
~CFDE_XMLDoc() override;
- FX_BOOL LoadXML(CFDE_XMLParser* pXMLParser);
+ bool LoadXML(CFDE_XMLParser* pXMLParser);
int32_t DoLoad(IFX_Pause* pPause = nullptr);
void CloseXML();
CFDE_XMLNode* GetRoot() const { return m_pRoot; }
- void SaveXML(IFX_Stream* pXMLStream = nullptr, FX_BOOL bSaveBOM = TRUE);
+ void SaveXML(IFX_Stream* pXMLStream = nullptr, bool bSaveBOM = true);
void SaveXMLNode(IFX_Stream* pXMLStream, CFDE_XMLNode* pNode);
protected:
- void Reset(FX_BOOL bInitRoot);
+ void Reset(bool bInitRoot);
void ReleaseParser();
IFX_Stream* m_pStream;
@@ -224,20 +224,20 @@ class CFDE_BlockBuffer : public CFX_Target {
explicit CFDE_BlockBuffer(int32_t iAllocStep = 1024 * 1024);
~CFDE_BlockBuffer() override;
- FX_BOOL InitBuffer(int32_t iBufferSize = 1024 * 1024);
- FX_BOOL IsInitialized() { return m_iBufferSize / m_iAllocStep >= 1; }
+ bool InitBuffer(int32_t iBufferSize = 1024 * 1024);
+ bool IsInitialized() { return m_iBufferSize / m_iAllocStep >= 1; }
void ReleaseBuffer() { delete this; }
FX_WCHAR* GetAvailableBlock(int32_t& iIndexInBlock);
inline int32_t GetAllocStep() const { return m_iAllocStep; }
inline int32_t& GetDataLengthRef() { return m_iDataLength; }
- inline void Reset(FX_BOOL bReserveData = TRUE) {
+ inline void Reset(bool bReserveData = true) {
if (!bReserveData) {
m_iStartPosition = 0;
}
m_iDataLength = 0;
}
void SetTextChar(int32_t iIndex, FX_WCHAR ch);
- int32_t DeleteTextChars(int32_t iCount, FX_BOOL bDirection = TRUE);
+ int32_t DeleteTextChars(int32_t iCount, bool bDirection = true);
void GetTextData(CFX_WideString& wsTextData,
int32_t iStart = 0,
int32_t iLength = -1) const;
@@ -329,7 +329,7 @@ class CFDE_XMLSyntaxParser : public CFX_Target {
int32_t m_iParsedBytes;
FX_WCHAR* m_pBuffer;
int32_t m_iBufferChars;
- FX_BOOL m_bEOS;
+ bool m_bEOS;
FX_WCHAR* m_pStart;
FX_WCHAR* m_pEnd;
FDE_XMLNODE m_CurNode;