HIPO  4.3.0
High Performance Output data format for experimental physics
hipo::datastreamLocalFile Class Reference

Data stream implementation for local file I/O using std::ifstream. More...

#include <datastream.h>

Public Member Functions

 datastreamLocalFile ()
 Default constructor. More...
 
 ~datastreamLocalFile ()
 Destructor; closes the file if open. More...
 
long size ()
 
void open (const char *filename)
 Open a local file for binary reading. More...
 
long position ()
 
long position (long pos)
 Seek to the given byte position. More...
 
int read (char *s, int size)
 Read bytes from the file. More...
 

Detailed Description

Data stream implementation for local file I/O using std::ifstream.

Definition at line 108 of file datastream.h.

Constructor & Destructor Documentation

◆ datastreamLocalFile()

hipo::datastreamLocalFile::datastreamLocalFile ( )

Default constructor.

◆ ~datastreamLocalFile()

hipo::datastreamLocalFile::~datastreamLocalFile ( )
inline

Destructor; closes the file if open.

Definition at line 118 of file datastream.h.

Member Function Documentation

◆ open()

void hipo::datastreamLocalFile::open ( const char *  filename)
inline

Open a local file for binary reading.

Parameters
filenamePath to the file

Definition at line 135 of file datastream.h.

◆ position() [1/2]

long hipo::datastreamLocalFile::position ( )
inline
Returns
Current read position in bytes.

Definition at line 139 of file datastream.h.

◆ position() [2/2]

long hipo::datastreamLocalFile::position ( long  pos)
inline

Seek to the given byte position.

Parameters
posByte offset from the beginning
Returns
The new position

Definition at line 143 of file datastream.h.

◆ read()

int hipo::datastreamLocalFile::read ( char *  s,
int  size 
)
inline

Read bytes from the file.

Parameters
sDestination buffer
sizeNumber of bytes to read
Returns
Number of bytes read

Definition at line 148 of file datastream.h.

◆ size()

long hipo::datastreamLocalFile::size ( )
inline
Returns
Total file size in bytes.

Definition at line 125 of file datastream.h.


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