PrevNextUpHome BREW C++ Class Library & GUI Framework & XML Middleware : SophiaFramework 4.1
SFXBinaryStreamWriter
Class for writing data of binary onto the output stream.
#include <SFXBinaryStreamWriter.h.hpp>
class SFXBinaryStreamWriter : public SFXStreamWriter, public SFXBinaryStream;
SFMTYPEDEFCLASS(SFXBinaryStreamWriter)

Inheritance diagram

 Inheritance diagram of SFXBinaryStreamWriterClass

Collaboration diagram

 Collaboration diagram of SFXBinaryStreamWriterClass

Description

The SFXBinaryStreamWriter class is used to write data of binary onto the output stream such as file, TCP socket, and so on.

Reference

SFXAnsiStringStreamWriter | SFXWideStringStreamWriter

Member

Constructor/Destructor
SFXBinaryStreamWriter( Void )
Constructor of SFXBinaryStreamWriter class.
Public Functions
SFCError WriteAChar( ACharConstPtr string , SInt32 length = -1 )
Write a AChar string of specified length onto the output stream.
SFCError WriteBool( Bool param )
Write data onto the output stream as Bool value.
SFCError WriteFloat32( Float32 param )
Write data onto the output stream as Float32 value.
SFCError WriteFloat64( Float64 param )
Write data onto the output stream as Float64 value.
SFCError WriteSFXAnsiString( SFXAnsiStringConstRef param )
Write data onto the output stream as a SFXAnsiString string.
SFCError WriteSFXWideString( SFXWideStringConstRef param )
Write data to the output stream as a SFXWideString string.
SFCError WriteSInt08( SInt08 param )
Write data onto the output stream as SInt08 value.
SFCError WriteSInt16( SInt16 param )
Write data onto the output stream as SInt16 value.
SFCError WriteSInt32( SInt32 param )
Write data onto the output stream as SInt32 value.
SFCError WriteSInt64( SInt64 param )
Write data onto the output stream as SInt64 value.
SFCError WriteUInt08( UInt08 param )
Write data onto the output stream as UInt08 value.
SFCError WriteUInt16( UInt16 param )
Write data onto the output stream as UInt16 value.
SFCError WriteUInt32( UInt32 param )
Write data onto the output stream as UInt32 value.
SFCError WriteUInt64( UInt64 param )
Write data onto the output stream as UInt64 value.
SFCError WriteWChar( WCharConstPtr string , SInt32 length = -1 )
Write a WChar string of specified length onto the output stream.
SFXBinaryStreamWriterRef operator<( SFXBinaryStreamWriterRef left , SFXBufferConstRef right )
operator<( SFXBinaryStreamWriterRef left , SFXWideStringConstRef right )
operator<( SFXBinaryStreamWriterRef left , SFXAnsiStringConstRef right )
operator<( SFXBinaryStreamWriterRef left , WCharConstPtr right )
operator<( SFXBinaryStreamWriterRef left , ACharConstPtr right )
operator<( SFXBinaryStreamWriterRef left , Float64 right )
operator<( SFXBinaryStreamWriterRef left , Float32 right )
operator<( SFXBinaryStreamWriterRef left , UInt64 right )
operator<( SFXBinaryStreamWriterRef left , SInt64 right )
operator<( SFXBinaryStreamWriterRef left , UInt32 right )
operator<( SFXBinaryStreamWriterRef left , SInt32 right )
operator<( SFXBinaryStreamWriterRef left , UInt16 right )
operator<( SFXBinaryStreamWriterRef left , SInt16 right )
operator<( SFXBinaryStreamWriterRef left , UInt08 right )
operator<( SFXBinaryStreamWriterRef left , SInt08 right )
operator<( SFXBinaryStreamWriterRef left , SFXBinaryStreamWriter::ManipulatorSPP right )
Write data onto the output stream.
Void Attach( SFXOutputStreamPtr stream ) (inherits from SFXStreamWriter)
Delegate the control privilege of SFXOutputStream object to the SFXStreamWriter object.
Void Cancel( Void ) (inherits from SFXStreamWriter)
Call the Cancel function for Storage class. And also unregister the callback functions.
SFXOutputStreamPtr Detach( Void ) (inherits from SFXStreamWriter)
Delegate the control privilege of SFXStreamWriter object to the SFXOutputStream object.
SFCError Flush( Void ) (inherits from SFXStreamWriter)
Flush( CallbackSPP spp , VoidPtr reference ) (inherits from SFXStreamWriter)
Flush the written data.
EndianEnum GetEndian( Void ) (inherits from SFXBinaryStream)
Get the endian.
UInt32 GetWritableSize( Void ) (inherits from SFXStreamWriter)
Get the size of writable data.
Void Release( Void ) (inherits from SFXStreamWriter)
Release the stream.
SFCError ResetTrigger( Void ) (inherits from SFXStreamWriter)
Reset the trigger when the callback function will be called.
Void SetEndian( EndianEnum param ) (inherits from SFXBinaryStream)
Set the endian.
SFCError SetTrigger( UInt32 size ) (inherits from SFXStreamWriter)
SetTrigger( VoidConstPtr buffer , UInt32 size ) (inherits from SFXStreamWriter)
SetTrigger( SFXBufferConstRef buffer ) (inherits from SFXStreamWriter)
Set the trigger when the callback function will be called.
Bool Triggers( Void ) (inherits from SFXStreamWriter)
Check whether the callback function is called by trigger or not.
SFCError Write( SFXBufferConstRef buffer ) (inherits from SFXStreamWriter)
Write( VoidConstPtr buffer , UInt32 size ) (inherits from SFXStreamWriter)
Write data onto the stream.
Void big( SFXBinaryStreamRef stream ) (inherits from SFXBinaryStream)
Manipulator that sets endian to the big endian.
Void little( SFXBinaryStreamRef stream ) (inherits from SFXBinaryStream)
Manipulator that sets endian to the little endian.
Types
CallbackSPP (inherits from SFXStream)
Constant that represents Callback function.
EndianEnum (inherits from SFXBinaryStream)
Constant that represents Endian.
ManipulatorSPP (inherits from SFXBinaryStream)
Constant that represents the manipulator of SFXBinaryStream class.

