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
74882fe1
Commit
74882fe1
authored
May 30, 2012
by
Vadim Pisarevsky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
replaced "string FileStorage::release()" with 2 methods to preserve backward compatibility.
parent
48c3cfdf
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
9 deletions
+18
-9
core.hpp
modules/core/include/opencv2/core/core.hpp
+3
-1
persistence.cpp
modules/core/src/persistence.cpp
+13
-7
test_io.cpp
modules/core/test/test_io.cpp
+2
-1
No files found.
modules/core/include/opencv2/core/core.hpp
View file @
74882fe1
...
...
@@ -3976,7 +3976,9 @@ public:
//! returns true if the object is associated with currently opened file.
CV_WRAP
virtual
bool
isOpened
()
const
;
//! closes the file and releases all the memory buffers
CV_WRAP
virtual
string
release
();
CV_WRAP
virtual
void
release
();
//! closes the file, releases all the memory buffers and returns the text string
CV_WRAP_AS
(
releaseAndGetString
)
virtual
void
release
(
CV_OUT
string
&
buf
);
//! returns the first element of the top-level mapping
CV_WRAP
FileNode
getFirstTopLevelNode
()
const
;
...
...
modules/core/src/persistence.cpp
View file @
74882fe1
...
...
@@ -5154,19 +5154,25 @@ bool FileStorage::isOpened() const
return
!
fs
.
empty
()
&&
fs
.
obj
->
is_opened
;
}
string
FileStorage
::
release
()
void
FileStorage
::
release
()
{
string
buf
;
if
(
fs
.
obj
&&
fs
.
obj
->
outbuf
)
icvClose
(
fs
.
obj
,
&
buf
);
fs
.
release
();
structs
.
clear
();
state
=
UNDEFINED
;
return
buf
;
}
void
FileStorage
::
release
(
string
&
buf
)
{
if
(
fs
.
obj
&&
fs
.
obj
->
outbuf
)
icvClose
(
fs
.
obj
,
&
buf
);
else
buf
.
clear
();
fs
.
release
();
structs
.
clear
();
state
=
UNDEFINED
;
}
FileNode
FileStorage
::
root
(
int
streamidx
)
const
{
return
isOpened
()
?
FileNode
(
fs
,
cvGetRootFileNode
(
fs
,
streamidx
))
:
FileNode
();
...
...
modules/core/test/test_io.cpp
View file @
74882fe1
...
...
@@ -180,7 +180,8 @@ protected:
fs
.
writeObj
(
"test_graph"
,
graph
);
CvGraph
*
graph2
=
(
CvGraph
*
)
cvClone
(
graph
);
string
content
=
fs
.
release
();
string
content
;
fs
.
release
(
content
);
if
(
!
fs
.
open
(
mem
?
content
:
filename
,
FileStorage
::
READ
+
(
mem
?
FileStorage
::
MEMORY
:
0
)))
{
...
...
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