31 #include <wx/string.h> 32 #include <wx/xml/xml.h> 44 XNODE* iNode =
nullptr, *cNode =
nullptr;
45 wxString str, propValue, content;
46 wxCSConv conv( wxT(
"windows-1251" ) );
48 FILE* fp = wxFopen( aFileName, wxT(
"rt" ) );
54 if( !fgets( line,
sizeof( line ), fp )
60 fseek( fp, 0, SEEK_SET );
65 iNode =
new XNODE( wxXML_ELEMENT_NODE, wxT(
"www.lura.sk" ) );
77 cNode =
new XNODE( wxXML_ELEMENT_NODE, wxString( lexer.
CurText(), conv ) );
78 iNode->AddChild( cNode );
83 str = wxString( lexer.
CurText(), conv );
88 if( iNode->GetAttribute( wxT(
"Name" ), &propValue ) )
90 iNode->DeleteAttribute( wxT(
"Name" ) );
91 iNode->AddAttribute( wxT(
"Name" ), propValue + wxT(
' ' ) + str );
95 iNode->AddAttribute( wxT(
"Name" ), str );
98 else if( str != wxEmptyString )
101 content = cNode->GetNodeContent() + wxT(
' ' ) + str;
103 if( cNode->GetChildren() )
106 cNode->AddChild(
new wxXmlNode( wxXML_TEXT_NODE, wxEmptyString, content ) );
113 aXmlDoc->SetRoot( iNode );
const char * CurText() const
Return a pointer to the current token's text.
void LoadInputFile(const wxString &aFileName, wxXmlDocument *aXmlDoc)
This file contains miscellaneous commonly used macros and functions.
XNODE * GetChildren() const
XNODE * GetParent() const
static KEYWORD empty_keywords[1]
Hold an XML or S-expression element.
static const char ACCEL_ASCII_KEYWORD[]
int NextTok()
Return the next token found in the input file or DSN_EOF when reaching the end of file.
Hold a keyword string and its unique integer token.
#define THROW_IO_ERROR(msg)
Implement a lexical analyzer for the SPECCTRA DSN file format.