PrevNextUpHome SophiaFramework UNIVERSE 5.3
SFXWideStringStreamWriter
Class for a stream to write the WChar string onto.
#include <SFXWideStringStreamWriter.h.hpp>
class SFXWideStringStreamWriter : public SFXStreamWriter, public SFXStringStream;
SFMTYPEDEFCLASS(SFXWideStringStreamWriter)

Inheritance diagram

 Inheritance diagram of SFXWideStringStreamWriterClass

Collaboration diagram

 Collaboration diagram of SFXWideStringStreamWriterClass

Description

The SFXWideStringStreamWriter class is used to write the string of the WChar type onto the string stream of the storage.

In case of the variable buffer stream, the SFXElasticStreamWriter class is internally used. But you don't have to be aware of this class.

[Caution] Inserter(<< Operator)

In the string stream, the inserter(<< operator) whose right operand is of the SFXBuffer type is not defined. Therefore, the SFXBuffer instance cannot be specified as the right operand.

However, since it is defined in the binary stream, the SFXBuffer instance can be specified as the right operand.

Reference

SFXWideStringStreamReader | SFXAnsiStringStreamWriter | SFXBinaryStreamWriter | SFXElasticStreamWriter | SFXWideString | Character Type | String Stream | Storage

Member

Constructor/Destructor
SFXWideStringStreamWriter( Void )
Constructor of the SFXWideStringStreamWriter class.
Public Functions
SFCError WriteAChar( ACharConstPtr string , SInt32 length = -1 )
Write the specified string onto this stream.
SFCError WriteNull( Void )
Write "\0" onto this stream.
SFCError WriteSFXAnsiString( SFXAnsiStringConstRef param )
Write the specified string onto this stream.
SFCError WriteSFXWideString( SFXWideStringConstRef param )
Write the specified string onto this stream.
SFCError WriteWChar( WCharConstPtr string , SInt32 length = -1 )
Write the specified string onto this stream.
Void ends( SFXWideStringStreamWriterRef stream )
Manipulator for writing "\0" onto this stream.
SFXWideStringStreamWriterRef operator<<( SFXWideStringStreamWriterRef left , SFXWideStringStreamWriter::ManipulatorSPP right )
Write data onto the output stream as a SFXWideString string
SFXWideStringStreamWriterRef operator<<( SFXWideStringStreamWriterRef left , WCharConstPtr right )
Write data onto the output stream as a SFXWideString string
SFXWideStringStreamWriterRef operator<<( SFXWideStringStreamWriterRef left , ACharConstPtr right )
Write data onto the output stream as a SFXWideString string
SFXWideStringStreamWriterRef operator<<( SFXWideStringStreamWriterRef left , SFXWideStringConstRef right )
Write data onto the output stream as a SFXWideString string
SFXWideStringStreamWriterRef operator<<( SFXWideStringStreamWriterRef left , SFXAnsiStringConstRef right )
Write data onto the output stream as a SFXWideString string
Void Attach( SFXOutputStreamPtr stream ) (inherits from SFXStreamWriter)
Attach the specified stream to this stream.
Void Cancel( Void ) (inherits from SFXStreamWriter)
Cancel to write onto this stream.
SFXOutputStreamPtr Detach( Void ) (inherits from SFXStreamWriter)
Detach the stream from this stream.
SFCError Flush( Void ) (inherits from SFXStreamWriter)
Write data in the stream buffer into the storage.
SFCError Flush( CallbackSPP spp , VoidPtr reference ) (inherits from SFXStreamWriter)
Write data in the stream buffer into the storage.
UInt32 GetWritableSize( Void ) (inherits from SFXStreamWriter)
Get the size of data that can be written into this stream. [in bytes]
Void Release( Void ) (inherits from SFXStreamWriter)
Release this stream.
SFCError ResetTrigger( Void ) (inherits from SFXStreamWriter)
Reset the trigger condition that the callback function will be booted up.
SFCError SetTrigger( UInt32 size ) (inherits from SFXStreamWriter)
Set the trigger condition that the callback function will be booted up.
SFCError SetTrigger( SFXBufferConstRef buffer ) (inherits from SFXStreamWriter)
Set the trigger condition that the callback function will be booted up.
SFCError SetTrigger( VoidConstPtr buffer , UInt32 size ) (inherits from SFXStreamWriter)
Set the trigger condition that the callback function will be booted up.
Bool Triggers( Void ) (inherits from SFXStreamWriter)
Check whether or not the callback function is booted up by the trigger condition.
SFCError Write( SFXBufferConstRef buffer ) (inherits from SFXStreamWriter)
Write data onto the stream.
SFCError Write( VoidConstPtr buffer , UInt32 size ) (inherits from SFXStreamWriter)
Write data onto the stream.
Types
ManipulatorSPP
Type that represents the manpulator of the SFXWideStringStreamWriter class.
CallbackSPP (inherits from SFXStream)
Type that represents the callback function.

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

