Classes | Namespaces | Defines

AbstractOutputStream.h File Reference

#include <zeusbase/System/Interfaces/IOutputStream.hpp>
#include <zeusbase/System/ZObject.h>

Go to the source code of this file.

Classes

class  zeus::TAbstractOutputStream

Namespaces

namespace  zeus

Defines

#define WRITE_PRIMITIVE_DATA(check, data_type, data)
 Makro to write a type specific data to the stream.
#define WRITE_STRING_DATA(check, rData)
 Writes a string.
#define WRITE_ARRAY_DATA(check, rData)
 Writes an array.

Define Documentation

#define WRITE_ARRAY_DATA (   check,
  rData 
)
Value:
Retval retValue = RET_REQUEST_FAILED; \
  if (check) \
  { \
    if (this->writeInt32(rData.getCount()) == RET_NOERROR && \
        this->write(rData.getArray(), rData.getCount()) == RET_NOERROR) \
    { \
      retValue = RET_NOERROR; \
    } \
  } \
  return retValue;

Writes an array.

#define WRITE_PRIMITIVE_DATA (   check,
  data_type,
  data 
)
Value:
Retval retValue = RET_REQUEST_FAILED; \
  if (check) \
  { \
    char* pBuffer = (char*)&data; \
    this->write(pBuffer, sizeof(data_type)); \
    retValue =  RET_NOERROR; \
  } \
  return retValue;

Makro to write a type specific data to the stream.

#define WRITE_STRING_DATA (   check,
  rData 
)
Value:
Retval retValue = RET_REQUEST_FAILED; \
  if (check) \
  { \
    Int iStringSize = rData.getSize()+1; \
    Int iBufferSize = iStringSize * 2; \
    this->writeInt32(iStringSize); \
    TArrayPtr<char> ptrData(new char[iBufferSize], iBufferSize); \
    for (Int i = 0, j = 0; i < iBufferSize; i += 2, j++) \
    { \
      wchar_t wcC1 = rData.getChar(j); \
      ptrData[i] = static_cast<char>(0x00FF & wcC1); \
      ptrData[i+1] = static_cast<char>(0x00FF & (wcC1 >> 8)); \
    } \
    this->write(ptrData.getPointer(), ptrData.getSize()); \
    retValue =  RET_NOERROR; \
  } \
  return retValue;

Writes a string.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


Written by Benjamin Hadorn http://www.xatlantis.ch.
Last change made on Sun Jan 22 2012 15:28:17