USet Class Reference
Inheritance diagram for USet:
List of all members.
|
Public Types |
enum | Options { None = 0,
IgnoreSpace = 1,
CaseInsensitive = 2
} |
Public Member Functions |
| this (wchar start, wchar end) |
| this (UText pattern, Options o=Options.None) |
package | this (Handle handle) |
| ~this () |
void | applyPattern (UText pattern, Options o=Options.None) |
void | toPattern (UString dst, bool escape) |
void | add (wchar c) |
void | addSet (USet other) |
void | addRange (wchar start, wchar end) |
void | addString (UText t) |
void | remove (wchar c) |
void | removeRange (wchar start, wchar end) |
void | removeString (UText t) |
void | complement () |
void | clear () |
bool | isEmpty () |
bool | contains (wchar c) |
bool | containsRange (wchar start, wchar end) |
bool | containsString (UText t) |
uint | size () |
Static Public Member Functions |
| this () |
| ~this () |
Public Attributes |
package Handle | handle |
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) |
Static Private Attributes |
void * | library |
Detailed Description
A mutable set of Unicode characters and multicharacter strings.
Objects of this class represent character classes used in regular expressions. A character specifies a subset of Unicode code points. Legal code points are U+0000 to U+10FFFF, inclusive.
UnicodeSet supports two APIs. The first is the operand API that allows the caller to modify the value of a UnicodeSet object. It conforms to Java 2's java.util.Set interface, although UnicodeSet does not actually implement that interface. All methods of Set are supported, with the modification that they take a character range or single character instead of an Object, and they take a UnicodeSet instead of a Collection. The operand API may be thought of in terms of boolean logic: a boolean OR is implemented by add, a boolean AND is implemented by retain, a boolean XOR is implemented by complement taking an argument, and a boolean NOT is implemented by complement with no argument. In terms of traditional set theory function names, add is a union, retain is an intersection, remove is an asymmetric difference, and complement with no argument is a set complement with respect to the superset range MIN_VALUE-MAX_VALUE
The second API is the applyPattern()/toPattern() API from the java.text.Format-derived classes. Unlike the methods that add characters, add categories, and control the logic of the set, the method applyPattern() sets all attributes of a UnicodeSet at once, based on a string pattern.
See this page for full details.
Definition at line 124 of file USet.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
|
- Enumeration values:
-
None |
|
IgnoreSpace |
|
CaseInsensitive |
|
Definition at line 128 of file USet.d. |
enum Error [protected, inherited]
|
|
|
ICU error codes (the ones which are referenced) - Enumeration values:
-
Definition at line 148 of file ICU.d. |
Constructor & Destructor Documentation
|
Disposes of the storage used by a USet object
Definition at line 180 of file USet.d. |
~this |
( |
|
) |
[inline, static] |
|
Member Function Documentation
this |
( |
wchar |
start, |
|
|
wchar |
end |
|
) |
[inline] |
|
|
Creates a USet object that contains the range of characters start..end, inclusive
Definition at line 143 of file USet.d. |
|
Creates a set from the given pattern. See the UnicodeSet class description for the syntax of the pattern language
Definition at line 155 of file USet.d.
References ICU::testError(). |
package this |
( |
Handle |
handle |
) |
[inline] |
|
|
Modifies the set to represent the set specified by the given pattern. See the UnicodeSet class description for the syntax of the pattern language. See also the User Guide chapter about UnicodeSet. Empties the set passed before applying the pattern.
Definition at line 195 of file USet.d.
References UText::get(), UText::len, and ICU::testError(). |
void toPattern |
( |
UString |
dst, |
|
|
bool |
escape |
|
) |
[inline] |
|
|
Returns a string representation of this set. If the result of calling this function is passed to a uset_openPattern(), it will produce another set that is equal to this one.
Definition at line 211 of file USet.d.
References UString::format(), and len. |
void add |
( |
wchar |
c |
) |
[inline] |
|
|
Adds the given character to the given USet. After this call, contains (c) will return true.
Definition at line 228 of file USet.d. |
void addSet |
( |
USet |
other |
) |
[inline] |
|
|
Adds all of the elements in the specified set to this set if they're not already present. This operation effectively modifies this set so that its value is the union of the two sets. The behavior of this operation is unspecified if the specified collection is modified while the operation is in progress.
Definition at line 244 of file USet.d.
References handle. |
void addRange |
( |
wchar |
start, |
|
|
wchar |
end |
|
) |
[inline] |
|
|
Adds the given range of characters to the given USet. After this call, contains(start, end) will return true
Definition at line 256 of file USet.d. |
void addString |
( |
UText |
t |
) |
[inline] |
|
|
Adds the given string to the given USet. After this call, containsString (str, strLen) will return true
Definition at line 268 of file USet.d.
References UText::get(), and UText::len. |
void remove |
( |
wchar |
c |
) |
[inline] |
|
|
Removes the given character from this USet. After the call, contains(c) will return false
Definition at line 280 of file USet.d. |
void removeRange |
( |
wchar |
start, |
|
|
wchar |
end |
|
) |
[inline] |
|
|
Removes the given range of characters from this USet. After the call, contains(start, end) will return false
Definition at line 292 of file USet.d. |
void removeString |
( |
UText |
t |
) |
[inline] |
|
|
Removes the given string from this USet. After the call, containsString (str, strLen) will return false
Definition at line 304 of file USet.d.
References UText::get(), and UText::len. |
void complement |
( |
|
) |
[inline] |
|
|
Inverts this set. This operation modifies this set so that its value is its complement. This operation does not affect the multicharacter strings, if any
Definition at line 317 of file USet.d. |
|
Removes all of the elements from this set. This set will be empty after this call returns.
Definition at line 329 of file USet.d. |
bool isEmpty |
( |
|
) |
[inline] |
|
|
Returns true if this USet contains no characters and no strings
Definition at line 341 of file USet.d. |
bool contains |
( |
wchar |
c |
) |
[inline] |
|
|
Returns true if this USet contains the given character
Definition at line 352 of file USet.d. |
bool containsRange |
( |
wchar |
start, |
|
|
wchar |
end |
|
) |
[inline] |
|
|
Returns true if this USet contains all characters c where start <= c && c <= end
Definition at line 364 of file USet.d. |
bool containsString |
( |
UText |
t |
) |
[inline] |
|
this |
( |
|
) |
[inline, static] |
|
bool isError |
( |
Error |
e |
) |
[inline, static, protected, inherited] |
|
void testError |
( |
Error |
e, |
|
|
char[] |
msg |
|
) |
[inline, static, protected, inherited] |
|
|
Definition at line 176 of file ICU.d.
Referenced by UCalendar::add(), applyPattern(), UChar::charFromName(), UNormalize::check(), URegex::clone(), UNormalize::compare(), UDomainName::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(), 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] |
|
uint length |
( |
char * |
s |
) |
[inline, static, protected, inherited] |
|
uint length |
( |
wchar * |
s |
) |
[inline, static, protected, inherited] |
|
char [] toArray |
( |
char * |
s |
) |
[inline, static, protected, inherited] |
|
wchar [] toArray |
( |
wchar * |
s |
) |
[inline, static, protected, inherited] |
|
Member Data Documentation
|
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 398 of file USet.d. |
FunctionLoader Bind [] targets [static]
|
|
|
Initial value:
[
{cast(void**) &uset_open, "uset_open"}
Definition at line 431 of file USet.d. |
The documentation for this class was generated from the following file:
Generated on Sat Apr 9 20:11:48 2005 for Mango by
1.3.6