SFXWideStringStreamWriter::WriteAChar
Write the specified string onto this stream.
[ public ]
SFCError WriteAChar(
    ACharConstPtr string   // string to write
    SInt32 length = -1     // length of the string
);

Argument

string

String of AChar type.

length

string length. If specified with "-1", the length is until the "\0"( "\0" is not included ).

Return value

  • If succeeds: SFERR_NO_ERROR
  • If the stream is not set: SFERR_INVALID_STATE
  • If the specified string contains some of the buffer of this stream: SFERR_INVALID_PARAM
  • If insufficient memory: SFERR_NO_MEMORY
  • If the specified string is bigger than the writable size of the buffer of this buffer: SFERR_FAILED

Description

This function writes the specified AChar string of the specified size as the AChar string onto the buffer of this stream.

If "-1" is specified in the length argument, the string until '\0' specified in the string argument ('\0' is not included) will be passed.

[Note] Note

'\0' will not be appended onto the tail of the string.

The SFXBinaryStreamWriter::WriteAChar function of the binary string will append '\0' onto the tail of the string.

Reference

SFXWideStringStreamReader::ReadSFXAnsiString | SFXWideStringStreamWriter::WriteSFXAnsiString | SFXWideStringStreamWriter::WriteWChar | SFXWideStringStreamWriter::WriteSFXWideString | SFXBinaryStreamWriter::WriteWChar | SFXWideString | SFXAnsiString | Character Type


SFXWideStringStreamWriter::WriteNull
Write "\0" onto this stream.
[ public ]
SFCError WriteNull(Void);

Return value

  • If succeeds: SFERR_NO_ERROR
  • If the stream is not set: SFERR_INVALID_STATE
  • If insufficient memory: SFERR_NO_MEMORY
  • If internal buffer is full of data: SFERR_FAILED

Description

This function writes "\0" (2 byte) of the WChar type onto the buffer of this stream.

This function is same as the SFXWideStringStreamWriter::ends function, except it returns the error value.

Reference

SFXWideStringStreamWriter::ends | SFXWideString | Character Type


SFXWideStringStreamWriter::WriteSFXAnsiString
Write the specified string onto this stream.
[ public ]
SFCError WriteSFXAnsiString(
    SFXAnsiStringConstRef param   // string to write
);

Return value

  • If succeeds: SFERR_NO_ERROR
  • If the stream is not set: SFERR_INVALID_STATE
  • If the specified string contains some of the buffer of this stream: SFERR_INVALID_PARAM
  • If insufficient memory: SFERR_NO_MEMORY
  • If the specified string is bigger than the writable size of the buffer of this buffer: SFERR_FAILED

Description

This function writes the specified SFXAnsiString string onto the buffer of this stream.

[Note] Note

"\0" will not be appended onto the tail of the string.

The SFXBinaryStreamWriter::WriteSFXAnsiString function of the binary stream will append '\0' onto the tail of the string automatically.

Reference

SFXWideStringStreamReader::ReadSFXAnsiString | SFXWideStringStreamWriter::WriteAChar | SFXWideStringStreamWriter::WriteWChar | SFXWideStringStreamWriter::WriteSFXWideString | SFXBinaryStreamWriter::WriteSFXWideString | Stream Buffer | SFXWideString | SFXAnsiString | Character Type


SFXWideStringStreamWriter::WriteSFXWideString
Write the specified string onto this stream.
[ public ]
SFCError WriteSFXWideString(
    SFXWideStringConstRef param   // string to write
);

Return value

  • If succeeds: SFERR_NO_ERROR
  • If the stream is not set: SFERR_INVALID_STATE
  • If the specified string contains some of the buffer of this stream: SFERR_INVALID_PARAM
  • If insufficient memory: SFERR_NO_MEMORY
  • If the specified string is bigger than the writable size of the buffer of this buffer: SFERR_FAILED

Description

This function writes the specified SFXWideString string onto the buffer of this stream.

[Note] Note

"\0" will not be appended onto the tail of the string.

The SFXBinaryStreamWriter::WriteSFXWideString function of the binary stream will append '\0' onto the tail of the string automatically.

Reference

SFXWideStringStreamReader::ReadSFXWideString | SFXWideStringStreamWriter::WriteAChar | SFXWideStringStreamWriter::WriteSFXAnsiString | SFXWideStringStreamWriter::WriteWChar | SFXBinaryStreamWriter::WriteSFXWideString | Stream Buffer | SFXWideString | Character Type


