Urho3D
Public Member Functions | Protected Attributes | List of all members
Urho3D::AbstractFile Class Reference

A common root class for objects that implement both Serializer and Deserializer. More...

#include </home/runner/work/rurho3d.github.io/rurho3d.github.io/urho3d_repo/Source/Urho3D/IO/AbstractFile.h>

Inheritance diagram for Urho3D::AbstractFile:
Urho3D::Deserializer Urho3D::Serializer Urho3D::File Urho3D::MemoryBuffer Urho3D::NamedPipe Urho3D::VectorBuffer

Public Member Functions

 AbstractFile ()
 Construct.
 
 AbstractFile (i64 size)
 Construct.
 
 ~AbstractFile () override=default
 Destruct.
 
virtual void SetName (const String &name)
 Change the file name. Used by the resource system. More...
 
const StringGetName () const override
 Return the file name. More...
 
- Public Member Functions inherited from Urho3D::Deserializer
 Deserializer ()
 Construct with zero size.
 
 Deserializer (i64 size)
 Construct with defined size.
 
virtual ~Deserializer ()
 Destruct.
 
virtual i32 Read (void *dest, i32 size)=0
 Read bytes from the stream. Return number of bytes actually read. More...
 
virtual i64 Seek (i64 position)=0
 Set position from the beginning of the stream. Return actual new position. More...
 
virtual const StringGetName () const
 Return name of the stream. More...
 
virtual hash32 GetChecksum ()
 Return a checksum if applicable. More...
 
virtual bool IsEof () const
 Return whether the end of stream has been reached. More...
 
i64 SeekRelative (i64 delta)
 Set position relative to current position. Return actual new position.
 
i64 GetPosition () const
 Return current position.
 
i64 Tell () const
 Return current position.
 
i64 GetSize () const
 Return size.
 
long long ReadInt64 ()
 Read a 64-bit integer.
 
int ReadInt ()
 Read a 32-bit integer.
 
short ReadShort ()
 Read a 16-bit integer.
 
signed char ReadByte ()
 Read an 8-bit integer.
 
unsigned long long ReadUInt64 ()
 Read a 64-bit unsigned integer.
 
unsigned ReadUInt ()
 Read a 32-bit unsigned integer.
 
unsigned short ReadUShort ()
 Read a 16-bit unsigned integer.
 
u8 ReadUByte ()
 Read an 8-bit unsigned integer.
 
bool ReadBool ()
 Read a bool.
 
float ReadFloat ()
 Read a float.
 
double ReadDouble ()
 Read a double.
 
IntRect ReadIntRect ()
 Read an IntRect.
 
IntVector2 ReadIntVector2 ()
 Read an IntVector2.
 
IntVector3 ReadIntVector3 ()
 Read an IntVector3.
 
Rect ReadRect ()
 Read a Rect.
 
Vector2 ReadVector2 ()
 Read a Vector2.
 
Vector3 ReadVector3 ()
 Read a Vector3.
 
Vector3 ReadPackedVector3 (float maxAbsCoord)
 Read a Vector3 packed into 3 x 16 bits with the specified maximum absolute range.
 
Vector4 ReadVector4 ()
 Read a Vector4.
 
Quaternion ReadQuaternion ()
 Read a quaternion.
 
Quaternion ReadPackedQuaternion ()
 Read a quaternion with each component packed in 16 bits.
 
Matrix3 ReadMatrix3 ()
 Read a Matrix3.
 
Matrix3x4 ReadMatrix3x4 ()
 Read a Matrix3x4.
 
Matrix4 ReadMatrix4 ()
 Read a Matrix4.
 
Color ReadColor ()
 Read a color.
 
BoundingBox ReadBoundingBox ()
 Read a bounding box.
 
String ReadString ()
 Read a null-terminated string.
 
String ReadFileID ()
 Read a four-letter file ID.
 
StringHash ReadStringHash ()
 Read a 32-bit StringHash.
 
Vector< u8 > ReadBuffer ()
 Read a buffer with size encoded as VLE.
 
ResourceRef ReadResourceRef ()
 Read a resource reference.
 
ResourceRefList ReadResourceRefList ()
 Read a resource reference list.
 
Variant ReadVariant ()
 Read a variant.
 
Variant ReadVariant (VariantType type)
 Read a variant whose type is already known.
 
VariantVector ReadVariantVector ()
 Read a variant vector.
 
StringVector ReadStringVector ()
 Read a string vector.
 
VariantMap ReadVariantMap ()
 Read a variant map.
 
