Otclient  14/8/2020
FileStream Class Reference

#include <filestream.h>

Inheritance diagram for FileStream:
Collaboration diagram for FileStream:

Public Member Functions

 FileStream (const std::string &name, PHYSFS_File *fileHandle, bool writeable)
 
 FileStream (const std::string &name, const std::string &buffer)
 
 ~FileStream ()
 
void cache ()
 
void close ()
 
void flush ()
 
void write (const void *buffer, uint count)
 
int read (void *buffer, uint size, uint nmemb=1)
 
void seek (uint pos)
 
void skip (uint len)
 
uint size ()
 
uint tell ()
 
bool eof ()
 
std::string name ()
 
uint8 getU8 ()
 
uint16 getU16 ()
 
uint32 getU32 ()
 
uint64 getU64 ()
 
int8 get8 ()
 
int16 get16 ()
 
int32 get32 ()
 
int64 get64 ()
 
std::string getString ()
 
BinaryTreePtr getBinaryTree ()
 
void startNode (uint8 n)
 
void endNode ()
 
void addU8 (uint8 v)
 
void addU16 (uint16 v)
 
void addU32 (uint32 v)
 
void addU64 (uint64 v)
 
void add8 (int8 v)
 
void add16 (int16 v)
 
void add32 (int32 v)
 
void add64 (int64 v)
 
void addString (const std::string &v)
 
void addPos (uint16 x, uint16 y, uint8 z)
 
void addPoint (const Point &p)
 
FileStreamPtr asFileStream ()
 
- Public Member Functions inherited from LuaObject
 LuaObject ()
 
virtual ~LuaObject ()
 
template<typename T >
void connectLuaField (const std::string &field, const std::function< T > &f, bool pushFront=false)
 
template<typename... T>
int luaCallLuaField (const std::string &field, const T &... args)
 
template<typename R , typename... T>
callLuaField (const std::string &field, const T &... args)
 
template<typename... T>
void callLuaField (const std::string &field, const T &... args)
 
bool hasLuaField (const std::string &field)
 Returns true if the lua field exists. More...
 
template<typename T >
void setLuaField (const std::string &key, const T &value)
 Sets a field in this lua object. More...
 
template<typename T >
getLuaField (const std::string &key)
 Gets a field from this lua object. More...
 
void releaseLuaFieldsTable ()
 Release fields table reference. More...
 
void luaSetField (const std::string &key)
 Sets a field from this lua object, the value must be on the stack. More...
 
void luaGetField (const std::string &key)
 Gets a field from this lua object, the result is pushed onto the stack. More...
 
void luaGetMetatable ()
 Get object's metatable. More...
 
void luaGetFieldsTable ()
 Gets the table containing all stored fields of this lua object, the result is pushed onto the stack. More...
 
int getUseCount ()
 
std::string getClassName ()
 Returns the derived class name, its the same name used in Lua. More...
 
LuaObjectPtr asLuaObject ()
 
void operator= (const LuaObject &)
 
- Public Member Functions inherited from stdext::shared_object
 shared_object ()
 
virtual ~shared_object ()
 
void add_ref ()
 
void dec_ref ()
 
refcount_t ref_count ()
 
template<typename T >
stdext::shared_object_ptr< T > static_self_cast ()
 
template<typename T >
stdext::shared_object_ptr< T > dynamic_self_cast ()
 
template<typename T >
stdext::shared_object_ptr< T > const_self_cast ()
 

Detailed Description

Definition at line 34 of file filestream.h.

Constructor & Destructor Documentation

◆ FileStream() [1/2]

FileStream::FileStream ( const std::string &  name,
PHYSFS_File *  fileHandle,
bool  writeable 
)

Definition at line 29 of file filestream.cpp.

◆ FileStream() [2/2]

FileStream::FileStream ( const std::string &  name,
const std::string &  buffer 
)

Definition at line 38 of file filestream.cpp.

Here is the call graph for this function:

◆ ~FileStream()

FileStream::~FileStream ( )

