// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
- #pragma implementation "htmlparser.h"
-#endif
-#include "wx/wx.h"
+// For compilers that support precompilation, includes "wx/wx.h".
+#include "wx/wxprec.h"
#ifdef __BORLANDC__
#pragma hdrstop
#endif
-#include "wx/textfile.h"
#include "wx/wfstream.h"
+#include "wx/textfile.h"
#include "wx/txtstrm.h"
-
-#include <ctype.h>
-
#include "htmlparser.h"
/// Useful insertion operators for wxOutputStream.
bool bResult = ParseHtml(m_topLevel);
- wxASSERT(bResult); // Failed to parse the TAGs.
+ wxASSERT(bResult); // Failed to parse the TAGs.
// Hint: Check if every open tag has a close tag!
return bResult;
}
else
parent->AppendTag(tag);
- }
+ }
}
else if (IsTagStartBracket(GetChar(m_pos)))
{
if(parent->GetParent())
parent->GetParent()->AppendTag(tag);
else
- parent->AppendTag(tag); // When this occurs it is probably the
+ parent->AppendTag(tag); // When this occurs it is probably the
// empty lines at the end of the file...
}
}
{
while (!Eof() && GetChar(m_pos) != wxT('<'))
{
- text += GetChar(m_pos);
+ text += (wxChar)GetChar(m_pos);
m_pos ++;
}
DecodeSpecialChars(text);
while (!Eof(pos) && !IsWhitespace(GetChar(pos)) && !IsTagEndBracket(GetChar(pos)) && GetChar(pos) != wxT('='))
{
- str += GetChar(pos);
+ str += (wxChar)GetChar(pos);
pos ++;
}
if (eatIt)
// See here for the used table: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/xmlsql/ac_xml1_1nqk.asp
/* static */ void wxSimpleHtmlParser::DecodeSpecialChars(wxString &value)
{
- // XML translation
+ // XML translation
value.Replace(wxT(">"), wxT(">"), true);
value.Replace(wxT("<"), wxT("<"), true);
value.Replace(wxT("""), wxT("\""), true);
{
wxString newvalue = value;
- // XML translation
+ // XML translation
newvalue.Replace(wxT("&"), wxT("&"), true); // Note: do this as first to prevent replace problems.
newvalue.Replace(wxT(">"), wxT(">"), true);
newvalue.Replace(wxT("<"), wxT("<"), true);
newvalue.Replace(wxT("\""),wxT("""), true);
newvalue.Replace(wxT("'"), wxT("'"), true);
-
+
return newvalue;
}
{
child->m_next = NULL;
delete child;
-
+
if (prev != NULL)
prev->m_next = next;
else
while (last->m_next)
last = last->m_next;
- last->m_next = tag;
+ last->m_next = tag;
}
else
{
return false;
}
-// Search forward from this tag until we find a tag with this name & attribute
+// Search forward from this tag until we find a tag with this name & attribute
wxSimpleHtmlTag* wxSimpleHtmlTag::FindTag(const wxString& tagName, const wxString& attrName)
{
wxSimpleHtmlTag* tag = m_next;
attr->Write(stream);
if (i < GetAttributeCount() - 1)
stream << wxT(" ");
- }
+ }
if(!m_children)
{
- sbUseTab = false; // We're putting the open a close tag on the same line,
+ sbUseTab = false; // We're putting the open a close tag on the same line,
// so we don't wan't any tabs
stream << wxT(">");
}