Collection of static helper functions for reading and writing data with SIO. More...
#include <SIO/LCSIO.h>
Static Public Member Functions | |
static SIORecords & | records () |
static void | checkVersion (int versionID) |
Checks the version of the file - oldefile (version < v00-08) are no longer supported. | |
static unsigned int | read (SIO_stream *stream, char **c, int *len=0) |
Read a string from the stream into a dummy buffer. More... | |
static unsigned int | write (SIO_stream *stream, int i) |
This version checks the versionId to be able to read 'old' files with trailing '\00' (version <= 00-02). More... | |
static unsigned int | write (SIO_stream *stream, unsigned int i) |
Write an unsigned int to the stream. | |
static unsigned int | write (SIO_stream *stream, EVENT::long64 i) |
Write a vector size to the stream (needed for AMD64 architectures) More... | |
static unsigned int | write (SIO_stream *stream, float f) |
Write a float to the stream. | |
static unsigned int | write (SIO_stream *stream, const std::string &s) |
Write a string to the stream. More... | |
static std::string | getValidSIOName (const std::string &aName) |
Creates a valid SIO name (basically equivalent to a valid C++ name) by replacing every [. More... | |
static void | seekStream (SIO_stream *stream, EVENT::long64 pos) |
Seek stream to the given absolute position - if pos<0 from end of file. More... | |
Static Public Attributes | |
static const char * | FILE_EXTENSION =".slcio" |
static const bool | COMPRESSION = true |
the compression mode for SIO | |
Collection of static helper functions for reading and writing data with SIO.
Could go to the SIO_functions class. Also defines some constant names for lcio-SIO.
|
static |
Creates a valid SIO name (basically equivalent to a valid C++ name) by replacing every [.
], [] and [/] with underscores and removing all nonalphanumeric characters and adding an 'A' to the beginning, if necessary.
Referenced by SIO::SIOReader::open(), and SIO::SIOWriter::open().
|
static |
Read a string from the stream into a dummy buffer.
Warning the same buffer is used for each call. So the return value needs to be copied to its final memory destination. len holds the length of the string (can contain '\0').
|
static |
Seek stream to the given absolute position - if pos<0 from end of file.
IOException |
Referenced by SIO::LCIORandomAccessMgr::createEventMap(), SIO::SIOWriter::open(), SIO::LCIORandomAccessMgr::readLCIOIndexAt(), SIO::LCIORandomAccessMgr::readLCIORandomAccessAt(), and SIO::LCIORandomAccessMgr::recreateEventMap().
|
static |
This version checks the versionId to be able to read 'old' files with trailing '\00' (version <= 00-02).
Remove this method after a reasonable transition period...Write an int to the stream.
|
static |
Write a vector size to the stream (needed for AMD64 architectures)
Write a 64bit integer to the stream
|
static |
Write a string to the stream.
Writes the length of the string first and adds '\0' to the end.