// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
-#pragma implementation "xml.h"
-#endif
-
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
while (prop)
{
- if (prop->GetName() == propName) return TRUE;
+ if (prop->GetName() == propName) return true;
prop = prop->GetNext();
}
- return FALSE;
+ return false;
}
bool wxXmlNode::GetPropVal(const wxString& propName, wxString *value) const
if (prop->GetName() == propName)
{
*value = prop->GetValue();
- return TRUE;
+ return true;
}
prop = prop->GetNext();
}
- return FALSE;
+ return false;
}
wxString wxXmlNode::GetPropVal(const wxString& propName, const wxString& defaultVal) const
bool wxXmlNode::RemoveChild(wxXmlNode *child)
{
if (m_children == NULL)
- return FALSE;
+ return false;
else if (m_children == child)
{
m_children = child->m_next;
child->m_parent = NULL;
child->m_next = NULL;
- return TRUE;
+ return true;
}
else
{
ch->m_next = child->m_next;
child->m_parent = NULL;
child->m_next = NULL;
- return TRUE;
+ return true;
}
ch = ch->m_next;
}
- return FALSE;
+ return false;
}
}
wxXmlProperty *prop;
if (m_properties == NULL)
- return FALSE;
+ return false;
else if (m_properties->GetName() == name)
{
m_properties = prop->GetNext();
prop->SetNext(NULL);
delete prop;
- return TRUE;
+ return true;
}
else
p->SetNext(prop->GetNext());
prop->SetNext(NULL);
delete prop;
- return TRUE;
+ return true;
}
p = p->GetNext();
}
- return FALSE;
+ return false;
}
}
}
else
{
- bool whiteOnly = TRUE;
+ bool whiteOnly = true;
for (char *c = buf; *c != '\0'; c++)
if (*c != ' ' && *c != '\t' && *c != '\n' && *c != '\r')
{
- whiteOnly = FALSE;
+ whiteOnly = false;
break;
}
if (!whiteOnly)
if (ok)
{
- if (!ctx.version.IsEmpty())
+ if (!ctx.version.empty())
SetVersion(ctx.version);
- if (!ctx.encoding.IsEmpty())
+ if (!ctx.encoding.empty())
SetFileEncoding(ctx.encoding);
SetRoot(ctx.root);
}
#endif
wxMBConv *convFile)
{
- if (str.IsEmpty()) return;
+ if (str.empty()) return;
#if wxUSE_UNICODE
const wxWX2MBbuf buf(str.mb_str(*(convFile ? convFile : &wxConvUTF8)));
stream.Write((const char*)buf, strlen((const char*)buf));
bool wxXmlDocument::Save(wxOutputStream& stream) const
{
if ( !IsOk() )
- return FALSE;
+ return false;
wxString s;
- wxMBConv *convMem = NULL, *convFile = NULL;
+ wxMBConv *convMem = NULL;
+
#if wxUSE_UNICODE
- convFile = new wxCSConv(GetFileEncoding());
+ wxMBConv *convFile = new wxCSConv(GetFileEncoding());
#else
+ wxMBConv *convFile = NULL;
if ( GetFileEncoding() != GetEncoding() )
{
convFile = new wxCSConv(GetFileEncoding());
if ( convMem )
delete convMem;
- return TRUE;
+ return true;
}
#endif // wxUSE_XML