core(persistence): fix writeRaw() / readRaw() struct support

- writeRaw(): support structs
- readRaw(): 'len' is buffer limit in bytes (documentation is fixed)
This commit is contained in:
Alexander Alekhin
2019-07-15 21:30:35 +00:00
committed by Alexander Alekhin
parent c3b838b738
commit 4ea8526e9f
5 changed files with 37 additions and 40 deletions
@@ -597,8 +597,8 @@ public:
Usually it is more convenient to use operator `>>` instead of this method.
@param fmt Specification of each array element. See @ref format_spec "format specification"
@param vec Pointer to the destination array.
@param len Number of elements to read. If it is greater than number of remaining elements then all
of them will be read.
@param len Number of bytes to read (buffer size limit). If it is greater than number of
remaining elements then all of them will be read.
*/
void readRaw( const String& fmt, uchar* vec, size_t len ) const;
@@ -668,11 +668,12 @@ public:
Usually it is more convenient to use operator `>>` instead of this method.
@param fmt Specification of each array element. See @ref format_spec "format specification"
@param vec Pointer to the destination array.
@param maxCount Number of elements to read. If it is greater than number of remaining elements then
all of them will be read.
@param len Number of bytes to read (buffer size limit). If it is greater than number of
remaining elements then all of them will be read.
*/
FileNodeIterator& readRaw( const String& fmt, uchar* vec,
size_t maxCount=(size_t)INT_MAX );
size_t len=(size_t)INT_MAX );
struct SeqReader
{