Ark Server API (ASE) - Wiki
Loading...
Searching...
No Matches
Poco::Ascii Class Reference

#include <Ascii.h>

Public Types

enum  CharacterProperties {
  ACP_CONTROL = 0x0001 , ACP_SPACE = 0x0002 , ACP_PUNCT = 0x0004 , ACP_DIGIT = 0x0008 ,
  ACP_HEXDIGIT = 0x0010 , ACP_ALPHA = 0x0020 , ACP_LOWER = 0x0040 , ACP_UPPER = 0x0080 ,
  ACP_GRAPH = 0x0100 , ACP_PRINT = 0x0200
}
 ASCII character properties. More...
 

Static Public Member Functions

static int properties (int ch)
 
static bool hasSomeProperties (int ch, int properties)
 
static bool hasProperties (int ch, int properties)
 
static bool isAscii (int ch)
 
static bool isSpace (int ch)
 
static bool isDigit (int ch)
 Returns true iff the given character is a whitespace.
 
static bool isHexDigit (int ch)
 Returns true iff the given character is a digit.
 
static bool isPunct (int ch)
 Returns true iff the given character is a hexadecimal digit.
 
static bool isAlpha (int ch)
 Returns true iff the given character is a punctuation character.
 
static bool isAlphaNumeric (int ch)
 Returns true iff the given character is an alphabetic character.

 
static bool isLower (int ch)
 Returns true iff the given character is an alphabetic character.

 
static bool isUpper (int ch)
 
static bool isPrintable (int ch)
 
static int toLower (int ch)
 Returns true iff the given character is printable.
 
static int toUpper (int ch)
 

Static Private Attributes

static const int CHARACTER_PROPERTIES [128]
 

Detailed Description

This class contains enumerations and static utility functions for dealing with ASCII characters and their properties.

The classification functions will also work if non-ASCII character codes are passed to them, but classification will only check for ASCII characters.

This allows the classification methods to be used on the single bytes of a UTF-8 string, without causing assertions or inconsistent results (depending upon the current locale) on bytes outside the ASCII range, as may be produced by Ascii::isSpace(), etc.

Definition at line 27 of file Ascii.h.

Member Enumeration Documentation

◆ CharacterProperties

ASCII character properties.

Enumerator
ACP_CONTROL 
ACP_SPACE 
ACP_PUNCT 
ACP_DIGIT 
ACP_HEXDIGIT 
ACP_ALPHA 
ACP_LOWER 
ACP_UPPER 
ACP_GRAPH 
ACP_PRINT 

Definition at line 44 of file Ascii.h.

Member Function Documentation

◆ hasProperties()

bool Poco::Ascii::hasProperties ( int ch,
int properties )
inlinestatic

Returns true if the given character is within the ASCII range and has at least one of the given properties.

Definition at line 142 of file Ascii.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hasSomeProperties()

bool Poco::Ascii::hasSomeProperties ( int ch,
int properties )
inlinestatic

Return the ASCII character properties for the character with the given ASCII value.

If the character is outside the ASCII range (0 .. 127), 0 is returned.

Definition at line 148 of file Ascii.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isAlpha()

bool Poco::Ascii::isAlpha ( int ch)
inlinestatic

Returns true iff the given character is a punctuation character.

Definition at line 178 of file Ascii.h.

+ Here is the call graph for this function:

◆ isAlphaNumeric()

bool Poco::Ascii::isAlphaNumeric ( int ch)
inlinestatic

Returns true iff the given character is an alphabetic character.

Definition at line 184 of file Ascii.h.

+ Here is the call graph for this function:

◆ isAscii()

bool Poco::Ascii::isAscii ( int ch)
inlinestatic

Returns true if the given character is within the ASCII range and has all of the given properties.

Definition at line 136 of file Ascii.h.

+ Here is the caller graph for this function:

◆ isDigit()

bool Poco::Ascii::isDigit ( int ch)
inlinestatic

Returns true iff the given character is a whitespace.

Definition at line 160 of file Ascii.h.

+ Here is the call graph for this function:

◆ isHexDigit()

bool Poco::Ascii::isHexDigit ( int ch)
inlinestatic

Returns true iff the given character is a digit.

Definition at line 166 of file Ascii.h.

+ Here is the call graph for this function:

◆ isLower()

bool Poco::Ascii::isLower ( int ch)
inlinestatic

Returns true iff the given character is an alphabetic character.

Definition at line 190 of file Ascii.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isPrintable()

bool Poco::Ascii::isPrintable ( int ch)
inlinestatic

Returns true iff the given character is an uppercase alphabetic character.

Definition at line 202 of file Ascii.h.

+ Here is the call graph for this function:

◆ isPunct()

bool Poco::Ascii::isPunct ( int ch)
inlinestatic

Returns true iff the given character is a hexadecimal digit.

Definition at line 172 of file Ascii.h.

+ Here is the call graph for this function:

◆ isSpace()

bool Poco::Ascii::isSpace ( int ch)
inlinestatic

Returns true iff the given character code is within the ASCII range (0 .. 127).

Definition at line 154 of file Ascii.h.

+ Here is the call graph for this function:

◆ isUpper()

bool Poco::Ascii::isUpper ( int ch)
inlinestatic

Returns true iff the given character is a lowercase alphabetic character.

Definition at line 196 of file Ascii.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ properties()

int Poco::Ascii::properties ( int ch)
inlinestatic

Definition at line 127 of file Ascii.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ toLower()

int Poco::Ascii::toLower ( int ch)
inlinestatic

Returns true iff the given character is printable.

Definition at line 208 of file Ascii.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ toUpper()

int Poco::Ascii::toUpper ( int ch)
inlinestatic

If the given character is an uppercase character, return its lowercase counterpart, otherwise return the character.

Definition at line 217 of file Ascii.h.

+ Here is the call graph for this function:

Member Data Documentation

◆ CHARACTER_PROPERTIES

const int Poco::Ascii::CHARACTER_PROPERTIES[128]
staticprivate

If the given character is a lowercase character, return its uppercase counterpart, otherwise return the character.

Definition at line 120 of file Ascii.h.


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