SFXBinaryStreamWriter::SFXBinaryStreamWriter
Constructor of SFXBinaryStreamWriter class.
[ public, explicit ]
SFXBinaryStreamWriter(Void);

SFXBinaryStreamWriter::WriteAChar
Write a AChar string of specified length onto the output stream.
[ public ]
SFCError WriteAChar(
    ACharConstPtr string   // AChar string
    SInt32 length = -1     // length of string
);

Argument

string

AChar string for writing.

length

If the length has been set to -1, Write the string till the "\0" (contains "\0").

Return value

  • Success : SFERR_NO_ERROR
  • If stream is not set : SFERR_INVALID_STATE
  • If argument is null : SFERR_INVALID_PARAM
  • If insufficient memory : SFERR_NO_MEMORY
  • If failed : SFERR_FAILED

Description

Write a AChar string with a specified length parameter. "\0" is written at the end.

Reference

SFXBinaryStreamWriter::WriteWChar | SFXBinaryStreamWriter::WriteSFXAnsiString | SFXBinaryStreamWriter::WriteSFXWideString


SFXBinaryStreamWriter::WriteBool
Write data onto the output stream as Bool value.
[ public ]
SFCError WriteBool(
    Bool param   // value to write
);

Return value

  • Success : SFERR_NO_ERROR
  • If stream is not set : SFERR_INVALID_STATE
  • If argument is invalid : SFERR_INVALID_PARAM
  • If failed : SFERR_FAILED

Reference

SFXBinaryStreamWriter::WriteSInt08 | SFXBinaryStreamWriter::WriteUInt08


SFXBinaryStreamWriter::WriteFloat32
Write data onto the output stream as Float32 value.
[ public ]
SFCError WriteFloat32(
    Float32 param   // value to write
);

Return value

  • Success : SFERR_NO_ERROR
  • If stream is not set : SFERR_INVALID_STATE
  • If argument is invalid : SFERR_INVALID_PARAM
  • If failed : SFERR_FAILED

Reference

SFXBinaryStreamWriter::WriteFloat64


SFXBinaryStreamWriter::WriteFloat64
Write data onto the output stream as Float64 value.
[ public ]
SFCError WriteFloat64(
    Float64 param   // value to write
);

Return value

  • Success : SFERR_NO_ERROR
  • If stream is not set : SFERR_INVALID_STATE
  • If argument is invalid : SFERR_INVALID_PARAM
  • If failed : SFERR_FAILED

Reference

SFXBinaryStreamWriter::WriteFloat32


SFXBinaryStreamWriter::WriteSFXAnsiString
Write data onto the output stream as a SFXAnsiString string.
[ public ]
SFCError WriteSFXAnsiString(
    SFXAnsiStringConstRef param   // string
);

Return value

  • Success : SFERR_NO_ERROR
  • If stream is not set : SFERR_INVALID_STATE
  • If argument is null : SFERR_INVALID_PARAM
  • If insufficient memory : SFERR_NO_MEMORY
  • If failed : SFERR_FAILED

Description

It will write a "\0" at the end.

Reference

