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

UDomainName Class Reference

Inheritance diagram for UDomainName:

ICU List of all members.

Public Types

enum  Options { Strict, Lenient, Std3 }

Public Member Functions

 this (UText text)
void toAscii (UString dst, Options o=Options.Strict)
void toUnicode (UString dst, Options o=Options.Strict)
void IdnToAscii (UString dst, Options o=Options.Strict)
void IdnToUnicode (UString dst, Options o=Options.Strict)
int compare (UString other, 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

UText text
Handle handle

Static Private Attributes

void * library

Detailed Description

UIDNA API implements the IDNA protocol as defined in the IDNA RFC (http://www.ietf.org/rfc/rfc3490.txt).

The RFC defines 2 operations: toAscii and toUnicode. Domain labels containing non-ASCII code points are required to be processed by toAscii operation before passing it to resolver libraries. Domain names that are obtained from resolver libraries are required to be processed by toUnicode operation before displaying the domain name to the user. IDNA requires that implementations process input strings with Nameprep (http://www.ietf.org/rfc/rfc3491.txt), which is a profile of Stringprep (http://www.ietf.org/rfc/rfc3454.txt), and then with Punycode (http://www.ietf.org/rfc/rfc3492.txt). Implementations of IDNA MUST fully implement Nameprep and Punycode; neither Nameprep nor Punycode are optional.

The input and output of toAscii() and ToUnicode() operations are Unicode and are designed to be chainable, i.e., applying toAscii() or toUnicode() operations multiple times to an input string will yield the same result as applying the operation once.

See this page for full details.

Definition at line 118 of file UDomainName.d.


Member Typedef Documentation

typedef void* Handle [protected, inherited]
 

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

Definition at line 114 of file ICU.d.


Member Enumeration Documentation

enum Options
 

Enumeration values:
Strict 
Lenient 
Std3 

Definition at line 123 of file UDomainName.d.

enum Error [protected, inherited]
 

ICU error codes (the ones which are referenced)

Enumeration values:
OK 
BufferOverflow 

Definition at line 148 of file ICU.d.


Constructor & Destructor Documentation

~this  )  [inline, static]
 

Definition at line 317 of file UDomainName.d.


Member Function Documentation

this UText  text  )  [inline]
 

Definition at line 136 of file UDomainName.d.

void toAscii UString  dst,
Options  o = Options.Strict
[inline]
 

This function implements the ToASCII operation as defined in the IDNA RFC.

This operation is done on single labels before sending it to something that expects ASCII names. A label is an individual part of a domain name. Labels are usually separated by dots; e.g." "www.example.com" is composed of 3 labels "www","example", and "com".

Definition at line 154 of file UDomainName.d.

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

void toUnicode UString  dst,
Options  o = Options.Strict
[inline]
 

This function implements the ToUnicode operation as defined in the IDNA RFC.

This operation is done on single labels before sending it to something that expects Unicode names. A label is an individual part of a domain name. Labels are usually separated by dots; for e.g." "www.example.com" is composed of 3 labels "www","example", and "com".

Definition at line 177 of file UDomainName.d.

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

void IdnToAscii UString  dst,
Options  o = Options.Strict
[inline]
 

Convenience function that implements the IDNToASCII operation as defined in the IDNA RFC.

This operation is done on complete domain names, e.g: "www.example.com". It is important to note that this operation can fail. If it fails, then the input domain name cannot be used as an Internationalized Domain Name and the application should have methods defined to deal with the failure.

Note: IDNA RFC specifies that a conformant application should divide a domain name into separate labels, decide whether to apply allowUnassigned and useSTD3ASCIIRules on each, and then convert. This function does not offer that level of granularity. The options once set will apply to all labels in the domain name

Definition at line 208 of file UDomainName.d.

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

void IdnToUnicode UString  dst,
Options  o = Options.Strict
[inline]
 

Convenience function that implements the IDNToUnicode operation as defined in the IDNA RFC.

This operation is done on complete domain names, e.g: "www.example.com".

Note: IDNA RFC specifies that a conformant application should divide a domain name into separate labels, decide whether to apply allowUnassigned and useSTD3ASCIIRules on each, and then convert. This function does not offer that level of granularity. The options once set will apply to all labels in the domain name

Definition at line 235 of file UDomainName.d.

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

int compare UString  other,
Options  o = Options.Strict
[inline]
 

Compare two IDN strings for equivalence.

This function splits the domain names into labels and compares them. According to IDN RFC, whenever two labels are compared, they are considered equal if and only if their ASCII forms (obtained by applying toASCII) match using an case-insensitive ASCII comparison. Two domain names are considered a match if and only if all labels match regardless of whether label separators match

Definition at line 259 of file UDomainName.d.

References UText::get(), UText::len, and ICU::testError().

this  )  [inline, static]
 

Definition at line 308 of file UDomainName.d.

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

Definition at line 158 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 176 of file ICU.d.

Referenced by UCalendar::add(), USet::applyPattern(), UChar::charFromName(), UNormalize::check(), URegex::clone(), UNormalize::compare(), compare(), UConverter::UTranscoder::convert(), UEnumeration::count(), UConverter::decode(), UConverter::encode(), URegex::end(), UTransform::execute(), USearch::first(), UResourceBundle::get(), UCalendar::get(), UCollator::getAttribute(), UResourceBundle::getBinary(), UCollator::getBound(), UChar::getCharName(), UChar::getComment(), UCollator::getContractions(), URegex::getFlags(), UResourceBundle::getInt(), UResourceBundle::getIntVector(), UCalendar::getLimit(), UResourceBundle::getLocale(), UCalendar::getMillis(), UConverter::getName(), UResourceBundle::getNextString(), URegex::getPattern(), UCollator::getShortDefinitionString(), UResourceBundle::getString(), UCollator::getTailoredSet(), UDateFormat::getTwoDigitYearStart(), UCollator::getVariableTop(), URegex::groupCount(), UCalendar::inDaylightTime(), UNormalize::isNormalized(), USearch::last(), URegex::match(), USearch::next(), URegex::next(), UEnumeration::next(), UCollator::normalizeShortDefinitionString(), UDateFormat::parse(), USearch::previous(), URegex::probe(), URegex::replaceAll(), URegex::replaceFirst(), URegex::reset(), 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(), URegex::setText(), UBreakIterator::setText(), UCalendar::setTimeZone(), UDateFormat::setTwoDigitYearStart(), UCollator::setVariableTop(), URegex::split(), URegex::start(), UTransform::this(), UStringPrep::this(), USet::this(), USearch::this(), UResourceBundle::this(), URegex::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 186 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(), UStringPrep::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 208 of file ICU.d.

References string.

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

Definition at line 230 of file ICU.d.

References strlen().

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

Definition at line 239 of file ICU.d.

References wcslen().

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

Definition at line 248 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 259 of file ICU.d.

References wcslen().


Member Data Documentation

UText text [private]
 

Definition at line 120 of file UDomainName.d.

Handle handle [private]
 

Definition at line 121 of file UDomainName.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 276 of file UDomainName.d.

FunctionLoader Bind [] targets [static]
 

Initial value:

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

Definition at line 295 of file UDomainName.d.


The documentation for this class was generated from the following file:
Generated on Sun Mar 6 00:31:16 2005 for Mango by doxygen 1.3.6