SFXWideStringStreamWriter::WriteWChar
Write the specified string onto this stream.
[ public ]
SFCError WriteWChar(
    WCharConstPtr string   // string to write
    SInt32 length = -1     // length of the string
);

Argument

string

String of WChar type.

length

string length. If specified with "-1", the length is until the "\0"( "\0" is not included ).

Return value

  • If succeeds: SFERR_NO_ERROR
  • If the stream is not set: SFERR_INVALID_STATE
  • If the specified string contains some of the buffer of this stream: SFERR_INVALID_PARAM
  • If insufficient memory: SFERR_NO_MEMORY
  • If the specified string is bigger than the writable size of the buffer of this buffer: SFERR_FAILED

Description

This function writes the specified WChar string of the specified size onto the buffer of this stream.

If "-1" is specified in the length argument, the string until '\0' specified in the string argument ('\0' is not included) will be passed.

[Note] Note

'\0' will not be appended onto the tail of the string.

The SFXBinaryStreamWriter::WriteWChar function of the binary string will append '\0' onto the tail of the string.

Reference

SFXWideStringStreamReader::ReadSFXWideString | SFXWideStringStreamWriter::WriteSFXWideString | SFXWideStringStreamWriter::WriteAChar | SFXWideStringStreamWriter::WriteSFXAnsiString | SFXBinaryStreamWriter::WriteWChar | SFXWideString | Character Type


SFXWideStringStreamWriter::ends
Manipulator for writing "\0" onto this stream.
[ public, friend ]
Void ends(
    SFXWideStringStreamWriterRef stream   // stream
);

Description

This function is the manipulator for writing "\0" (2 byte) of the WChar type onto the buffer of this stream.

This function is same as the SFXWideStringStreamWriter::WriteNull function, except that it returns no error value.

Reference

SFXWideStringStreamWriter::WriteNull | Character Type


SFXWideStringStreamWriter::operator<<
Write data onto the output stream as a SFXWideString string
[ public, friend ]
SFXWideStringStreamWriterRef operator<<(
    SFXWideStringStreamWriterRef left                 // stream
    SFXWideStringStreamWriter::ManipulatorSPP right   // manipulator
);
[ public, friend ]
SFXWideStringStreamWriterRef operator<<(
    SFXWideStringStreamWriterRef left   // stream
    WCharConstPtr right                 // string to write
);
[ public, friend ]
SFXWideStringStreamWriterRef operator<<(
    SFXWideStringStreamWriterRef left   // stream
    ACharConstPtr right                 // string to write
);
[ public, friend ]
SFXWideStringStreamWriterRef operator<<(
    SFXWideStringStreamWriterRef left   // stream
    SFXWideStringConstRef right         // string to write
);
[ public, friend ]
SFXWideStringStreamWriterRef operator<<(
    SFXWideStringStreamWriterRef left   // stream
    SFXAnsiStringConstRef right         // string to write
);

Description

This operator is the inserter (<< operator) to write the specified string onto the buffer of this stream.

In case one of the following errors occurs, no data will be written into this stream, no error value will be returned, and nothing will happen.

  • If the stream is not set: SFERR_INVALID_STATE error
  • If the specified string contains some of the buffer of this stream: SFERR_INVALID_PARAM error
  • If insufficient memory: SFERR_NO_MEMORY error
  • If the specified string is bigger than the writable size of the buffer of this buffer: SFERR_FAILED error

* The corresponding alternate function below will return the error value above.

[Note] Alternate Function

Except that the inserter will not return the error value, it is the same as the SFXWideStringStreamWriter::WriteAChar / SFXWideStringStreamWriter::WriteSFXAnsiString / SFXWideStringStreamWriter::WriteWChar / SFXWideStringStreamWriter::WriteSFXWideString function.

[Note] Note

"\0" will not be appended onto the tail of the string.

The SFXBinaryStreamWriter::operator< inserter(<< operator) of the binary stream will append '\0' onto the tail of the string automatically.

Reference

SFXWideStringStreamReader::operator>> | SFXWideStringStreamWriter::WriteAChar | SFXWideStringStreamWriter::WriteSFXAnsiString | SFXWideStringStreamWriter::WriteWChar | SFXWideStringStreamWriter::WriteSFXWideString | SFXWideString | SFXAnsiString | Character Type


SFXWideStringStreamWriter::ManipulatorSPP
Type that represents the manpulator of the SFXWideStringStreamWriter class.
typedef Void(* SFXWideStringStreamWriter::ManipulatorSPP)(SFXWideStringStreamWriterRef stream)