Inexor
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Public Attributes | List of all members
utf8stream Struct Reference
Inheritance diagram for utf8stream:
stream

Public Types

enum  { BUFSIZE = 4096 }
 
typedef off_t offset
 

Public Member Functions

 utf8stream ()
 
 ~utf8stream () override
 
bool readbuf (size_t size=BUFSIZE)
 
bool checkheader ()
 
bool open (stream *f, const char *mode, bool needclose)
 
void finishreading ()
 
void stopreading ()
 
void stopwriting ()
 
void close () override
 
bool end () override
 
offset tell () override
 
bool seek (offset off, int whence) override
 
size_t read (void *dst, size_t len) override
 
bool getline (char *dst, size_t len) override
 
size_t write (const void *src, size_t len) override
 
bool flush () override
 
virtual offset rawtell ()
 
virtual offset size ()
 
virtual offset rawsize ()
 
virtual int getchar ()
 
virtual bool putchar (int n)
 
virtual bool putstring (const char *str)
 
virtual bool putline (const char *str)
 
virtual size_t printf (const char *fmt,...) PRINTFARGS(2
 
virtual size_t virtual uint getcrc ()
 
template<class T >
size_t put (const T *v, size_t n)
 
template<class T >
bool put (T n)
 
template<class T >
bool putlil (T n)
 
template<class T >
bool putbig (T n)
 
template<class T >
size_t get (T *v, size_t n)
 
template<class T >
get ()
 
template<class T >
getlil ()
 
template<class T >
getbig ()
 

Public Attributes

streamfile
 
offset pos
 
size_t bufread
 
size_t bufcarry
 
size_t buflen
 
bool reading
 
bool writing
 
bool autoclose
 
uchar buf [BUFSIZE]
 

Member Typedef Documentation

typedef off_t stream::offset
inherited

Member Enumeration Documentation

anonymous enum
Enumerator
BUFSIZE 

Constructor & Destructor Documentation

utf8stream::utf8stream ( )
inline
utf8stream::~utf8stream ( )
inlineoverride

References close().

Member Function Documentation

bool utf8stream::checkheader ( )
inline

References buf, buflen, file, and stream::read().

Referenced by open(), and seek().

void utf8stream::close ( )
inlineoverridevirtual

Implements stream.

References autoclose, DELETEP, file, stopreading(), and stopwriting().

Referenced by ~utf8stream().

bool utf8stream::end ( )
inlineoverridevirtual

Implements stream.

References reading, and writing.

void utf8stream::finishreading ( )
inline

References reading.

bool utf8stream::flush ( )
inlineoverridevirtual

Reimplemented from stream.

References file, and stream::flush().

template<class T >
size_t stream::get ( T *  v,
size_t  n 
)
inlineinherited

References stream::read().

Referenced by streambuf< T >::get().

template<class T >
T stream::get ( )
inlineinherited

References stream::read().

template<class T >
T stream::getbig ( )
inlineinherited

References bigswap().

virtual int stream::getchar ( )
inlinevirtualinherited
virtual size_t virtual uint stream::getcrc ( )
inlinevirtualinherited

Reimplemented in gzstream.

Referenced by load_world(), and loadents().

template<class T >
T stream::getlil ( )
inlineinherited
bool utf8stream::getline ( char *  dst,
size_t  len 
)
inlineoverridevirtual

Reimplemented from stream.

References buf, bufcarry, bufread, BUFSIZE, inexor::rpc::min(), pos, readbuf(), reading, and stopreading().

bool utf8stream::open ( stream f,
const char *  mode,
bool  needclose 
)
inline

References autoclose, checkheader(), f(), file, reading, and writing.

Referenced by openutf8file().

size_t stream::printf ( const char *  fmt,
  ... 
)
virtualinherited
template<class T >
size_t stream::put ( const T *  v,
size_t  n 
)
inlineinherited

References stream::write().

Referenced by streambuf< T >::put().

template<class T >
bool stream::put ( n)
inlineinherited

References stream::write().

template<class T >
bool stream::putbig ( n)
inlineinherited

References bigswap().

Referenced by savepng(), and writepngchunk().

virtual bool stream::putchar ( int  n)
inlinevirtualinherited
template<class T >
bool stream::putlil ( n)
inlineinherited
virtual bool stream::putline ( const char *  str)
inlinevirtualinherited
virtual bool stream::putstring ( const char *  str)
inlinevirtualinherited

Reimplemented in filestream.

References stream::write().

Referenced by stream::putline().

virtual offset stream::rawsize ( )
inlinevirtualinherited

Reimplemented in gzstream.

References stream::size().

virtual offset stream::rawtell ( )
inlinevirtualinherited

Reimplemented in gzstream.

References stream::tell().

Referenced by server::writedemo().

size_t utf8stream::read ( void dst,
size_t  len 
)
inlineoverridevirtual

Reimplemented from stream.

References buf, bufcarry, bufread, BUFSIZE, inexor::rpc::min(), pos, readbuf(), reading, and stopreading().

Referenced by seek().

bool utf8stream::readbuf ( size_t  size = BUFSIZE)
inline
bool utf8stream::seek ( offset  off,
int  whence 
)
inlineoverridevirtual
stream::offset stream::size ( )
virtualinherited
void utf8stream::stopreading ( )
inline

References reading.

Referenced by close(), getline(), read(), and seek().

void utf8stream::stopwriting ( )
inline

References writing.

Referenced by close(), and write().

offset utf8stream::tell ( )
inlineoverridevirtual

Reimplemented from stream.

References pos, reading, and writing.

size_t utf8stream::write ( const void src,
size_t  len 
)
inlineoverridevirtual

Reimplemented from stream.

References encodeutf8(), file, pos, stopwriting(), stream::write(), and writing.

Member Data Documentation

bool utf8stream::autoclose

Referenced by close(), and open().

uchar utf8stream::buf[BUFSIZE]

Referenced by checkheader(), getline(), read(), and readbuf().

size_t utf8stream::bufcarry

Referenced by getline(), read(), readbuf(), and seek().

size_t utf8stream::buflen

Referenced by checkheader(), readbuf(), and seek().

size_t utf8stream::bufread

Referenced by getline(), read(), readbuf(), and seek().

stream* utf8stream::file
offset utf8stream::pos

Referenced by getline(), read(), seek(), tell(), and write().

bool utf8stream::reading
bool utf8stream::writing

Referenced by end(), open(), seek(), stopwriting(), tell(), and write().


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