SFXBinaryStreamWriter::WriteAChar | SFXBinaryStreamWriter::WriteWChar | SFXBinaryStreamWriter::WriteSFXWideString


SFXBinaryStreamWriter::WriteSFXWideString
Write data to the output stream as a SFXWideString string.
[ public ]
SFCError WriteSFXWideString(
    SFXWideStringConstRef param   // string
);

Return value

  • Success : SFERR_NO_ERROR
  • If stream is not set : SFERR_INVALID_STATE
  • If argument is null : SFERR_INVALID_PARAM
  • If insufficient memory : SFERR_NO_MEMORY
  • If failed : SFERR_FAILED

Description

"\0" is written at the end.

Reference

SFXBinaryStreamWriter::WriteAChar | SFXBinaryStreamWriter::WriteWChar | SFXBinaryStreamWriter::WriteSFXAnsiString


SFXBinaryStreamWriter::WriteSInt08
Write data onto the output stream as SInt08 value.
[ public ]
SFCError WriteSInt08(
    SInt08 param   // value to write
);

Return value

  • Success : SFERR_NO_ERROR
  • If stream is not set : SFERR_INVALID_STATE
  • If argument is invalid : SFERR_INVALID_PARAM
  • If failed : SFERR_FAILED

Reference

SFXBinaryStreamWriter::WriteUInt08


SFXBinaryStreamWriter::WriteSInt16
Write data onto the output stream as SInt16 value.
[ public ]
SFCError WriteSInt16(
    SInt16 param   // value to write
);

Return value

  • Success : SFERR_NO_ERROR
  • If stream is not set : SFERR_INVALID_STATE
  • If argument is invalid : SFERR_INVALID_PARAM
  • If failed : SFERR_FAILED

Reference

SFXBinaryStreamWriter::WriteUInt16


SFXBinaryStreamWriter::WriteSInt32
Write data onto the output stream as SInt32 value.
[ public ]
SFCError WriteSInt32(
    SInt32 param   // value to write
);

Return value

  • Success : SFERR_NO_ERROR
  • If stream is not set : SFERR_INVALID_STATE
  • If argument is invalid : SFERR_INVALID_PARAM
  • If failed : SFERR_FAILED

Reference

SFXBinaryStreamWriter::WriteUInt32


SFXBinaryStreamWriter::WriteSInt64
Write data onto the output stream as SInt64 value.
[ public ]
SFCError WriteSInt64(
    SInt64 param   // value to write
);

Return value

  • Success : SFERR_NO_ERROR
  • If stream is not set : SFERR_INVALID_STATE
  • If argument is invalid : SFERR_INVALID_PARAM
  • If failed : SFERR_FAILED

Reference

SFXBinaryStreamWriter::WriteUInt64


SFXBinaryStreamWriter::WriteUInt08
Write data onto the output stream as UInt08 value.
[ public ]
SFCError WriteUInt08(
    UInt08 param   // value to write
);

Return value

  • Success : SFERR_NO_ERROR
  • If stream is not set : SFERR_INVALID_STATE
  • If argument is invalid : SFERR_INVALID_PARAM
  • If failed : SFERR_FAILED

Reference

SFXBinaryStreamWriter::WriteSInt08


SFXBinaryStreamWriter::WriteUInt16
Write data onto the output stream as UInt16 value.
[ public ]
SFCError WriteUInt16(
    UInt16 param   // value to write
);

Return value

  • Success : SFERR_NO_ERROR
  • If stream is not set : SFERR_INVALID_STATE
  • If argument is invalid : SFERR_INVALID_PARAM
  • If failed : SFERR_FAILED

Reference

SFXBinaryStreamWriter::WriteSInt16


SFXBinaryStreamWriter::WriteUInt32
Write data onto the output stream as UInt32 value.
[ public ]
SFCError WriteUInt32(
    UInt32 param   // value to write
);

Return value

  • Success : SFERR_NO_ERROR
  • If stream is not set : SFERR_INVALID_STATE
  • If argument is invalid : SFERR_INVALID_PARAM
  • If failed : SFERR_FAILED

Reference

SFXBinaryStreamWriter::WriteSInt32


SFXBinaryStreamWriter::WriteUInt64
Write data onto the output stream as UInt64 value.
[ public ]
SFCError WriteUInt64(
    UInt64 param   // value to write
);

Return value

  • Success : SFERR_NO_ERROR
  • If stream is not set : SFERR_INVALID_STATE
  • If argument is invalid : SFERR_INVALID_PARAM
  • If failed : SFERR_FAILED

Reference

SFXBinaryStreamWriter::WriteSInt64