Definition at line 49 of file filestream.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ add16()

void FileStream::add16 ( int16  v)

Definition at line 412 of file filestream.cpp.

Here is the call graph for this function:

◆ add32()

void FileStream::add32 ( int32  v)

Definition at line 424 of file filestream.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ add64()

void FileStream::add64 ( int64  v)

Definition at line 436 of file filestream.cpp.

Here is the call graph for this function:

◆ add8()

void FileStream::add8 ( int8  v)

Definition at line 401 of file filestream.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ addPoint()

void FileStream::addPoint ( const Point p)
inline

Definition at line 76 of file filestream.h.

Here is the call graph for this function:

◆ addPos()

void FileStream::addPos ( uint16  x,
uint16  y,
uint8  z 
)
inline

Definition at line 75 of file filestream.h.

Here is the call graph for this function:

◆ addString()

void FileStream::addString ( const std::string &  v)

Definition at line 448 of file filestream.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ addU16()

void FileStream::addU16 ( uint16  v)

Definition at line 365 of file filestream.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ addU32()

void FileStream::addU32 ( uint32  v)

Definition at line 377 of file filestream.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ addU64()

void FileStream::addU64 ( uint64  v)

Definition at line 389 of file filestream.cpp.

Here is the call graph for this function:

◆ addU8()

void FileStream::addU8 ( uint8  v)

Definition at line 354 of file filestream.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ asFileStream()

FileStreamPtr FileStream::asFileStream ( )
inline

Definition at line 78 of file filestream.h.

Here is the caller graph for this function:

◆ cache()

void FileStream::cache ( )

Definition at line 58 of file filestream.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ close()

void FileStream::close ( )

Definition at line 78 of file filestream.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ endNode()

void FileStream::endNode ( )

Definition at line 349 of file filestream.cpp.

Here is the call graph for this function:

◆ eof()

bool FileStream::eof ( )

Definition at line 175 of file filestream.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ flush()

void FileStream::flush ( )

Definition at line 90 of file filestream.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get16()

int16 FileStream::get16 ( )

Definition at line 262 of file filestream.cpp.

Here is the call graph for this function:

◆ get32()

int32 FileStream::get32 ( )

Definition at line 278 of file filestream.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get64()

int64 FileStream::get64 ( )

Definition at line 294 of file filestream.cpp.

Here is the call graph for this function:

◆ get8()

int8 FileStream::get8 ( )

Definition at line 246 of file filestream.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getBinaryTree()

BinaryTreePtr FileStream::getBinaryTree ( )

Definition at line 334 of file filestream.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getString()

std::string FileStream::getString ( )

Definition at line 309 of file filestream.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getU16()

uint16 FileStream::getU16 ( )

Definition at line 199 of file filestream.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getU32()

uint32 FileStream::getU32 ( )

Definition at line 215 of file filestream.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getU64()

uint64 FileStream::getU64 ( )

Definition at line 231 of file filestream.cpp.

Here is the call graph for this function:

◆ getU8()

uint8 FileStream::getU8 ( )

Definition at line 183 of file filestream.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ name()

std::string FileStream::name ( )
inline

Definition at line 51 of file filestream.h.

Here is the caller graph for this function:

◆ read()

int FileStream::read ( void *  buffer,
uint  size,
uint  nmemb = 1 
)

Definition at line 109 of file filestream.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ seek()

void FileStream::seek ( uint  pos)

Definition at line 142 of file filestream.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ size()

uint FileStream::size ( )

Definition at line 159 of file filestream.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ skip()

void FileStream::skip ( uint  len)

Definition at line 154 of file filestream.cpp.

Here is the call graph for this function:

◆ startNode()

void FileStream::startNode ( uint8  n)

Definition at line 343 of file filestream.cpp.

Here is the call graph for this function:

◆ tell()

uint FileStream::tell ( )

Definition at line 167 of file filestream.cpp.

Here is the caller graph for this function:

◆ write()

void FileStream::write ( const void *  buffer,
uint  count 
)

Definition at line 130 of file filestream.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

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