Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
U
uniset2
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
UniSet project repositories
uniset2
Commits
5a20a6f6
Commit
5a20a6f6
authored
Sep 10, 2009
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
UniXML: add getPropUtf8
parent
597fce8b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
7 deletions
+19
-7
UniXML.h
include/UniXML.h
+2
-0
UniXML.cc
src/Various/UniXML.cc
+17
-7
No files found.
include/UniXML.h
View file @
5a20a6f6
...
...
@@ -80,6 +80,7 @@ public:
// name node
static
std
::
string
getProp
(
xmlNode
*
node
,
const
std
::
string
name
);
static
std
::
string
getPropUtf8
(
xmlNode
*
node
,
const
std
::
string
name
);
static
int
getIntProp
(
xmlNode
*
node
,
const
std
::
string
name
);
/// if value if not positive ( <= 0 ), returns def
static
int
getPIntProp
(
xmlNode
*
node
,
const
std
::
string
name
,
int
def
);
...
...
@@ -127,6 +128,7 @@ class UniXML_iterator
UniXML_iterator
()
{}
std
::
string
getProp
(
const
std
::
string
name
);
std
::
string
getPropUtf8
(
const
std
::
string
name
);
int
getIntProp
(
const
std
::
string
name
);
/// if value if not positive ( <= 0 ), returns def
int
getPIntProp
(
const
std
::
string
name
,
int
def
);
...
...
src/Various/UniXML.cc
View file @
5a20a6f6
...
...
@@ -44,6 +44,8 @@ using namespace std;
, .
libxmlmm.
UniXML.
XML-
getPropUtf8
*/
const
string
UniXML
::
InternalEncoding
(
"koi8-r"
);
const
string
UniXML
::
ExternalEncoding
(
"koi8-r"
);
...
...
@@ -126,8 +128,6 @@ string UniXML::xml2local(const xmlChar* xmlText)
return
""
;
}
#warning ...
size_t
inl
=
strlen
(
text
);
size_t
outl
=
inl
;
...
...
@@ -163,8 +163,6 @@ static char tmpbuf_l2x[500];
const
xmlChar
*
UniXML
::
local2xml
(
string
text
)
{
#warning ...
iconv_t
frt
;
frt
=
iconv_open
(
xmlEncoding
.
c_str
(),
InternalEncoding
.
c_str
()
);
if
(
frt
==
(
iconv_t
)
-
1
)
...
...
@@ -208,9 +206,14 @@ string UniXML::getProp(xmlNode* node, const string name)
return
xml2local
(
::
xmlGetProp
(
node
,
(
const
xmlChar
*
)
name
.
c_str
()));
}
string
UniXML
::
getPropUtf8
(
xmlNode
*
node
,
const
string
name
)
{
return
(
const
char
*
)
::
xmlGetProp
(
node
,
(
const
xmlChar
*
)
name
.
c_str
());
}
int
UniXML
::
getIntProp
(
xmlNode
*
node
,
const
string
name
)
{
return
UniSetTypes
::
uni_atoi
(
(
const
char
*
)
::
xmlGetProp
(
node
,
(
const
xmlChar
*
)
name
.
c_str
()
));
return
UniSetTypes
::
uni_atoi
(
getPropUtf8
(
node
,
name
));
}
int
UniXML
::
getPIntProp
(
xmlNode
*
node
,
const
string
name
,
int
def
)
...
...
@@ -445,13 +448,20 @@ bool UniXML_iterator::goChildren()
}
return
true
;
}
// -------------------------------------------------------------------------
string
UniXML_iterator
::
getProp
(
const
string
name
)
{
return
UniXML
::
xml2local
(
::
xmlGetProp
(
curNode
,
(
const
xmlChar
*
)
name
.
c_str
())
);
return
UniXML
::
getProp
(
curNode
,
name
);
}
// -------------------------------------------------------------------------
// -------------------------------------------------------------------------
string
UniXML_iterator
::
getPropUtf8
(
const
string
name
)
{
return
UniXML
::
getPropUtf8
(
curNode
,
name
);
}
// -------------------------------------------------------------------------
int
UniXML_iterator
::
getIntProp
(
const
string
name
)
{
return
UniSetTypes
::
uni_atoi
((
char
*
)
::
xmlGetProp
(
curNode
,
(
const
xmlChar
*
)
name
.
c_str
()));
...
...
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