Back to index

nux  3.0.0
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes
nux::NSerializer Class Reference

#include <NSerializer.h>

Inheritance diagram for nux::NSerializer:
Inheritance graph
[legend]

List of all members.

Public Types

enum  {
  OutputErrorIfFail = 0x01, NoOverWrite = 0x02, OverWriteReadOnly = 0x04, Unbuffered = 0x08,
  Append = 0x10, Read = 0x20, Write = 0x40
}
enum  SeekPos { SeekStart = 0x00, SeekCurrent = 0x01, SeekEnd = 0x02 }

Public Member Functions

virtual ~NSerializer ()
virtual void SerializeFinal (void *V, long long Length)=0
virtual bool isReader ()=0
virtual bool isWriter ()=0
virtual long long Tell ()=0
virtual long long GetFileSize ()
virtual long long Seek (long long FilePos, NSerializer::SeekPos)=0
virtual bool Precache (INT PrecacheOffset, INT PrecacheSize)
virtual void Flush ()
virtual bool Close ()=0
virtual bool GetError ()
NSerializerByteOrderSerialize (void *V, INT Length)
 NSerializer ()
NUX_INLINE bool IsError () const
virtual void Serialize (char &data)
virtual void Serialize (wchar_t &data)
virtual void Serialize (bool &data)
virtual void Serialize (unsigned char &data)
virtual void Serialize (unsigned short &data)
virtual void Serialize (short &data)
virtual void Serialize (unsigned int &data)
virtual void Serialize (int &data)
virtual void Serialize (long &data)
virtual void Serialize (unsigned long &data)
virtual void Serialize (float &data)
virtual void Serialize (double &data)
virtual void Serialize (unsigned long long &data)
virtual void Serialize (long long &data)
virtual void Serialize (wchar_t *buffer, unsigned int len, unsigned int stride=sizeof(wchar_t))
virtual void Serialize (bool *buffer, unsigned int len, unsigned int stride=sizeof(bool))
virtual void Serialize (char *buffer, unsigned int len, unsigned int stride=sizeof(char))
virtual void Serialize (unsigned char *buffer, unsigned int len, unsigned int stride=sizeof(unsigned char))
virtual void Serialize (unsigned short *buffer, unsigned int len, unsigned int stride=sizeof(unsigned short))
virtual void Serialize (short *buffer, unsigned int len, unsigned int stride=sizeof(short))
virtual void Serialize (unsigned int *buffer, unsigned int len, unsigned int stride=sizeof(unsigned int))
virtual void Serialize (int *buffer, unsigned int len, unsigned int stride=sizeof(int))
virtual void Serialize (long *buffer, unsigned int len, unsigned int stride=sizeof(long))
virtual void Serialize (unsigned long *buffer, unsigned int len, unsigned int stride=sizeof(unsigned long))
virtual void Serialize (float *buffer, unsigned int len, unsigned int stride=sizeof(float))
virtual void Serialize (double *buffer, unsigned int len, unsigned int stride=sizeof(double))
virtual void Serialize (unsigned long long *buffer, unsigned int len, unsigned int stride=sizeof(unsigned long long))
virtual void Serialize (long long *buffer, unsigned int len, unsigned int stride=sizeof(long long))
virtual void Identify (const char *name)
virtual void Begin ()
virtual void End ()

Protected Member Functions

void Reset (void)

Protected Attributes

bool m_ErrorCode

Detailed Description

Definition at line 29 of file NSerializer.h.


Member Enumeration Documentation

anonymous enum
Enumerator:
OutputErrorIfFail 
NoOverWrite 
OverWriteReadOnly 
Unbuffered 
Append 
Read 
Write 

Definition at line 32 of file NSerializer.h.

    {
      OutputErrorIfFail   = 0x01,
      NoOverWrite         = 0x02,
      OverWriteReadOnly   = 0x04,
      Unbuffered          = 0x08,
      Append                    = 0x10,
      Read                = 0x20,
      Write               = 0x40,
    };
Enumerator:
SeekStart 
SeekCurrent 
SeekEnd 

Definition at line 43 of file NSerializer.h.

    {
      SeekStart           = 0x00,
      SeekCurrent         = 0x01,
      SeekEnd             = 0x02,
    } SeekPos;

Constructor & Destructor Documentation

virtual nux::NSerializer::~NSerializer ( ) [inline, virtual]

Definition at line 51 of file NSerializer.h.

{}

Definition at line 101 of file NSerializer.h.

    {
      Reset();
    }

Here is the call graph for this function:


Member Function Documentation

virtual void nux::NSerializer::Begin ( ) [inline, virtual]

Definition at line 142 of file NSerializer.h.

{};
NSerializer& nux::NSerializer::ByteOrderSerialize ( void *  V,
INT  Length 
) [inline]

Definition at line 81 of file NSerializer.h.

    {
      BOOL SwapBytes = 0;

      if ( SwapBytes )
      {
        // Transferring between memory and file, so flip the byte order.
        for ( INT i = Length - 1; i >= 0; i-- )
          Serialize ( (unsigned char *) V + i, 1 );
      }
      else
      {
        // Transferring around within memory, so keep the byte order.
        Serialize ( (unsigned char *) V, Length);
      }

      return *this;
    }

