Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

UStringPrep Class Reference

Inheritance diagram for UStringPrep:

ICU List of all members.

Public Types

enum  Options { Strict, Lenient }

Public Member Functions

 this (char[] path, char[] filename)
 ~this ()
void prepare (UText src, UString dst, Options o=Options.Strict)

Static Public Member Functions

 this ()
 ~this ()

Static Public Attributes

FunctionLoader Bind[] targets

Private Types

typedef void * Handle
enum  Error { OK, BufferOverflow = 15 }

Static Private Member Functions

bool isError (Error e)
void testError (Error e, char[] msg)
char * toString (char[] string)
wchar * toString (wchar[] string)
uint length (char *s)
uint length (wchar *s)
char[] toArray (char *s)
wchar[] toArray (wchar *s)

Private Attributes

Handle handle

Static Private Attributes

void * library

Detailed Description

StringPrep API implements the StingPrep framework as described by RFC 3454.

StringPrep prepares Unicode strings for use in network protocols. Profiles of StingPrep are set of rules and data according to with the Unicode Strings are prepared. Each profiles contains tables which describe how a code point should be treated. The tables are broadly classied into

The procedure for preparing Unicode strings:

1. Map: For each character in the input, check if it has a mapping and, if so, replace it with its mapping.

2. Normalize: Possibly normalize the result of step 1 using Unicode normalization.

3. Prohibit: Check for any characters that are not allowed in the output. If any are found, return an error.

4. Check bidi: Possibly check for right-to-left characters, and if any are found, make sure that the whole string satisfies the requirements for bidirectional strings. If the string does not satisfy the requirements for bidirectional strings, return an error.

See this page for full details.

Definition at line 133 of file UStringPrep.d.


Member Typedef Documentation

typedef void* Handle [protected, inherited]
 

Use this for the primary argument-type to most ICU functions

Definition at line 63 of file ICU.d.


Member Enumeration Documentation

enum Options
 

Enumeration values:
Strict 
Lenient 

Definition at line 137 of file UStringPrep.d.

enum Error [protected, inherited]
 

ICU error codes (the ones which are referenced)

Enumeration values:
OK 
BufferOverflow 

Definition at line 100 of file ICU.d.


Constructor & Destructor Documentation

~this  )  [inline]
 

Close this profile

Definition at line 173 of file UStringPrep.d.

~this  )  [inline, static]
 

Definition at line 244 of file UStringPrep.d.


Member Function Documentation

this char[]  path,
char[]  filename
[inline]
 

Creates a StringPrep profile from the data file.

path string containing the full path pointing to the directory where the profile reside followed by the package name e.g. "/usr/resource/my_app/profiles/mydata" on a Unix system. if NULL, ICU default data files will be used.

fileName name of the profile file to be opened

Definition at line 159 of file UStringPrep.d.

References ICU::testError(), and ICU::toString().

void prepare UText  src,
UString  dst,
Options  o = Options.Strict
[inline]
 

Prepare the input buffer

This operation maps, normalizes(NFKC), checks for prohited and BiDi characters in the order defined by RFC 3454 depending on the options specified in the profile

Definition at line 188 of file UStringPrep.d.

References UString::format(), UText::get(), and UText::len.

this  )  [inline, static]
 

Definition at line 235 of file UStringPrep.d.

bool isError Error  e  )  [inline, static, protected, inherited]
 

Definition at line 110 of file ICU.d.

Referenced by UConverter::detectSignature(), UString::format(), UCollator::getLocale(), and UConverter::this().

void testError Error  e,
char[]  msg
[inline, static, protected, inherited]
 

Definition at line 128 of file ICU.d.