SFXBinaryStreamWriter::WriteWChar
Write a WChar string of specified length onto the output stream.
[ public ]
SFCError WriteWChar(
    WCharConstPtr string   // WChar string
    SInt32 length = -1     // length of string
);

Argument

string

AChar string for writing.

length

If the length has been set to -1, Write the string till the "\0" (contains "\0").

Return value

  • Success : SFERR_NO_ERROR
  • If stream is not set : SFERR_INVALID_STATE
  • If argument is invalid : SFERR_INVALID_PARAM
  • If insufficient memory : SFERR_NO_MEMORY
  • If failed : SFERR_FAILED

Description

Write a WChar string with a specified length parameter. It will write a "\0" at the end.

Reference

SFXBinaryStreamWriter::WriteAChar | SFXBinaryStreamWriter::WriteSFXAnsiString | SFXBinaryStreamWriter::WriteSFXWideString


SFXBinaryStreamWriter::operator<
Write data onto the output stream.
[ public, friend ]
SFXBinaryStreamWriterRef operator<(
    SFXBinaryStreamWriterRef left   // stream
    SFXBufferConstRef right         // buffer
);
[ public, friend ]
SFXBinaryStreamWriterRef operator<(
    SFXBinaryStreamWriterRef left                 // stream
    SFXBinaryStreamWriter::ManipulatorSPP right   // manipulator
);
[ public, friend ]
SFXBinaryStreamWriterRef operator<(
    SFXBinaryStreamWriterRef left   // stream
    SInt08 right                    // value to write
);
[ public, friend ]
SFXBinaryStreamWriterRef operator<(
    SFXBinaryStreamWriterRef left   // stream
    UInt08 right                    // value to write
);
[ public, friend ]
SFXBinaryStreamWriterRef operator<(
    SFXBinaryStreamWriterRef left   // stream
    SInt16 right                    // value to write
);
[ public, friend ]
SFXBinaryStreamWriterRef operator<(
    SFXBinaryStreamWriterRef left   // stream
    UInt16 right                    // value to write
);
[ public, friend ]
SFXBinaryStreamWriterRef operator<(
    SFXBinaryStreamWriterRef left   // stream
    SInt32 right                    // value to write
);
[ public, friend ]
SFXBinaryStreamWriterRef operator<(
    SFXBinaryStreamWriterRef left   // stream
    UInt32 right                    // value to write
);
[ public, friend ]
SFXBinaryStreamWriterRef operator<(
    SFXBinaryStreamWriterRef left   // stream
    SInt64 right                    // value to write
);
[ public, friend ]
SFXBinaryStreamWriterRef operator<(
    SFXBinaryStreamWriterRef left   // stream
    UInt64 right                    // value to write
);
[ public, friend ]
SFXBinaryStreamWriterRef operator<(
    SFXBinaryStreamWriterRef left   // stream
    Float32 right                   // value to write
);
[ public, friend ]
SFXBinaryStreamWriterRef operator<(
    SFXBinaryStreamWriterRef left   // stream
    Float64 right                   // value to write
);
[ public, friend ]
SFXBinaryStreamWriterRef operator<(
    SFXBinaryStreamWriterRef left   // stream
    ACharConstPtr right             // achar string for writing
);
[ public, friend ]
SFXBinaryStreamWriterRef operator<(
    SFXBinaryStreamWriterRef left   // stream
    WCharConstPtr right             // wchar string for writing
);
[ public, friend ]
SFXBinaryStreamWriterRef operator<(
    SFXBinaryStreamWriterRef left   // stream
    SFXAnsiStringConstRef right     // SFXAnsiString string for writing
);
[ public, friend ]
SFXBinaryStreamWriterRef operator<(
    SFXBinaryStreamWriterRef left   // stream
    SFXWideStringConstRef right     // SFXWideString string for writing
);

Description

For details : API reference of Write functions.

Reference

SFXBinaryStreamWriter::WriteBool | SFXBinaryStreamWriter::WriteSInt08 | SFXBinaryStreamWriter::WriteSInt16 | SFXBinaryStreamWriter::WriteSInt32 | SFXBinaryStreamWriter::WriteSInt64 | SFXBinaryStreamWriter::WriteUInt08 | SFXBinaryStreamWriter::WriteUInt16 | SFXBinaryStreamWriter::WriteUInt32 | SFXBinaryStreamWriter::WriteUInt64 | SFXBinaryStreamWriter::WriteFloat32 | SFXBinaryStreamWriter::WriteFloat64 | SFXBinaryStreamWriter::WriteAChar | SFXBinaryStreamWriter::WriteWChar | SFXBinaryStreamWriter::WriteSFXAnsiString | SFXBinaryStreamWriter::WriteSFXWideString