PIP 5.6.1
Platform-Independent Primitives
Public Member Functions | Static Public Member Functions | Related Functions | List of all members
PIChar Class Reference

Single UTF-16 character. More...

#include <pichar.h>

Public Member Functions

 PIChar (char c)
 Constructs a character from an ASCII byte.
 
 PIChar (uchar c)
 Constructs a character from an ASCII byte.
 
 PIChar (ushort c=0)
 Constructs a character from a UTF-16 code unit.
 
 PIChar (wchar_t c)
 Constructs a character from wchar_t.
 
 PIChar (char16_t c)
 Constructs a character from char16_t.
 
PICharoperator= (const char v)
 Assigns an ASCII byte.
 
PICharoperator= (const wchar_t v)
 Assigns a wchar_t character.
 
bool operator== (const PIChar &o) const
 Returns true if characters are equal.
 
bool operator!= (const PIChar &o) const
 Returns true if characters are not equal.
 
bool operator> (const PIChar &o) const
 Returns true if this character is greater than o.
 
bool operator< (const PIChar &o) const
 Returns true if this character is less than o.
 
bool operator>= (const PIChar &o) const
 Returns true if this character is greater than or equal to o.
 
bool operator<= (const PIChar &o) const
 Returns true if this character is less than or equal to o.
 
bool isDigit () const
 Returns true if the character is a digit.
 
bool isHex () const
 Returns true if the character is a hexadecimal digit.
 
bool isGraphical () const
 Returns true if the character is visible and not a space.
 
bool isControl () const
 Returns true if the character is a control character.
 
bool isLower () const
 Returns true if the character is lowercase.
 
bool isUpper () const
 Returns true if the character is uppercase.
 
bool isPrint () const
 Returns true if the character is printable.
 
bool isSpace () const
 Returns true if the character is whitespace.
 
bool isAlpha () const
 Returns true if the character is alphabetic.
 
bool isAscii () const
 Returns true if the character is ASCII.
 
const wchar_t * toWCharPtr () const
 Returns a wchar_t view of the internal single-character storage.
 
const char * toCharPtr () const
 Returns a char view of the internal single-character storage.
 
wchar_t toWChar () const
 Returns the character as wchar_t.
 
char toAscii () const
 Returns the low ASCII byte of the character.
 
char toConsole1Byte () const
 Returns the character as a single byte in console codepage.
 
char toSystem () const
 Returns the character as a single byte in system codepage.
 
ushort unicode16Code () const
 Returns the UTF-16 code unit of the character.
 
PIChar toUpper () const
 Returns an uppercase copy of the character.
 
PIChar toLower () const
 Returns a lowercase copy of the character.
 

Static Public Member Functions

static PIChar fromConsole (char c)
 Creates a character from a single console-codepage byte.
 
static PIChar fromSystem (char c)
 Creates a character from a single system-codepage byte.
 
static PIChar fromSystem (const char *c)
 Creates a character from the first system-codepage character in c.
 
static PIChar fromUTF8 (const char *c)
 Creates a character from the first UTF-8 character in c.
 

Related Functions

(Note that these are not member functions.)

PICout operator<< (PICout s, const PIChar &v)
 Writes the character to PICout.
 
bool operator== (const char v, const PIChar &c)
 Returns true if the ASCII byte v is equal to c.
 
bool operator> (const char v, const PIChar &c)
 Returns true if the ASCII byte v is greater than c.
 
bool operator< (const char v, const PIChar &c)
 Returns true if the ASCII byte v is less than c.
 
bool operator>= (const char v, const PIChar &c)
 Returns true if the ASCII byte v is greater than or equal to c.
 
bool operator<= (const char v, const PIChar &c)
 Returns true if the ASCII byte v is less than or equal to c.
 
bool operator== (ushort v, const PIChar &c)
 Returns true if the UTF-16 code unit v is equal to c.
 
bool operator> (ushort v, const PIChar &c)
 Returns true if the UTF-16 code unit v is greater than c.
 
bool operator< (ushort v, const PIChar &c)
 Returns true if the UTF-16 code unit v is less than c.
 
bool operator>= (ushort v, const PIChar &c)
 Returns true if the UTF-16 code unit v is greater than or equal to c.
 
bool operator<= (ushort v, const PIChar &c)
 Returns true if the UTF-16 code unit v is less than or equal to c.
 
std::ostream & operator<< (std::ostream &s, const PIChar &v)
 Writes a PIChar to std::ostream.
 

Detailed Description

Single UTF-16 character.

This class is wrapper around UTF16. There are many contructors and information functions