unsigned ReadVLE ()
 Read a variable-length encoded unsigned integer, which can use 29 bits maximum.
 
unsigned ReadNetID ()
 Read a 24-bit network object ID.
 
String ReadLine ()
 Read a text line.
 
- Public Member Functions inherited from Urho3D::Serializer
virtual ~Serializer ()
 Destruct.
 
virtual i32 Write (const void *data, i32 size)=0
 Write bytes to the stream. Return number of bytes actually written. More...
 
bool WriteInt64 (long long value)
 Write a 64-bit integer.
 
bool WriteInt (int value)
 Write a 32-bit integer.
 
bool WriteShort (short value)
 Write a 16-bit integer.
 
bool WriteByte (signed char value)
 Write an 8-bit integer.
 
bool WriteUInt64 (unsigned long long value)
 Write a 64-bit unsigned integer.
 
bool WriteUInt (unsigned value)
 Write a 32-bit unsigned integer.
 
bool WriteUShort (unsigned short value)
 Write a 16-bit unsigned integer.
 
bool WriteUByte (unsigned char value)
 Write an 8-bit unsigned integer.
 
bool WriteBool (bool value)
 Write a bool.
 
bool WriteFloat (float value)
 Write a float.
 
bool WriteDouble (double value)
 Write a double.
 
bool WriteIntRect (const IntRect &value)
 Write an IntRect.
 
bool WriteIntVector2 (const IntVector2 &value)
 Write an IntVector2.
 
bool WriteIntVector3 (const IntVector3 &value)
 Write an IntVector3.
 
bool WriteRect (const Rect &value)
 Write a Rect.
 
bool WriteVector2 (const Vector2 &value)
 Write a Vector2.
 
bool WriteVector3 (const Vector3 &value)
 Write a Vector3.
 
bool WritePackedVector3 (const Vector3 &value, float maxAbsCoord)
 Write a Vector3 packed into 3 x 16 bits with the specified maximum absolute range.
 
bool WriteVector4 (const Vector4 &value)
 Write a Vector4.
 
bool WriteQuaternion (const Quaternion &value)
 Write a quaternion.
 
bool WritePackedQuaternion (const Quaternion &value)
 Write a quaternion with each component packed in 16 bits.
 
bool WriteMatrix3 (const Matrix3 &value)
 Write a Matrix3.
 
bool WriteMatrix3x4 (const Matrix3x4 &value)
 Write a Matrix3x4.
 
bool WriteMatrix4 (const Matrix4 &value)
 Write a Matrix4.
 
bool WriteColor (const Color &value)
 Write a color.
 
bool WriteBoundingBox (const BoundingBox &value)
 Write a bounding box.
 
bool WriteString (const String &value)
 Write a null-terminated string.
 
bool WriteFileID (const String &value)
 Write a four-letter file ID. If the string is not long enough, spaces will be appended.
 
bool WriteStringHash (const StringHash &value)
 Write a 32-bit StringHash.
 
bool WriteBuffer (const Vector< unsigned char > &value)
 Write a buffer, with size encoded as VLE.
 
bool WriteResourceRef (const ResourceRef &value)
 Write a resource reference.
 
bool WriteResourceRefList (const ResourceRefList &value)
 Write a resource reference list.
 
bool WriteVariant (const Variant &value)
 Write a variant.
 
bool WriteVariantData (const Variant &value)
 Write a variant without the type information.
 
bool WriteVariantVector (const VariantVector &value)
 Write a variant vector.
 
bool WriteStringVector (const StringVector &value)
 Write a variant vector.
 
bool WriteVariantMap (const VariantMap &value)
 Write a variant map.
 
bool WriteVLE (unsigned value)
 Write a variable-length encoded unsigned integer, which can use 29 bits maximum.
 
bool WriteNetID (unsigned value)
 Write a 24-bit network object ID.
 
bool WriteLine (const String &value)
 Write a text line. Char codes 13 & 10 will be automatically appended.
 

Protected Attributes

String name_
 File name.
 
- Protected Attributes inherited from Urho3D::Deserializer
i64 position_
 Stream position.
 
i64 size_
 Stream size.
 

Detailed Description

A common root class for objects that implement both Serializer and Deserializer.

Member Function Documentation

◆ GetName()

const String & Urho3D::AbstractFile::GetName ( ) const
inlineoverridevirtual

Return the file name.

Reimplemented from Urho3D::Deserializer.

◆ SetName()

virtual void Urho3D::AbstractFile::SetName ( const String name)
inlinevirtual

Change the file name. Used by the resource system.

Reimplemented in Urho3D::NamedPipe.


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