Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
sysio::chain::detail::fileptr_datastream Class Reference

Public Member Functions

 fileptr_datastream (FILE *file, const std::string &filename)
 
void skip (size_t s)
 
bool read (char *d, size_t s)
 
bool get (unsigned char &c)
 
bool get (char &c)
 

Detailed Description

Definition at line 193 of file block_log.cpp.

Constructor & Destructor Documentation

◆ fileptr_datastream()

sysio::chain::detail::fileptr_datastream::fileptr_datastream ( FILE * file,
const std::string & filename )
inlineexplicit

Definition at line 195 of file block_log.cpp.

195: _file(file), _filename(filename) {}

Member Function Documentation

◆ get() [1/2]

bool sysio::chain::detail::fileptr_datastream::get ( char & c)
inline

Definition at line 214 of file block_log.cpp.

214{ return read(&c, 1); }
Here is the call graph for this function:

◆ get() [2/2]

bool sysio::chain::detail::fileptr_datastream::get ( unsigned char & c)
inline

Definition at line 212 of file block_log.cpp.

212{ return get( *(char*)&c ); }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ read()

bool sysio::chain::detail::fileptr_datastream::read ( char * d,
size_t s )
inline

Definition at line 204 of file block_log.cpp.

204 {
205 size_t result = fread( d, 1, s, _file );
206 SYS_ASSERT( result == s, block_log_exception,
207 "only able to read ${act} bytes of the expected ${exp} bytes in file: ${file}",
208 ("act",result)("exp",s)("file", _filename) );
209 return true;
210 }
#define SYS_ASSERT(expr, exc_type, FORMAT,...)
Definition exceptions.hpp:7
char * s
Here is the caller graph for this function:

◆ skip()

void sysio::chain::detail::fileptr_datastream::skip ( size_t s)
inline

Definition at line 197 of file block_log.cpp.

197 {
198 auto status = fseek(_file, s, SEEK_CUR);
199 SYS_ASSERT( status == 0, block_log_exception,
200 "Could not seek past ${bytes} bytes in Block log file at '${blocks_log}'. Returned status: ${status}",
201 ("bytes", s)("blocks_log", _filename)("status", status) );
202 }

The documentation for this class was generated from the following file: