Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
VTK
VTK
Commits
dc933a2c
Commit
dc933a2c
authored
Nov 14, 2002
by
Andy Cedilnik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add support for substrings
parent
42b76a9f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
7 deletions
+30
-7
IO/vtkXMLParser.cxx
IO/vtkXMLParser.cxx
+26
-6
IO/vtkXMLParser.h
IO/vtkXMLParser.h
+4
-1
No files found.
IO/vtkXMLParser.cxx
View file @
dc933a2c
...
...
@@ -22,16 +22,17 @@
#include <ctype.h>
#include <sys/stat.h>
vtkCxxRevisionMacro
(
vtkXMLParser
,
"1.1
1
"
);
vtkCxxRevisionMacro
(
vtkXMLParser
,
"1.1
2
"
);
vtkStandardNewMacro
(
vtkXMLParser
);
//----------------------------------------------------------------------------
vtkXMLParser
::
vtkXMLParser
()
{
this
->
Stream
=
0
;
this
->
Parser
=
0
;
this
->
FileName
=
0
;
this
->
InputString
=
0
;
this
->
Stream
=
0
;
this
->
Parser
=
0
;
this
->
FileName
=
0
;
this
->
InputString
=
0
;
this
->
InputStringLength
=
0
;
}
//----------------------------------------------------------------------------
...
...
@@ -61,11 +62,23 @@ void vtkXMLParser::PrintSelf(ostream& os, vtkIndent indent)
int
vtkXMLParser
::
Parse
(
const
char
*
inputString
)
{
this
->
InputString
=
inputString
;
this
->
InputStringLength
=
-
1
;
int
result
=
this
->
vtkXMLParser
::
Parse
();
this
->
InputString
=
0
;
return
result
;
}
//----------------------------------------------------------------------------
int
vtkXMLParser
::
Parse
(
const
char
*
inputString
,
unsigned
int
length
)
{
this
->
InputString
=
inputString
;
this
->
InputStringLength
=
length
;
int
result
=
this
->
vtkXMLParser
::
Parse
();
this
->
InputString
=
0
;
this
->
InputStringLength
=
-
1
;
return
result
;
}
//----------------------------------------------------------------------------
int
vtkXMLParser
::
Parse
()
...
...
@@ -135,7 +148,14 @@ int vtkXMLParser::ParseXML()
// Parsing of message
if
(
this
->
InputString
)
{
return
this
->
ParseBuffer
(
this
->
InputString
);
if
(
this
->
InputStringLength
>=
0
)
{
return
this
->
ParseBuffer
(
this
->
InputString
,
this
->
InputStringLength
);
}
else
{
return
this
->
ParseBuffer
(
this
->
InputString
);
}
}
// Make sure we have input.
...
...
IO/vtkXMLParser.h
View file @
dc933a2c
...
...
@@ -56,8 +56,10 @@ public:
virtual
int
Parse
();
// Description:
// Parse the XML message.
// Parse the XML message. If length is specified, parse only the
// first "length" characters
virtual
int
Parse
(
const
char
*
inputString
);
virtual
int
Parse
(
const
char
*
inputString
,
unsigned
int
length
);
// Description:
// Set and get file name.
...
...
@@ -76,6 +78,7 @@ protected:
// Character message to parse
const
char
*
InputString
;
int
InputStringLength
;
// Expat parser structure. Exists only during call to Parse().
void
*
Parser
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment