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
6dd9e18b
Commit
6dd9e18b
authored
May 26, 2017
by
PkLab.net
Committed by
Vladislav Sovrasov
Jul 12, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add std::string overload for cv::read()
parent
5b833db5
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
3 deletions
+7
-3
cvstd.inl.hpp
modules/core/include/opencv2/core/cvstd.inl.hpp
+1
-3
persistence.hpp
modules/core/include/opencv2/core/persistence.hpp
+1
-0
persistence.cpp
modules/core/src/persistence.cpp
+5
-0
No files found.
modules/core/include/opencv2/core/cvstd.inl.hpp
View file @
6dd9e18b
...
...
@@ -156,9 +156,7 @@ FileNode::operator std::string() const
template
<>
inline
void
operator
>>
(
const
FileNode
&
n
,
std
::
string
&
value
)
{
String
val
;
read
(
n
,
val
,
val
);
value
=
val
;
read
(
n
,
value
,
std
::
string
());
}
template
<>
inline
...
...
modules/core/include/opencv2/core/persistence.hpp
View file @
6dd9e18b
...
...
@@ -714,6 +714,7 @@ CV_EXPORTS void read(const FileNode& node, int& value, int default_value);
CV_EXPORTS
void
read
(
const
FileNode
&
node
,
float
&
value
,
float
default_value
);
CV_EXPORTS
void
read
(
const
FileNode
&
node
,
double
&
value
,
double
default_value
);
CV_EXPORTS
void
read
(
const
FileNode
&
node
,
String
&
value
,
const
String
&
default_value
);
CV_EXPORTS
void
read
(
const
FileNode
&
node
,
std
::
string
&
value
,
const
std
::
string
&
default_value
);
CV_EXPORTS
void
read
(
const
FileNode
&
node
,
Mat
&
mat
,
const
Mat
&
default_mat
=
Mat
()
);
CV_EXPORTS
void
read
(
const
FileNode
&
node
,
SparseMat
&
mat
,
const
SparseMat
&
default_mat
=
SparseMat
()
);
CV_EXPORTS
void
read
(
const
FileNode
&
node
,
std
::
vector
<
KeyPoint
>&
keypoints
);
...
...
modules/core/src/persistence.cpp
View file @
6dd9e18b
...
...
@@ -7396,6 +7396,11 @@ void read(const FileNode& node, String& value, const String& default_value)
value
=
!
node
.
node
?
default_value
:
CV_NODE_IS_STRING
(
node
.
node
->
tag
)
?
String
(
node
.
node
->
data
.
str
.
ptr
)
:
String
();
}
void
read
(
const
FileNode
&
node
,
std
::
string
&
value
,
const
std
::
string
&
default_value
)
{
value
=
!
node
.
node
?
default_value
:
CV_NODE_IS_STRING
(
node
.
node
->
tag
)
?
std
::
string
(
node
.
node
->
data
.
str
.
ptr
)
:
default_value
;
}
}
...
...
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