Here is the call graph for this function:

virtual bool nux::NSerializer::Close ( ) [pure virtual]

Implemented in nux::NGNUSerialFileWriter, and nux::NGNUSerialFileReader.

Here is the caller graph for this function:

virtual void nux::NSerializer::End ( ) [inline, virtual]

Definition at line 143 of file NSerializer.h.

{};
virtual void nux::NSerializer::Flush ( ) [inline, virtual]

Reimplemented in nux::NGNUSerialFileWriter.

Definition at line 74 of file NSerializer.h.

{};

Here is the caller graph for this function:

virtual bool nux::NSerializer::GetError ( ) [inline, virtual]

Definition at line 76 of file NSerializer.h.

    {
      return m_ErrorCode;
    }
virtual long long nux::NSerializer::GetFileSize ( ) [inline, virtual]

Reimplemented in nux::NGNUSerialFileWriter, and nux::NGNUSerialFileReader.

Definition at line 65 of file NSerializer.h.

    {
      return -1;
    }

Here is the caller graph for this function:

virtual void nux::NSerializer::Identify ( const char *  name) [inline, virtual]

Definition at line 141 of file NSerializer.h.

{};
NUX_INLINE bool nux::NSerializer::IsError ( ) const [inline]

Definition at line 106 of file NSerializer.h.

    {
      return m_ErrorCode;
    }

Here is the caller graph for this function:

virtual bool nux::NSerializer::isReader ( ) [pure virtual]
virtual bool nux::NSerializer::isWriter ( ) [pure virtual]
virtual bool nux::NSerializer::Precache ( INT  PrecacheOffset,
INT  PrecacheSize 
) [inline, virtual]

Definition at line 70 of file NSerializer.h.

    {
      return TRUE;
    }
void nux::NSerializer::Reset ( void  ) [inline, protected]

Definition at line 146 of file NSerializer.h.

    {
      m_ErrorCode = FALSE;
    }

Here is the caller graph for this function:

virtual long long nux::NSerializer::Seek ( long long  FilePos,
NSerializer::SeekPos   
) [pure virtual]
void nux::NSerializer::Serialize ( char &  data) [virtual]

Definition at line 50 of file NSerializer.cpp.

  {
    SerializeFinal (&data, sizeof (char)   );
  }

Here is the call graph for this function:

Here is the caller graph for this function:

void nux::NSerializer::Serialize ( wchar_t &  data) [virtual]

Definition at line 55 of file NSerializer.cpp.

  {
    SerializeFinal (&data, sizeof (wchar_t)   );
  }

Here is the call graph for this function:

void nux::NSerializer::Serialize ( bool &  data) [virtual]

Definition at line 60 of file NSerializer.cpp.

  {
    SerializeFinal (&data, sizeof (bool)    );
  }

Here is the call graph for this function:

void nux::NSerializer::Serialize ( unsigned char &  data) [virtual]

Definition at line 65 of file NSerializer.cpp.

  {
    SerializeFinal (&data, sizeof (unsigned char)      );
  }

Here is the call graph for this function:

void nux::NSerializer::Serialize ( unsigned short &  data) [virtual]

Definition at line 70 of file NSerializer.cpp.

  {
    SerializeFinal (&data, sizeof (unsigned short)     );
  }

Here is the call graph for this function:

void nux::NSerializer::Serialize ( short &  data) [virtual]

Definition at line 74 of file NSerializer.cpp.

  {
    SerializeFinal (&data, sizeof (short)     );
  }

Here is the call graph for this function:

void nux::NSerializer::Serialize ( unsigned int &  data) [virtual]

Definition at line 78 of file NSerializer.cpp.

  {
    SerializeFinal (&data, sizeof (unsigned int)  );
  }

Here is the call graph for this function:

void nux::NSerializer::Serialize ( int &  data) [virtual]

Definition at line 82 of file NSerializer.cpp.

  {
    SerializeFinal (&data, sizeof (int)   );
  }

Here is the call graph for this function:

void nux::NSerializer::Serialize ( long &  data) [virtual]

Definition at line 86 of file NSerializer.cpp.

  {
    SerializeFinal (&data, sizeof (long)    );
  }

Here is the call graph for this function:

void nux::NSerializer::Serialize ( unsigned long &  data) [virtual]

Definition at line 90 of file NSerializer.cpp.

  {
    SerializeFinal (&data, sizeof (unsigned long)   );
  }

Here is the call graph for this function:

void nux::NSerializer::Serialize ( float &  data) [virtual]

Definition at line 94 of file NSerializer.cpp.

  {
    SerializeFinal (&data, sizeof (float)   );
  }

Here is the call graph for this function:

void nux::NSerializer::Serialize ( double &  data) [virtual]

Definition at line 98 of file NSerializer.cpp.

  {
    SerializeFinal (&data, sizeof (double)  );
  }

Here is the call graph for this function:

void nux::NSerializer::Serialize ( unsigned long long &  data) [virtual]

Definition at line 102 of file NSerializer.cpp.

  {
    SerializeFinal (&data, sizeof (unsigned long long)     );
  }

Here is the call graph for this function:

void nux::NSerializer::Serialize ( long long &  data) [virtual]

Definition at line 106 of file NSerializer.cpp.

  {
    SerializeFinal (&data, sizeof (long long)     );
  }

Here is the call graph for this function:

void nux::NSerializer::Serialize ( wchar_t *  buffer,
unsigned int  len,
unsigned int  stride = sizeof (wchar_t) 
) [virtual]

Definition at line 111 of file NSerializer.cpp.

  {
    SerializeFinal (buffer, len * stride);
  }

Here is the call graph for this function:

void nux::NSerializer::Serialize ( bool *  buffer,
unsigned int  len,
unsigned int  stride = sizeof (bool) 
) [virtual]

Definition at line 115 of file NSerializer.cpp.

  {
    SerializeFinal (buffer, len * stride);
  }

Here is the call graph for this function:

void nux::NSerializer::Serialize ( char *  buffer,
unsigned int  len,
unsigned int  stride = sizeof (char) 
) [virtual]

Definition at line 119 of file NSerializer.cpp.

  {
    SerializeFinal (buffer, len * stride);
  }

Here is the call graph for this function:

void nux::NSerializer::Serialize ( unsigned char *  buffer,
unsigned int  len,
unsigned int  stride = sizeof (unsigned char) 
) [virtual]

Definition at line 123 of file NSerializer.cpp.

  {
    SerializeFinal (buffer, len * stride);
  }

Here is the call graph for this function:

void nux::NSerializer::Serialize ( unsigned short *  buffer,
unsigned int  len,
unsigned int  stride = sizeof (unsigned short) 
) [virtual]

Definition at line 127 of file NSerializer.cpp.

  {
    SerializeFinal (buffer, len * stride);
  }

Here is the call graph for this function:

void nux::NSerializer::Serialize ( short *  buffer,
unsigned int  len,
unsigned int  stride = sizeof (short) 
) [virtual]

Definition at line 131 of file NSerializer.cpp.

  {
    SerializeFinal (buffer, len * stride);
  }

Here is the call graph for this function:

void nux::NSerializer::Serialize ( unsigned int *  buffer,
unsigned int  len,
unsigned int  stride = sizeof (unsigned int) 
) [virtual]

Definition at line 135 of file NSerializer.cpp.

  {
    SerializeFinal (buffer, len * stride);
  }

Here is the call graph for this function:

void nux::NSerializer::Serialize ( int *  buffer,
unsigned int  len,
unsigned int  stride = sizeof (int) 
) [virtual]

Definition at line 139 of file NSerializer.cpp.

  {
    SerializeFinal (buffer, len * stride);
  }

Here is the call graph for this function:

void nux::NSerializer::Serialize ( long *  buffer,
unsigned int  len,
unsigned int  stride = sizeof (long) 
) [virtual]

Definition at line 143 of file NSerializer.cpp.

  {
    SerializeFinal (buffer, len * stride);
  }

Here is the call graph for this function:

void nux::NSerializer::Serialize ( unsigned long *  buffer,
unsigned int  len,
unsigned int  stride = sizeof (unsigned long) 
) [virtual]

Definition at line 147 of file NSerializer.cpp.

  {
    SerializeFinal (buffer, len * stride);
  }

Here is the call graph for this function:

void nux::NSerializer::Serialize ( float *  buffer,
unsigned int  len,
unsigned int  stride = sizeof (float) 
) [virtual]

Definition at line 151 of file NSerializer.cpp.

  {
    SerializeFinal (buffer, len * stride);
  }

Here is the call graph for this function:

void nux::NSerializer::Serialize ( double *  buffer,
unsigned int  len,
unsigned int  stride = sizeof (double) 
) [virtual]

Definition at line 155 of file NSerializer.cpp.

  {
    SerializeFinal (buffer, len * stride);
  }

Here is the call graph for this function:

void nux::NSerializer::Serialize ( unsigned long long *  buffer,
unsigned int  len,
unsigned int  stride = sizeof (unsigned long long) 
) [virtual]

Definition at line 159 of file NSerializer.cpp.

  {
    SerializeFinal (buffer, len * stride);
  }

Here is the call graph for this function:

void nux::NSerializer::Serialize ( long long *  buffer,
unsigned int  len,
unsigned int  stride = sizeof (long long) 
) [virtual]

Definition at line 163 of file NSerializer.cpp.

  {
    SerializeFinal (buffer, len * stride);
  }

Here is the call graph for this function:

virtual void nux::NSerializer::SerializeFinal ( void *  V,
long long  Length 
) [pure virtual]

Implemented in nux::NGNUSerialFileWriter, and nux::NGNUSerialFileReader.

Here is the caller graph for this function:

virtual long long nux::NSerializer::Tell ( ) [pure virtual]

Member Data Documentation

Definition at line 150 of file NSerializer.h.


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