|
|
@ -206,8 +206,12 @@ cvOpenFileStorage( const char* query, CvMemStorage* dststorage, int flags, const |
|
|
|
// and factor=4 for YAML ( as we use 4 bytes for non ASCII characters (e.g. \xAB))
|
|
|
|
// and factor=4 for YAML ( as we use 4 bytes for non ASCII characters (e.g. \xAB))
|
|
|
|
int buf_size = CV_FS_MAX_LEN*(fs->fmt == CV_STORAGE_FORMAT_XML ? 6 : 4) + 1024; |
|
|
|
int buf_size = CV_FS_MAX_LEN*(fs->fmt == CV_STORAGE_FORMAT_XML ? 6 : 4) + 1024; |
|
|
|
|
|
|
|
|
|
|
|
if( append ) |
|
|
|
if (append) |
|
|
|
|
|
|
|
{ |
|
|
|
fseek( fs->file, 0, SEEK_END ); |
|
|
|
fseek( fs->file, 0, SEEK_END ); |
|
|
|
|
|
|
|
if (ftell(fs->file) == 0) |
|
|
|
|
|
|
|
append = false; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
fs->write_stack = cvCreateSeq( 0, sizeof(CvSeq), fs->fmt == CV_STORAGE_FORMAT_XML ? |
|
|
|
fs->write_stack = cvCreateSeq( 0, sizeof(CvSeq), fs->fmt == CV_STORAGE_FORMAT_XML ? |
|
|
|
sizeof(CvXMLStackRecord) : sizeof(int), fs->memstorage ); |
|
|
|
sizeof(CvXMLStackRecord) : sizeof(int), fs->memstorage ); |
|
|
@ -301,7 +305,7 @@ cvOpenFileStorage( const char* query, CvMemStorage* dststorage, int flags, const |
|
|
|
} |
|
|
|
} |
|
|
|
else if( fs->fmt == CV_STORAGE_FORMAT_YAML ) |
|
|
|
else if( fs->fmt == CV_STORAGE_FORMAT_YAML ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if( !append ) |
|
|
|
if( !append) |
|
|
|
icvPuts( fs, "%YAML:1.0\n---\n" ); |
|
|
|
icvPuts( fs, "%YAML:1.0\n---\n" ); |
|
|
|
else |
|
|
|
else |
|
|
|
icvPuts( fs, "...\n---\n" ); |
|
|
|
icvPuts( fs, "...\n---\n" ); |
|
|
|