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
22e725e8
Commit
22e725e8
authored
Aug 04, 2009
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add getIntProp to Configuration, UniXML, UniXML_iterator
parent
7c4f0c19
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
0 deletions
+23
-0
Configuration.h
include/Configuration.h
+3
-0
UniXML.h
include/UniXML.h
+2
-0
Configuration.cc
src/Various/Configuration.cc
+6
-0
UniXML.cc
src/Various/UniXML.cc
+12
-0
No files found.
include/Configuration.h
View file @
22e725e8
...
@@ -69,6 +69,9 @@ namespace UniSetTypes
...
@@ -69,6 +69,9 @@ namespace UniSetTypes
/// ԣ path
/// ԣ path
std
::
string
getField
(
const
std
::
string
path
);
std
::
string
getField
(
const
std
::
string
path
);
/// ԣ path
int
getIntField
(
const
std
::
string
path
);
xmlNode
*
findNode
(
xmlNode
*
node
,
const
std
::
string
searchnode
,
const
std
::
string
name
=
""
);
xmlNode
*
findNode
(
xmlNode
*
node
,
const
std
::
string
searchnode
,
const
std
::
string
name
=
""
);
//
//
...
...
include/UniXML.h
View file @
22e725e8
...
@@ -80,6 +80,7 @@ public:
...
@@ -80,6 +80,7 @@ public:
// name node
// name node
static
std
::
string
getProp
(
xmlNode
*
node
,
const
std
::
string
name
);
static
std
::
string
getProp
(
xmlNode
*
node
,
const
std
::
string
name
);
static
int
getIntProp
(
xmlNode
*
node
,
const
std
::
string
name
);
// name node
// name node
static
void
setProp
(
xmlNode
*
node
,
const
std
::
string
name
,
const
std
::
string
text
);
static
void
setProp
(
xmlNode
*
node
,
const
std
::
string
name
,
const
std
::
string
text
);
...
@@ -124,6 +125,7 @@ class UniXML_iterator
...
@@ -124,6 +125,7 @@ class UniXML_iterator
UniXML_iterator
()
{}
UniXML_iterator
()
{}
std
::
string
getProp
(
const
std
::
string
name
);
std
::
string
getProp
(
const
std
::
string
name
);
int
getIntProp
(
const
std
::
string
name
);
void
setProp
(
const
std
::
string
name
,
const
std
::
string
text
);
void
setProp
(
const
std
::
string
name
,
const
std
::
string
text
);
/*! . false, */
/*! . false, */
...
...
src/Various/Configuration.cc
View file @
22e725e8
...
@@ -571,6 +571,12 @@ string Configuration::getField(const string path)
...
@@ -571,6 +571,12 @@ string Configuration::getField(const string path)
return
getProp
(
getNode
(
path
),
"name"
);
return
getProp
(
getNode
(
path
),
"name"
);
}
}
// -------------------------------------------------------------------------
// -------------------------------------------------------------------------
int
Configuration
::
getIntField
(
const
std
::
string
path
)
{
return
unixml
.
getIntProp
(
getNode
(
path
),
"name"
);
}
// -------------------------------------------------------------------------
xmlNode
*
Configuration
::
findNode
(
xmlNode
*
node
,
const
std
::
string
snode
,
const
std
::
string
sname
)
xmlNode
*
Configuration
::
findNode
(
xmlNode
*
node
,
const
std
::
string
snode
,
const
std
::
string
sname
)
{
{
if
(
!
unixml
.
isOpen
()
)
if
(
!
unixml
.
isOpen
()
)
...
...
src/Various/UniXML.cc
View file @
22e725e8
...
@@ -32,6 +32,7 @@
...
@@ -32,6 +32,7 @@
#include <iostream>
#include <iostream>
#include <string>
#include <string>
#include "UniSetTypes.h"
#include "UniXML.h"
#include "UniXML.h"
#include "Exceptions.h"
#include "Exceptions.h"
...
@@ -201,6 +202,11 @@ string UniXML::getProp(xmlNode* node, const string name)
...
@@ -201,6 +202,11 @@ string UniXML::getProp(xmlNode* node, const string name)
return
xml2local
(
::
xmlGetProp
(
node
,
(
const
xmlChar
*
)
name
.
c_str
()));
return
xml2local
(
::
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
()));
}
void
UniXML
::
setProp
(
xmlNode
*
node
,
string
name
,
string
text
)
void
UniXML
::
setProp
(
xmlNode
*
node
,
string
name
,
string
text
)
{
{
xmlSetProp
(
node
,
(
const
xmlChar
*
)
name
.
c_str
(),
local2xml
(
text
));
xmlSetProp
(
node
,
(
const
xmlChar
*
)
name
.
c_str
(),
local2xml
(
text
));
...
@@ -430,6 +436,12 @@ string UniXML_iterator::getProp( const string name )
...
@@ -430,6 +436,12 @@ string UniXML_iterator::getProp( const string name )
{
{
return
UniXML
::
xml2local
(
::
xmlGetProp
(
curNode
,
(
const
xmlChar
*
)
name
.
c_str
()));
return
UniXML
::
xml2local
(
::
xmlGetProp
(
curNode
,
(
const
xmlChar
*
)
name
.
c_str
()));
}
}
// -------------------------------------------------------------------------
int
UniXML_iterator
::
getIntProp
(
const
string
name
)
{
return
UniSetTypes
::
uni_atoi
((
char
*
)
::
xmlGetProp
(
curNode
,
(
const
xmlChar
*
)
name
.
c_str
()));
}
// -------------------------------------------------------------------------
// -------------------------------------------------------------------------
void
UniXML_iterator
::
setProp
(
const
string
name
,
const
string
text
)
void
UniXML_iterator
::
setProp
(
const
string
name
,
const
string
text
)
{
{
...
...
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