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
597fce8b
Commit
597fce8b
authored
Sep 10, 2009
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
UniSetTypes: add getArgInt
parent
231fac5e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
13 deletions
+21
-13
UniSetTypes.h
include/UniSetTypes.h
+21
-13
No files found.
include/UniSetTypes.h
View file @
597fce8b
...
...
@@ -127,6 +127,20 @@ namespace UniSetTypes
class
uniset_mutex
;
class
uniset_mutex_lock
;
/// ( 0, 8-, 0x, 16-, . )
inline
int
uni_atoi
(
const
char
*
str
)
{
int
n
=
0
;
// if str is NULL or sscanf failed, we return 0
if
(
str
!=
NULL
)
std
::
sscanf
(
str
,
"%i"
,
&
n
);
return
n
;
}
inline
int
uni_atoi
(
const
std
::
string
str
)
{
return
uni_atoi
(
str
.
c_str
());
}
typedef
long
KeyType
;
/*!< */
...
...
@@ -157,6 +171,13 @@ namespace UniSetTypes
return
defval
;
}
inline
int
getArgInt
(
const
std
::
string
name
,
int
_argc
,
const
char
*
const
*
_argv
,
const
std
::
string
defval
=
""
)
{
return
uni_atoi
(
getArgParam
(
name
,
_argc
,
_argv
,
defval
));
}
/*!
\param name -
\return -1, .
...
...
@@ -205,19 +226,6 @@ namespace UniSetTypes
long
setoutregion
(
long
raw
,
long
rawMin
,
long
rawMax
);
/// ( 0, 8-, 0x, 16-, . )
inline
int
uni_atoi
(
const
char
*
str
)
{
int
n
=
0
;
// if str is NULL or sscanf failed, we return 0
if
(
str
!=
NULL
)
std
::
sscanf
(
str
,
"%i"
,
&
n
);
return
n
;
}
inline
int
uni_atoi
(
const
std
::
string
str
)
{
return
uni_atoi
(
str
.
c_str
());
}
bool
file_exist
(
const
std
::
string
filename
);
...
...
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