Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
tsoc
openmm
Commits
2f8448a5
Commit
2f8448a5
authored
Feb 08, 2016
by
Peter Eastman
Browse files
irrXML supports numeric escapes
parent
90ddfc31
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
2 deletions
+31
-2
libraries/irrxml/include/CXMLReaderImpl.h
libraries/irrxml/include/CXMLReaderImpl.h
+31
-2
No files found.
libraries/irrxml/include/CXMLReaderImpl.h
View file @
2f8448a5
...
...
@@ -2,6 +2,8 @@
// This file is part of the "Irrlicht Engine" and the "irrXML" project.
// For conditions of distribution and use, see copyright notice in irrlicht.h and/or irrXML.h
// MODIFIED by Peter Eastman, Feb. 4, 2016, to support numeric escape sequences
#ifndef __ICXML_READER_IMPL_H_INCLUDED__
#define __ICXML_READER_IMPL_H_INCLUDED__
...
...
@@ -530,8 +532,35 @@ private:
}
else
{
newstr
.
append
(
origstr
.
subString
(
oldPos
,
pos
-
oldPos
+
1
));
pos
+=
1
;
int
semicolonPos
=
origstr
.
findNext
(
L';'
,
pos
);
if
(
semicolonPos
!=
-
1
&&
origstr
.
c_str
()[
pos
+
1
]
==
L'#'
)
{
// it is a numeric character reference
int
number
;
core
::
string
<
char
>
numberString
;
if
(
origstr
.
c_str
()[
pos
+
2
]
==
L'x'
)
{
// hex value
for
(
int
i
=
pos
+
3
;
i
<
semicolonPos
;
++
i
)
numberString
.
append
((
char
)
origstr
[
i
]);
sscanf
(
numberString
.
c_str
(),
"%x"
,
&
number
);
}
else
{
// decimal value
for
(
int
i
=
pos
+
2
;
i
<
semicolonPos
;
++
i
)
numberString
.
append
((
char
)
origstr
[
i
]);
sscanf
(
numberString
.
c_str
(),
"%d"
,
&
number
);
}
newstr
.
append
(
origstr
.
subString
(
oldPos
,
pos
-
oldPos
));
newstr
.
append
((
char_type
)
number
);
pos
=
semicolonPos
+
1
;
}
else
{
newstr
.
append
(
origstr
.
subString
(
oldPos
,
pos
-
oldPos
+
1
));
pos
+=
1
;
}
}
// find next &
...
...
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