the_Foundation 1.0
Loading...
Searching...
No Matches
Data Structures | Enumerations | Functions | Variables
stream.h File Reference
#include "defs.h"
#include "object.h"

Data Structures

struct  iStreamClass
 
struct  iStream
 

Enumerations

enum  iStreamByteOrder { littleEndian_StreamByteOrder , bigEndian_StreamByteOrder }
 

Functions

void init_Stream (iStream *)
 
void deinit_Stream (iStream *)
 
void setByteOrder_Stream (iStream *, enum iStreamByteOrder byteOrder)
 
void setVersion_Stream (iStream *, int version)
 
void setSize_Stream (iStream *, size_t size)
 
enum iStreamByteOrder byteOrder_Stream (const iStream *)
 
int version_Stream (const iStream *)
 
void seek_Stream (iStream *, size_t offset)
 
iBlock * read_Stream (iStream *, size_t size)
 
size_t readData_Stream (iStream *, size_t size, void *data_out)
 
size_t readBlock_Stream (iStream *, size_t size, iBlock *data_out)
 
iBlock * readAll_Stream (iStream *)
 
size_t write_Stream (iStream *, const iBlock *data)
 
size_t writeBuffer_Stream (iStream *, const iBuffer *buf)
 
size_t writeData_Stream (iStream *, const void *data, size_t size)
 
void write16_Stream (iStream *, int16_t value)
 
void write32_Stream (iStream *, int32_t value)
 
void write64_Stream (iStream *, int64_t value)
 
int8_t read8_Stream (iStream *)
 
int16_t read16_Stream (iStream *)
 
int32_t read32_Stream (iStream *)
 
int64_t read64_Stream (iStream *)
 
void flush_Stream (iStream *)
 
iString * readString_Stream (iStream *)
 
iStringList * readLines_Stream (iStream *)
 
size_t printf_Stream (iStream *, const char *format,...)
 
size_t writeObject_Stream (iStream *, const iAnyObject *object)
 
iAnyObject * readObject_Stream (iStream *, const iAnyClass *)
 

Variables

iStreamClass Class_Stream
 

Detailed Description

Base class for streams.

Stream reads and writes serialized data. Stream is also a base class for more specialized objects that provide access to a specific kind of data, for example a native file or a memory buffer.

Streams are by default little-endian. The endianness can be changed at any point using the setByteOrder_Stream() method.

Authors
Copyright (c) 2017 Jaakko Keränen jaakk.nosp@m.o.ke.nosp@m.ranen.nosp@m.@iki.nosp@m..fi
License

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.