Plasma Engine  2.0
Loading...
Searching...
No Matches
plFileWriterBase Class Reference

#include <FileReaderWriterBase.h>

Inheritance diagram for plFileWriterBase:

Public Member Functions

plString128 GetFilePathAbsolute () const
 Returns the absolute path with which the file was opened (including the prefix of the data directory).
 
plString128 GetFilePathRelative () const
 Returns the relative path of the file within its data directory (excluding the prefix of the data directory).
 
plDataDirectoryTypeGetDataDirectory () const
 Returns the plDataDirectoryType over which this file has been opened.
 
bool IsOpen () const
 Returns true, if the file is currently open.
 
plUInt64 GetFileSize () const
 Returns the current total size of the file.
 
- Public Member Functions inherited from plStreamWriter
 plStreamWriter ()
 Constructor.
 
virtual ~plStreamWriter ()
 Virtual destructor to ensure correct cleanup.
 
virtual plResult WriteBytes (const void *pWriteBuffer, plUInt64 uiBytesToWrite)=0
 Writes a raw number of bytes from the buffer, this is the only method which has to be implemented to fully implement the interface.
 
virtual plResult Flush ()
 Flushes the stream, may be implemented (not necessary to implement the interface correctly) so that user code can ensure that content is written.
 
template<typename T >
plResult WriteWordValue (const T *pWordValue)
 Helper method to write a word value correctly (copes with potentially different endianess)
 
template<typename T >
plResult WriteDWordValue (const T *pDWordValue)
 Helper method to write a dword value correctly (copes with potentially different endianess)
 
template<typename T >
plResult WriteQWordValue (const T *pQWordValue)
 Helper method to write a qword value correctly (copes with potentially different endianess)
 
PL_ALWAYS_INLINE void WriteVersion (plTypeVersion version)
 Writes a type version to the stream.
 
template<typename ArrayType , typename ValueType >
plResult WriteArray (const plArrayBase< ValueType, ArrayType > &array)
 Writes an array of elements to the stream.
 
template<typename ValueType , plUInt16 uiSize>
plResult WriteArray (const plSmallArrayBase< ValueType, uiSize > &array)
 Writes a small array of elements to the stream.
 
template<typename ValueType , plUInt32 uiSize>
plResult WriteArray (const ValueType(&array)[uiSize])
 Writes a C style fixed array.
 
template<typename KeyType , typename Comparer >
plResult WriteSet (const plSetBase< KeyType, Comparer > &set)
 Writes a set.
 
template<typename KeyType , typename ValueType , typename Comparer >
plResult WriteMap (const plMapBase< KeyType, ValueType, Comparer > &map)
 Writes a map.
 
template<typename KeyType , typename ValueType , typename Hasher >
plResult WriteHashTable (const plHashTableBase< KeyType, ValueType, Hasher > &hashTable)
 Writes a hash table (note that the entry order might change on read)
 
plResult WriteString (const plStringView sStringView)
 Writes a string.
 

Protected Member Functions

plDataDirectoryWriterGetFileWriter (plStringView sFile, plFileShareMode::Enum FileShareMode, bool bAllowFileEvents)
 

Protected Attributes

plDataDirectoryWriterm_pDataDirWriter
 

Detailed Description

The base class for all file writers. Provides access to plFileSystem::GetFileWriter, which is necessary to get access to the streams that plDataDirectoryType's provide. Derive from this class if you want to implement different policies on how to write files. E.g. the default writer (plFileWriter) implements a buffered write policy (using an internal cache).


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