DataStream  1.8.8
DataStream : framework to save/load/serialize/deserialize data
DataStream< FILE *, DataStreamMode::READ, std::vector< SIMPLE_TYPE > > Struct Reference

How to read std::vector SIMPLE_TYPE from a file. More...

#include <template_stream_file_header.h>

Static Public Member Functions

static bool data_stream (FILE *&ds, std::vector< SIMPLE_TYPE > &data)
 Read the data std::vector of SIMPLE_TYPE in the file. More...
 

Detailed Description

How to read std::vector SIMPLE_TYPE from a file.

Definition at line 11 of file template_stream_file_header.h.

Member Function Documentation

◆ data_stream()

bool DataStream< FILE *, DataStreamMode::READ, std::vector< SIMPLE_TYPE > >::data_stream ( FILE *&  ds,
std::vector< SIMPLE_TYPE > &  data 
)
static

Read the data std::vector of SIMPLE_TYPE in the file.

Parameters
[out]ds: file to be read
[out]data: data to be set
Returns
true on success, false otherwise

Definition at line 25 of file template_stream_file_header.cpp.

25  {
26  size_t nbElement(data.size());
28  if(nbElement == 0lu || !b){return b;} //If there is no element, quit now
29  data.resize(nbElement);
30  return fread((void*)data.data(), sizeof(SIMPLE_TYPE), nbElement, ds) == nbElement;
31 }

References DataStream< Stream, Mode, T >::data_stream().

+ Here is the call graph for this function:

The documentation for this struct was generated from the following files:
DataStream::data_stream
static bool data_stream(Stream &ds, T &data)
Definition: data_stream_include.h:28