blocxx
BLOCXX_NAMESPACE::Char16 Class Reference

The Char16 class is an abstraction for a double byte character. More...

#include <Char16.hpp>

Public Types

typedef UInt16 Char16::* safe_bool
 

Public Member Functions

 Char16 ()
 Create a new Char16 object with a value of zero.
 
 Char16 (const Char16 &arg)
 Copy constructor.
 
 Char16 (char c)
 Create a new Char16 object from a single byte character.
 
 Char16 (const String &x)
 Create a new Char16 object from the 1st byte of a string.
 
 Char16 (UInt16 val)
 Create a new Char16 object of an unsigned 16 bit value.
 
 Char16 (Int16 val)
 Create a new Char16 object of an signed 16 bit value.
 
 Char16 (UInt8 val)
 Create a new Char16 object of an unsigned 8 bit value.
 
 Char16 (Int8 val)
 Create a new Char16 object of an signed 8 bit value.
 
 Char16 (UInt32 val)
 Create a new Char16 object of an unsigned 32 bit value.
 
 Char16 (Int32 val)
 Create a new Char16 object of an signed 32 bit value.
 
 Char16 (UInt64 val)
 Create a new Char16 object of an unsigned 64 bit value.
 
 Char16 (Int64 val)
 Create a new Char16 object of an signed 64 bit value.
 
 Char16 (Real32 val)
 Create a new Char16 object from a real 32 value.
 
 Char16 (Real64 val)
 Create a new Char16 object from a real 64 value.
 
 Char16 (Bool val)
 Create a new Char16 object from a boolean value.
 
UInt16 getValue () const
 
 operator UInt16 () const
 
Char16operator= (const Char16 &arg)
 Assignment operator.
 
bool operator== (const Char16 &arg) const
 Equality operator.
 
bool operator!= (const Char16 &arg) const
 Inequality operator.
 
bool operator< (const Char16 &arg) const
 Less than operator.
 
bool operator<= (const Char16 &arg) const
 Less than or equal operator.
 
bool operator> (const Char16 &arg) const
 Greater than operator.
 
bool operator>= (const Char16 &arg) const
 Greater than or equal operator.
 
Char16operator+= (const Char16 &arg)
 Add another Char16 object to this one.
 
Char16operator-= (const Char16 &arg)
 Subtract another Char16 object from this one.
 
Char16operator*= (const Char16 &arg)
 Multiply this Char16 object by another.
 
Char16operator/= (const Char16 &arg)
 Divide this Char16 object by another.
 
 operator safe_bool () const
 
bool operator! () const
 
String toUTF8 () const BLOCXX_DEPRECATED
 Deprecated in favor of toString()
 
String toString () const
 Convert this to UTF8.
 
void writeObject (std::streambuf &ostrm) const
 Write this object to an output stream.
 
void readObject (std::streambuf &istrm)
 Read this object from an input stream.
 

Private Attributes

UInt16 m_value
 

Detailed Description

The Char16 class is an abstraction for a double byte character.

Definition at line 56 of file Char16.hpp.

Member Typedef Documentation

◆ safe_bool

typedef UInt16 Char16::* BLOCXX_NAMESPACE::Char16::safe_bool

Definition at line 251 of file Char16.hpp.

Constructor & Destructor Documentation

◆ Char16() [1/15]

BLOCXX_NAMESPACE::Char16::Char16 ( )
inline

Create a new Char16 object with a value of zero.

Definition at line 62 of file Char16.hpp.

References m_value.

Referenced by Char16(), operator safe_bool(), operator!=(), operator*=(), operator+=(), operator-=(), operator/=(), operator<(), operator<=(), operator=(), operator==(), operator>(), and operator>=().

◆ Char16() [2/15]

BLOCXX_NAMESPACE::Char16::Char16 ( const Char16 & arg)
inline

Copy constructor.

Parameters
argThe Char16 object this object will be a copy of.

Definition at line 67 of file Char16.hpp.

References Char16(), and m_value.

◆ Char16() [3/15]

BLOCXX_NAMESPACE::Char16::Char16 ( char c)
inlineexplicit

Create a new Char16 object from a single byte character.

Parameters
cThe character this Char16 object will contain.

Definition at line 72 of file Char16.hpp.

References m_value.

◆ Char16() [4/15]

BLOCXX_NAMESPACE::Char16::Char16 ( const String & x)
explicit

Create a new Char16 object from the 1st byte of a string.

Parameters
xThe string to take the character from that will be contained by this Char16 object.

Definition at line 59 of file Char16.cpp.

References BLOCXX_NAMESPACE::String::c_str(), m_value, and BLOCXX_NAMESPACE::UTF8Utils::UTF8toUCS2().

◆ Char16() [5/15]

BLOCXX_NAMESPACE::Char16::Char16 ( UInt16 val)
inline

Create a new Char16 object of an unsigned 16 bit value.

Note that this constructor is intentionally non-explicit, because implicit conversion from UInt16 is desireable for this class.

Parameters
valThe unsigned 16 bit value this object will contain.

Definition at line 85 of file Char16.hpp.

References m_value.

◆ Char16() [6/15]

BLOCXX_NAMESPACE::Char16::Char16 ( Int16 val)
inlineexplicit

Create a new Char16 object of an signed 16 bit value.

Parameters
valThe signed 16 bit value this object will contain.

Definition at line 90 of file Char16.hpp.

References m_value.

◆ Char16() [7/15]

BLOCXX_NAMESPACE::Char16::Char16 ( UInt8 val)
inlineexplicit

Create a new Char16 object of an unsigned 8 bit value.

Parameters
valThe unsigned 8 bit value this object will contain.

Definition at line 95 of file Char16.hpp.

References m_value.

◆ Char16() [8/15]

BLOCXX_NAMESPACE::Char16::Char16 ( Int8 val)
inlineexplicit

Create a new Char16 object of an signed 8 bit value.

Parameters
valThe signed 8 bit value this object will contain.

Definition at line 100 of file Char16.hpp.

References m_value.

◆ Char16() [9/15]

BLOCXX_NAMESPACE::Char16::Char16 ( UInt32 val)
inlineexplicit

Create a new Char16 object of an unsigned 32 bit value.

Parameters
valThe unsigned 32 bit value this object will contain.

Definition at line 105 of file Char16.hpp.

References m_value.

◆ Char16() [10/15]

BLOCXX_NAMESPACE::Char16::Char16 ( Int32 val)
inlineexplicit

Create a new Char16 object of an signed 32 bit value.

Parameters
valThe signed 32 bit value this object will contain.

Definition at line 110 of file Char16.hpp.

References m_value.

◆ Char16() [11/15]

BLOCXX_NAMESPACE::Char16::Char16 ( UInt64 val)
inlineexplicit

Create a new Char16 object of an unsigned 64 bit value.

Parameters
valThe unsigned 64 bit value this object will contain.

Definition at line 115 of file Char16.hpp.

References m_value.

◆ Char16() [12/15]

BLOCXX_NAMESPACE::Char16::Char16 ( Int64 val)
inlineexplicit

Create a new Char16 object of an signed 64 bit value.

Parameters
valThe signed 64 bit value this object will contain.

Definition at line 120 of file Char16.hpp.

References m_value.

◆ Char16() [13/15]

BLOCXX_NAMESPACE::Char16::Char16 ( Real32 val)
inlineexplicit

Create a new Char16 object from a real 32 value.

Parameters
valThe real 32 value this object will contain.

Definition at line 125 of file Char16.hpp.

References m_value.

◆ Char16() [14/15]

BLOCXX_NAMESPACE::Char16::Char16 ( Real64 val)
inlineexplicit

Create a new Char16 object from a real 64 value.

Parameters
valThe real 64 value this object will contain.

Definition at line 130 of file Char16.hpp.

References m_value.

◆ Char16() [15/15]

BLOCXX_NAMESPACE::Char16::Char16 ( Bool val)
inlineexplicit

Create a new Char16 object from a boolean value.

Parameters
valThe boolean value this object will contain.

Definition at line 135 of file Char16.hpp.

References m_value.

Member Function Documentation

◆ getValue()

◆ operator safe_bool()

BLOCXX_NAMESPACE::Char16::operator safe_bool ( ) const
inline

Definition at line 251 of file Char16.hpp.

References Char16(), m_value, readObject(), toString(), toUTF8(), and writeObject().

◆ operator UInt16()

BLOCXX_NAMESPACE::Char16::operator UInt16 ( ) const
inline
Returns
The value of this object as a unsigned 16 bit value.

Definition at line 143 of file Char16.hpp.

References getValue().

◆ operator!()

bool BLOCXX_NAMESPACE::Char16::operator! ( ) const
inline

Definition at line 251 of file Char16.hpp.

◆ operator!=()

bool BLOCXX_NAMESPACE::Char16::operator!= ( const Char16 & arg) const
inline

Inequality operator.

Parameters
argThe Char16 object to compare this object with.
Returns
true if the given Char16 object is not equal to this one.

Definition at line 168 of file Char16.hpp.

References Char16(), and m_value.

◆ operator*=()

Char16 & BLOCXX_NAMESPACE::Char16::operator*= ( const Char16 & arg)
inline

Multiply this Char16 object by another.

Parameters
argThe Char16 object to multiply this one by.
Returns
A reference to this object.

Definition at line 235 of file Char16.hpp.

References Char16(), and m_value.

◆ operator+=()

Char16 & BLOCXX_NAMESPACE::Char16::operator+= ( const Char16 & arg)
inline

Add another Char16 object to this one.

Parameters
argThe Char16 object to add to this one.
Returns
A reference to this object.

Definition at line 215 of file Char16.hpp.

References Char16(), and m_value.

◆ operator-=()

Char16 & BLOCXX_NAMESPACE::Char16::operator-= ( const Char16 & arg)
inline

Subtract another Char16 object from this one.

Parameters
argThe Char16 object to subtract from this one.
Returns
A reference to this object.

Definition at line 225 of file Char16.hpp.

References Char16(), and m_value.

◆ operator/=()

Char16 & BLOCXX_NAMESPACE::Char16::operator/= ( const Char16 & arg)
inline

Divide this Char16 object by another.

Parameters
argThe Char16 object to divide this one by.
Returns
A reference to this object.

Definition at line 245 of file Char16.hpp.

References Char16(), and m_value.

◆ operator<()

bool BLOCXX_NAMESPACE::Char16::operator< ( const Char16 & arg) const
inline

Less than operator.

Parameters
argThe Char16 object to compare this object with.
Returns
true if this object is less than the given Char16 object.

Definition at line 177 of file Char16.hpp.

References Char16(), and m_value.

◆ operator<=()

bool BLOCXX_NAMESPACE::Char16::operator<= ( const Char16 & arg) const
inline

Less than or equal operator.

Parameters
argThe Char16 object to compare this object with.
Returns
true if this object is less than or equal to the given Char16 object.

Definition at line 187 of file Char16.hpp.

References Char16(), and m_value.

◆ operator=()

Char16 & BLOCXX_NAMESPACE::Char16::operator= ( const Char16 & arg)
inline

Assignment operator.

Parameters
argThe Char16 to assign to this object.
Returns
A reference to this object after the assignment has been made.

Definition at line 149 of file Char16.hpp.

References Char16(), and m_value.

◆ operator==()

bool BLOCXX_NAMESPACE::Char16::operator== ( const Char16 & arg) const
inline

Equality operator.

Parameters
argThe Char16 object to compare this object with.
Returns
true if the given Char16 object is equal to this one.

Definition at line 159 of file Char16.hpp.

References Char16(), and m_value.

◆ operator>()

bool BLOCXX_NAMESPACE::Char16::operator> ( const Char16 & arg) const
inline

Greater than operator.

Parameters
argThe Char16 object to compare this object with.
Returns
true if this object is greater than the given Char16 object.

Definition at line 196 of file Char16.hpp.

References Char16(), and m_value.

◆ operator>=()

bool BLOCXX_NAMESPACE::Char16::operator>= ( const Char16 & arg) const
inline

Greater than or equal operator.

Parameters
argThe Char16 object to compare this object with.
Returns
true if this object is greater than or equal to the given Char16 object.

Definition at line 206 of file Char16.hpp.

References Char16(), and m_value.

◆ readObject()

void BLOCXX_NAMESPACE::Char16::readObject ( std::streambuf & istrm)

Read this object from an input stream.

Parameters
istrmThe input stream to read this object from.

Definition at line 84 of file Char16.cpp.

References m_value, and BLOCXX_NAMESPACE::BinarySerialization::read().

Referenced by operator safe_bool().

◆ toString()

String BLOCXX_NAMESPACE::Char16::toString ( ) const

Convert this to UTF8.

Definition at line 72 of file Char16.cpp.

References m_value, and BLOCXX_NAMESPACE::UTF8Utils::UCS2toUTF8().

Referenced by operator safe_bool(), and BLOCXX_NAMESPACE::StringBuffer::operator+=().

◆ toUTF8()

String BLOCXX_NAMESPACE::Char16::toUTF8 ( ) const

Deprecated in favor of toString()

Definition at line 66 of file Char16.cpp.

References m_value, and BLOCXX_NAMESPACE::UTF8Utils::UCS2toUTF8().

Referenced by operator safe_bool().

◆ writeObject()

void BLOCXX_NAMESPACE::Char16::writeObject ( std::streambuf & ostrm) const

Write this object to an output stream.

Parameters
ostrmThe output stream to write this object to.

Definition at line 78 of file Char16.cpp.

References m_value, and BLOCXX_NAMESPACE::BinarySerialization::write().

Referenced by operator safe_bool().

Member Data Documentation

◆ m_value


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