changed "void FileStorage::release(string&)" to "string FileStorage::releaseAndGetString()"

pull/2/head
Vadim Pisarevsky 13 years ago
parent 29b9070698
commit 17d9509e31
  1. 2
      modules/core/include/opencv2/core/core.hpp
  2. 6
      modules/core/src/persistence.cpp
  3. 3
      modules/core/test/test_io.cpp

@ -3978,7 +3978,7 @@ public:
//! closes the file and releases all the memory buffers
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);
CV_WRAP virtual string releaseAndGetString();
//! returns the first element of the top-level mapping
CV_WRAP FileNode getFirstTopLevelNode() const;

@ -5161,16 +5161,16 @@ void FileStorage::release()
state = UNDEFINED;
}
void FileStorage::release(string& buf)
string FileStorage::releaseAndGetString()
{
string buf;
if( fs.obj && fs.obj->outbuf )
icvClose(fs.obj, &buf);
else
buf.clear();
fs.release();
structs.clear();
state = UNDEFINED;
return buf;
}
FileNode FileStorage::root(int streamidx) const

@ -180,8 +180,7 @@ protected:
fs.writeObj("test_graph",graph);
CvGraph* graph2 = (CvGraph*)cvClone(graph);
string content;
fs.release(content);
string content = fs.releaseAndGetString();
if(!fs.open(mem ? content : filename, FileStorage::READ + (mem ? FileStorage::MEMORY : 0)))
{

Loading…
Cancel
Save