54 std::vector<uint8_t> target;
66 std::vector<std::string> target;
70 target.push_back(line);
85 throw IndexOverflow(__FUNCTION__);
97 throw IndexOverflow(__FUNCTION__);
105 return readSingle<uint8_t>();
109 uint16_t val = readSingle<uint16_t>();
114 uint32_t val = readSingle<uint32_t>();
119 uint16_t val = readSingle<uint16_t>();
124 uint32_t val = readSingle<uint32_t>();
129 std::vector<uint8_t> strVector;
130 strVector.resize(len);
133 std::string ret(strVector.begin(), strVector.end());
147 outbuffer.resize(size);
150 readInto(reinterpret_cast<uint8_t*>(&outbuffer[0]), size);
167 static int32_t endian = 2;
170 endian =
reinterpret_cast<uint8_t*
>(&value)[0];
171 FL_LOG(
_log,
LMsg(
"RawData") <<
"we are on a " << (endian == 1 ?
"little endian" :
"big endian") <<
" machine");
uint16_t read16Big()
reads a uint16_t bigEndian and converts them to the host-byteorder
bool getLine(std::string &buffer)
reads until a \n is encountered or no more data is available
void moveIndex(int32_t offset)
move the current index
std::vector< std::string > getDataInLines()
get the data in distinct lines
Helper class to create log strings out from separate parts Usage: LMsg("some text") << variable << "...
Abstract baseclass - provides data for RawData.
std::vector< uint8_t > getDataInBytes()
get the data as a vector of bytes This does not append a null terminator to the end ...
RawDataSource * m_datasource
static Logger _log(LM_AUDIO)
virtual void readInto(uint8_t *buffer, uint32_t start, uint32_t length)=0
read data from the source
uint32_t getDataLength() const
get the complete datalength
uint8_t read8()
reads 1 byte
virtual uint32_t getSize() const =0
get the complete datasize
uint32_t read32Big()
reads a uint16_t bigEndian and converts them to the host-byteorder
uint32_t getCurrentIndex() const
get the current index
T littleToHost(T value) const
#define FL_LOG(logger, msg)
std::string readString(size_t len)
read a string with len bytes, not assuming a terminating 0 Appends a null terminator character to the...
uint32_t read32Little()
reads a uint16_t littleEndian and converts them to the host-byteorder
void readInto(uint8_t *buffer, size_t len)
read len bytes into buffer
T bigToHost(T value) const
RawData(RawDataSource *datasource)
uint16_t read16Little()
reads a uint16_t littleEndian and converts them to the host-byteorder
void setIndex(uint32_t index)
set the current index
static bool littleEndian()
void read(std::string &outbuffer, int32_t size=-1)
Reads all data into the buffer This does not append a null terminator to the end Created to especiall...