Referenced by UCalendar::add(), USet::applyPattern(), UChar::charFromName(), UNormalize::check(), UNormalize::compare(), UDomainName::compare(), UConverter::UTranscoder::convert(), UEnumeration::count(), UConverter::decode(), UConverter::encode(), UTransform::execute(), USearch::first(), UResourceBundle::get(), UCalendar::get(), UCollator::getAttribute(), UResourceBundle::getBinary(), UCollator::getBound(), UChar::getCharName(), UChar::getComment(), UCollator::getContractions(), UResourceBundle::getInt(), UResourceBundle::getIntVector(), UCalendar::getLimit(), UResourceBundle::getLocale(), UCalendar::getMillis(), UConverter::getName(), UResourceBundle::getNextString(), UCollator::getShortDefinitionString(), UResourceBundle::getString(), UCollator::getTailoredSet(), UDateFormat::getTwoDigitYearStart(), UCollator::getVariableTop(), UCalendar::inDaylightTime(), UNormalize::isNormalized(), USearch::last(), USearch::next(), UEnumeration::next(), UCollator::normalizeShortDefinitionString(), UDateFormat::parse(), USearch::previous(), UEnumeration::reset(), UCalendar::roll(), UCollator::setAttribute(), USearch::setCollator(), UCalendar::setDate(), UCalendar::setDateTime(), UTransform::setFilter(), USearch::setIterator(), UCalendar::setMillis(), USearch::setOffset(), USearch::setPattern(), UDecimalFormat::setPattern(), UMessageFormat::setPattern(), USearch::setText(), UBreakIterator::setText(), UCalendar::setTimeZone(), UDateFormat::setTwoDigitYearStart(), UCollator::setVariableTop(), UTransform::this(), this(), USet::this(), USearch::this(), UResourceBundle::this(), UNumberFormat::this(), UMessageFormat::this(), UDateFormat::this(), UCollator::this(), UCalendar::this(), UBreakIterator::this(), URuleIterator::this(), and UText::toUtf8().

char* toString char[]  string  )  [inline, static, protected, inherited]
 

Definition at line 138 of file ICU.d.

References string.

Referenced by UChar::charFromName(), UConverter::compareNames(), UCollator::getDisplayName(), UResourceBundle::getResource(), UCollator::getShortDefinitionString(), UResourceBundle::getString(), UCalendar::getTimeZoneName(), UCollator::normalizeShortDefinitionString(), UMessageFormat::setLocale(), this(), UResourceBundle::this(), UDateFormat::this(), UCollator::this(), UBreakIterator::this(), UText::toLower(), and UText::toUpper().

wchar* toString wchar[]  string  )  [inline, static, protected, inherited]
 

Definition at line 160 of file ICU.d.

References string.

uint length char *  s  )  [inline, static, protected, inherited]
 

Definition at line 182 of file ICU.d.

References strlen().

uint length wchar *  s  )  [inline, static, protected, inherited]
 

Definition at line 191 of file ICU.d.

References wcslen().

char [] toArray char *  s  )  [inline, static, protected, inherited]
 

Definition at line 200 of file ICU.d.

References strlen().

Referenced by UConverter::detectSignature(), UResourceBundle::getKey(), UResourceBundle::getLocale(), UMessageFormat::getLocale(), UCollator::getLocale(), UConverter::getName(), UChar::getPropertyName(), UChar::getPropertyValueName(), and UConverter::opApply().

wchar [] toArray wchar *  s  )  [inline, static, protected, inherited]
 

Definition at line 211 of file ICU.d.

References wcslen().


Member Data Documentation

Handle handle [private]
 

Definition at line 135 of file UStringPrep.d.

void* library [static, private]
 

Bind the ICU functions from a shared library. This is complicated by the issues regarding D and DLLs on the Windows platform

Definition at line 207 of file UStringPrep.d.

FunctionLoader Bind [] targets [static]
 

Initial value:

 
                [
                {cast(void**) &usprep_open,             "usprep_open"}

Definition at line 224 of file UStringPrep.d.


The documentation for this class was generated from the following file:
Generated on Tue Jan 25 21:18:45 2005 for Mango by doxygen 1.3.6