Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
203a9acd
Commit
203a9acd
authored
Dec 31, 2013
by
pxli168
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add support to bool type
Add the bool support to the get function
parent
2d5723cc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
+9
-0
command_line_parser.cpp
modules/core/src/command_line_parser.cpp
+9
-0
No files found.
modules/core/src/command_line_parser.cpp
View file @
203a9acd
...
@@ -41,6 +41,8 @@ static String get_type_name(int type)
...
@@ -41,6 +41,8 @@ static String get_type_name(int type)
{
{
if
(
type
==
Param
::
INT
)
if
(
type
==
Param
::
INT
)
return
"int"
;
return
"int"
;
if
(
type
==
Param
::
BOOLEAN
)
return
"bool"
;
if
(
type
==
Param
::
UNSIGNED_INT
)
if
(
type
==
Param
::
UNSIGNED_INT
)
return
"unsigned"
;
return
"unsigned"
;
if
(
type
==
Param
::
UINT64
)
if
(
type
==
Param
::
UINT64
)
...
@@ -59,6 +61,13 @@ static void from_str(const String& str, int type, void* dst)
...
@@ -59,6 +61,13 @@ static void from_str(const String& str, int type, void* dst)
std
::
stringstream
ss
(
str
.
c_str
());
std
::
stringstream
ss
(
str
.
c_str
());
if
(
type
==
Param
::
INT
)
if
(
type
==
Param
::
INT
)
ss
>>
*
(
int
*
)
dst
;
ss
>>
*
(
int
*
)
dst
;
else
if
(
type
==
Param
::
BOOLEAN
)
{
std
::
string
temp
;
ss
>>
temp
;
if
(
!
temp
.
compare
(
"true"
)
)
*
(
bool
*
)
dst
=
true
;
else
*
(
bool
*
)
dst
=
false
;
}
else
if
(
type
==
Param
::
UNSIGNED_INT
)
else
if
(
type
==
Param
::
UNSIGNED_INT
)
ss
>>
*
(
unsigned
*
)
dst
;
ss
>>
*
(
unsigned
*
)
dst
;
else
if
(
type
==
Param
::
UINT64
)
else
if
(
type
==
Param
::
UINT64
)
...
...
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