mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-16 18:25:57 +00:00
ICU-823 Misc API documentation bug fixes
X-SVN-Rev: 4180
This commit is contained in:
parent
e8b0fb3b6e
commit
8160ab0cf2
10 changed files with 119 additions and 111 deletions
|
@ -69,9 +69,9 @@
|
|||
* UnicodeString textBuffer, temp;
|
||||
* CharacterIterator *strIter = iterator.createText();
|
||||
* strIter->getText(temp);
|
||||
* cout << " " << start << " " << end << " |"
|
||||
* << temp.extractBetween(start, end, textBuffer)
|
||||
* << "|" << endl;
|
||||
* cout << " " << start << " " << end << " |"
|
||||
* << temp.extractBetween(start, end, textBuffer)
|
||||
* << "|" << endl;
|
||||
* delete strIter;
|
||||
* }
|
||||
* \endcode
|
||||
|
@ -146,30 +146,30 @@
|
|||
* {
|
||||
* BreakIterator* boundary;
|
||||
* UnicodeString stringToExamine("Aaa bbb ccc. Ddd eee fff.");
|
||||
* cout << "Examining: " << stringToExamine << endl;
|
||||
* cout << "Examining: " << stringToExamine << endl;
|
||||
*
|
||||
* //print each sentence in forward and reverse order
|
||||
* boundary = BreakIterator::createSentenceInstance( Locale::US );
|
||||
* boundary->setText(stringToExamine);
|
||||
* cout << "----- forward: -----------" << endl;
|
||||
* cout << "----- forward: -----------" << endl;
|
||||
* printEachForward(*boundary);
|
||||
* cout << "----- backward: ----------" << endl;
|
||||
* cout << "----- backward: ----------" << endl;
|
||||
* printEachBackward(*boundary);
|
||||
* delete boundary;
|
||||
*
|
||||
* //print each word in order
|
||||
* boundary = BreakIterator::createWordInstance();
|
||||
* boundary->setText(stringToExamine);
|
||||
* cout << "----- forward: -----------" << endl;
|
||||
* cout << "----- forward: -----------" << endl;
|
||||
* printEachForward(*boundary);
|
||||
* //print first element
|
||||
* cout << "----- first: -------------" << endl;
|
||||
* cout << "----- first: -------------" << endl;
|
||||
* printFirst(*boundary);
|
||||
* //print last element
|
||||
* cout << "----- last: --------------" << endl;
|
||||
* cout << "----- last: --------------" << endl;
|
||||
* printLast(*boundary);
|
||||
* //print word at charpos 10
|
||||
* cout << "----- at pos 10: ---------" << endl;
|
||||
* cout << "----- at pos 10: ---------" << endl;
|
||||
* printAt(*boundary, 10 );
|
||||
*
|
||||
* delete boundary;
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
* specifies a half-open interval up to the next item:
|
||||
* <pre>
|
||||
* \code
|
||||
* X matches j if and only if limit[j] <= X < limit[j+1]
|
||||
* X matches j if and only if limit[j] <= X < limit[j+1]
|
||||
* \endcode
|
||||
* </pre>
|
||||
* If there is no match, then either the first or last index is used, depending
|
||||
|
@ -66,16 +66,16 @@
|
|||
* ParsePosition* status = new ParsePosition(0);
|
||||
* UnicodeString str;
|
||||
* FieldPosition f1(0), f2(0);
|
||||
* for (double i = 0.0; i <= 8.0; ++i) {
|
||||
* for (double i = 0.0; i <= 8.0; ++i) {
|
||||
* status->setIndex(0);
|
||||
* Formattable parseResult;
|
||||
* str.remove();
|
||||
* cout << i << " -> " << form->format(i,str, f1)
|
||||
* << " -> " << parseResult << endl;
|
||||
* cout << i << " -> " << form->format(i,str, f1)
|
||||
* << " -> " << parseResult << endl;
|
||||
* }
|
||||
* delete form;
|
||||
* delete status;
|
||||
* cout << endl;
|
||||
* cout << endl;
|
||||
* }
|
||||
* \endcode
|
||||
* </pre>
|
||||
|
@ -94,16 +94,16 @@
|
|||
* Formattable testArgs[] = {0L, "Disk_A", 0L};
|
||||
* FieldPosition fp(0);
|
||||
* UnicodeString str;
|
||||
* for (int32_t i = 0; i < 4; ++i) {
|
||||
* for (int32_t i = 0; i < 4; ++i) {
|
||||
* Formattable fInt(i);
|
||||
* testArgs[0] = fInt;
|
||||
* testArgs[2] = testArgs[0];
|
||||
* str.remove();
|
||||
* pattform->format(testArgs, 3, str, fp, success );
|
||||
* cout << "Output for i=" << i << " : " << str << endl;
|
||||
* cout << "Output for i=" << i << " : " << str << endl;
|
||||
* }
|
||||
* delete pattform;
|
||||
* cout << endl;
|
||||
* cout << endl;
|
||||
* }
|
||||
* \endcode
|
||||
* </pre>
|
||||
|
@ -122,8 +122,8 @@
|
|||
* <pre>
|
||||
* \code
|
||||
* <number> "#" Specifies a limit value.
|
||||
* <number> "<" Specifies a limit of nextDouble(<number>).
|
||||
* <number> ">" Specifies a limit of previousDouble(<number>).
|
||||
* <number> "<" Specifies a limit of nextDouble(<number>).
|
||||
* <number> ">" Specifies a limit of previousDouble(<number>).
|
||||
* \endcode
|
||||
* </pre>
|
||||
* Each limit value is followed by a string, which is terminated by
|
||||
|
|
|
@ -83,10 +83,10 @@ class CollationKey;
|
|||
* // Compare two strings in the default locale
|
||||
* UErrorCode success = U_ZERO_ERROR;
|
||||
* Collator* myCollator = Collator::createInstance(success);
|
||||
* if (myCollator->compare("abc", "ABC") < 0)
|
||||
* cout << "abc is less than ABC" << endl;
|
||||
* if (myCollator->compare("abc", "ABC") < 0)
|
||||
* cout << "abc is less than ABC" << endl;
|
||||
* else
|
||||
* cout << "abc is greater than or equal to ABC" << endl;
|
||||
* cout << "abc is greater than or equal to ABC" << endl;
|
||||
* \endcode
|
||||
* </pre>
|
||||
* </blockquote>
|
||||
|
@ -109,8 +109,8 @@ class CollationKey;
|
|||
* Collator::createInstance(Locale::US, success);
|
||||
* usCollator->setStrength(Collator::PRIMARY);
|
||||
* if (usCollator->compare("abc", "ABC") == 0)
|
||||
* cout <<
|
||||
* "'abc' and 'ABC' strings are equivalent with strength PRIMARY" <<
|
||||
* cout <<
|
||||
* "'abc' and 'ABC' strings are equivalent with strength PRIMARY" <<
|
||||
* endl;
|
||||
* \endcode
|
||||
* </pre>
|
||||
|
@ -303,18 +303,20 @@ public:
|
|||
* than, greater than or equal to another string.
|
||||
* <p>Example of use:
|
||||
* <pre>
|
||||
* . UErrorCode status = U_ZERO_ERROR;
|
||||
* . Collator*myCollation = Collator::createInstance(Locale::US,
|
||||
* . status);
|
||||
* . if (U_FAILURE(status)) return;
|
||||
* . myCollation->setStrength(Collator::PRIMARY);
|
||||
* . // result would be Collator::EQUAL ("abc" == "ABC")
|
||||
* . // (no primary difference between "abc" and "ABC")
|
||||
* . UCollationResult result = myCollation->compare("abc", "ABC");
|
||||
* . myCollation->setStrength(Collator::TERTIARY);
|
||||
* . // result would be Collator::LESS (abc" <<< "ABC")
|
||||
* . // (with tertiary difference between "abc" and "ABC")
|
||||
* . UCollationResult result = myCollation->compare("abc", "ABC");
|
||||
* \code
|
||||
* UErrorCode status = U_ZERO_ERROR;
|
||||
* Collator*myCollation = Collator::createInstance(Locale::US,
|
||||
* status);
|
||||
* if (U_FAILURE(status)) return;
|
||||
* myCollation->setStrength(Collator::PRIMARY);
|
||||
* // result would be Collator::EQUAL ("abc" == "ABC")
|
||||
* // (no primary difference between "abc" and "ABC")
|
||||
* UCollationResult result = myCollation->compare("abc", "ABC");
|
||||
* myCollation->setStrength(Collator::TERTIARY);
|
||||
* // result would be Collator::LESS ("abc" <<< "ABC")
|
||||
* // (with tertiary difference between "abc" and "ABC")
|
||||
* UCollationResult result = myCollation->compare("abc", "ABC");
|
||||
* \endcode
|
||||
* </pre>
|
||||
* @param source the source string to be compared with.
|
||||
* @param target the string that is to be compared with the source string.
|
||||
|
@ -331,18 +333,20 @@ public:
|
|||
* length
|
||||
* <p>Example of use:
|
||||
* <pre>
|
||||
* . UErrorCode status = U_ZERO_ERROR;
|
||||
* . Collator*myCollation = Collator::createInstance(Locale::US,
|
||||
* . status);
|
||||
* . if (U_FAILURE(status)) return;
|
||||
* . myCollation->setStrength(Collator::PRIMARY);
|
||||
* . // result would be Collator::EQUAL ("abc" == "ABC")
|
||||
* . // (no primary difference between "abc" and "ABC")
|
||||
* . UCollationResult result = myCollation->compare("abc", "ABC",3);
|
||||
* . myCollation->setStrength(Collator::TERTIARY);
|
||||
* . // result would be Collator::LESS (abc" <<< "ABC")
|
||||
* . // (with tertiary difference between "abc" and "ABC")
|
||||
* . UCollationResult result = myCollation->compare("abc", "ABC",3);
|
||||
* \code
|
||||
* UErrorCode status = U_ZERO_ERROR;
|
||||
* Collator*myCollation = Collator::createInstance(Locale::US,
|
||||
* status);
|
||||
* if (U_FAILURE(status)) return;
|
||||
* myCollation->setStrength(Collator::PRIMARY);
|
||||
* // result would be Collator::EQUAL ("abc" == "ABC")
|
||||
* // (no primary difference between "abc" and "ABC")
|
||||
* UCollationResult result = myCollation->compare("abc", "ABC",3);
|
||||
* myCollation->setStrength(Collator::TERTIARY);
|
||||
* // result would be Collator::LESS (abc" <<< "ABC")
|
||||
* // (with tertiary difference between "abc" and "ABC")
|
||||
* UCollationResult result = myCollation->compare("abc", "ABC",3);
|
||||
* \endcode
|
||||
* </pre>
|
||||
* @param source the source string to be compared with.
|
||||
* @param target the string that is to be compared with the source string.
|
||||
|
@ -362,18 +366,20 @@ public:
|
|||
* is less than, greater than or equal to another string array.
|
||||
* <p>Example of use:
|
||||
* <pre>
|
||||
* . UErrorCode status = U_ZERO_ERROR;
|
||||
* . Collator*myCollation = Collator::createInstance(Locale::US,
|
||||
* . status);
|
||||
* . if (U_FAILURE(status)) return;
|
||||
* . myCollation->setStrength(Collator::PRIMARY);
|
||||
* . // result would be Collator::EQUAL ("abc" == "ABC")
|
||||
* . // (no primary difference between "abc" and "ABC")
|
||||
* . UCollationResult result = myCollation->compare(L"abc", 3, L"ABC", 3);
|
||||
* . myCollation->setStrength(Collator::TERTIARY);
|
||||
* . // result would be Collator::LESS (abc" <<< "ABC")
|
||||
* . // (with tertiary difference between "abc" and "ABC")
|
||||
* . UCollationResult result = myCollation->compare(L"abc", 3, L"ABC", 3);
|
||||
* \code
|
||||
* UErrorCode status = U_ZERO_ERROR;
|
||||
* Collator*myCollation = Collator::createInstance(Locale::US,
|
||||
* status);
|
||||
* if (U_FAILURE(status)) return;
|
||||
* myCollation->setStrength(Collator::PRIMARY);
|
||||
* // result would be Collator::EQUAL ("abc" == "ABC")
|
||||
* // (no primary difference between "abc" and "ABC")
|
||||
* UCollationResult result = myCollation->compare(L"abc", 3, L"ABC", 3);
|
||||
* myCollation->setStrength(Collator::TERTIARY);
|
||||
* // result would be Collator::LESS (abc" <<< "ABC")
|
||||
* // (with tertiary difference between "abc" and "ABC")
|
||||
* UCollationResult result = myCollation->compare(L"abc", 3, L"ABC", 3);
|
||||
* \endcode
|
||||
* </pre>
|
||||
* @param source the source string array to be compared with.
|
||||
* @param sourceLength the length of the source string array. If this value
|
||||
|
@ -398,40 +404,42 @@ public:
|
|||
* generated sort keys.
|
||||
* <p>Example of use:
|
||||
* <pre>
|
||||
* . UErrorCode status = U_ZERO_ERROR;
|
||||
* . Collator*myCollation = Collator::createInstance(Locale::US,
|
||||
* . status);
|
||||
* . if (U_FAILURE(status)) return;
|
||||
* . myCollation->setStrength(Collator::PRIMARY);
|
||||
* . UErrorCode key1Status, key2Status;
|
||||
* . CollationKey CollationKey1
|
||||
* . CollationKey1 = myCollation->getCollationKey("abc", CollationKey1,
|
||||
* . key1Status);
|
||||
* . CollationKey CollationKey2
|
||||
* . CollationKey2 = myCollation->getCollationKey("ABC", CollationKey2,
|
||||
* . key2Status);
|
||||
* . if (U_FAILURE(key1Status) || U_FAILURE(key2Status))
|
||||
* . {
|
||||
* . delete myCollation;
|
||||
* . return;
|
||||
* . }
|
||||
* . // Use CollationKey::compare() to compare the sort keys
|
||||
* . // result would be 0 (CollationKey1 == CollationKey2)
|
||||
* . int result = CollationKey1.compare(CollationKey2);
|
||||
* . myCollation->setStrength(Collator::TERTIARY);
|
||||
* . CollationKey1 = myCollation->getCollationKey("abc", CollationKey1,
|
||||
* . key1Status);
|
||||
* . CollationKey2 = myCollation->getCollationKey("ABC", CollationKey2,
|
||||
* . key2Status);
|
||||
* . if (U_FAILURE(key1Status) || U_FAILURE(key2Status))
|
||||
* . {
|
||||
* . delete myCollation;
|
||||
* . return;
|
||||
* . }
|
||||
* . // Use CollationKey::compareTo to compare the collation keys
|
||||
* . // result would be -1 (CollationKey1 < CollationKey2)
|
||||
* . result = CollationKey1.compareTo(CollationKey2);
|
||||
* . delete myCollation;
|
||||
* \code
|
||||
* UErrorCode status = U_ZERO_ERROR;
|
||||
* Collator*myCollation = Collator::createInstance(Locale::US,
|
||||
* status);
|
||||
* if (U_FAILURE(status)) return;
|
||||
* myCollation->setStrength(Collator::PRIMARY);
|
||||
* UErrorCode key1Status, key2Status;
|
||||
* CollationKey CollationKey1
|
||||
* CollationKey1 = myCollation->getCollationKey("abc", CollationKey1,
|
||||
* key1Status);
|
||||
* CollationKey CollationKey2
|
||||
* CollationKey2 = myCollation->getCollationKey("ABC", CollationKey2,
|
||||
* key2Status);
|
||||
* if (U_FAILURE(key1Status) || U_FAILURE(key2Status))
|
||||
* {
|
||||
* delete myCollation;
|
||||
* return;
|
||||
* }
|
||||
* // Use CollationKey::compare() to compare the sort keys
|
||||
* // result would be 0 (CollationKey1 == CollationKey2)
|
||||
* int result = CollationKey1.compare(CollationKey2);
|
||||
* myCollation->setStrength(Collator::TERTIARY);
|
||||
* CollationKey1 = myCollation->getCollationKey("abc", CollationKey1,
|
||||
* key1Status);
|
||||
* CollationKey2 = myCollation->getCollationKey("ABC", CollationKey2,
|
||||
* key2Status);
|
||||
* if (U_FAILURE(key1Status) || U_FAILURE(key2Status))
|
||||
* {
|
||||
* delete myCollation;
|
||||
* return;
|
||||
* }
|
||||
* // Use CollationKey::compareTo to compare the collation keys
|
||||
* // result would be -1 (CollationKey1 < CollationKey2)
|
||||
* result = CollationKey1.compareTo(CollationKey2);
|
||||
* delete myCollation;
|
||||
* \endcode
|
||||
* </pre>
|
||||
* <p>
|
||||
* If the source string is null, a null collation key will be returned.
|
||||
|
|
|
@ -58,7 +58,7 @@ class TimeZone;
|
|||
* UDate myDateArr[] = { 0.0, 100000000.0, 2000000000.0 }; // test values
|
||||
* for (int32_t i = 0; i < 3; ++i) {
|
||||
* myString.remove();
|
||||
* cout << df->format( myDateArr[i], myString ) << endl;
|
||||
* cout << df->format( myDateArr[i], myString ) << endl;
|
||||
* }
|
||||
* \endcode
|
||||
* </pre>
|
||||
|
|
|
@ -61,14 +61,14 @@
|
|||
* const int tempLen = 20;
|
||||
* char temp[tempLen];
|
||||
*
|
||||
* for (int i=0; i<dNumSize; i++) {
|
||||
* for (int i=0; i<dNumSize; i++) {
|
||||
* FieldPosition pos(NumberFormat::INTEGER_FIELD);
|
||||
* UnicodeString buf;
|
||||
* char fmtText[tempLen];
|
||||
* ToCharString(fmt->format(doubleNum[i], buf, pos), fmtText);
|
||||
* for (int j=0; j<tempLen; j++) temp[j] = ' '; // clear with spaces
|
||||
* for (int j=0; j<tempLen; j++) temp[j] = ' '; // clear with spaces
|
||||
* temp[__min(tempLen, tempLen-pos.getEndIndex())] = '\0';
|
||||
* cout << temp << fmtText << endl;
|
||||
* cout << temp << fmtText << endl;
|
||||
* }
|
||||
* delete fmt;
|
||||
* \endcode
|
||||
|
|
|
@ -48,8 +48,8 @@ class NumberFormat;
|
|||
* "At {1,time} on {1,date}, there was {2} on planet {0,number}.",
|
||||
* arguments, 3, result, success );
|
||||
*
|
||||
* cout << "result: " << result << endl;
|
||||
* //<output>: At 4:34:20 PM on 23-Mar-98, there was a disturbance
|
||||
* cout << "result: " << result << endl;
|
||||
* //<output>: At 4:34:20 PM on 23-Mar-98, there was a disturbance
|
||||
* // in the Force on planet 7.
|
||||
* \endcode
|
||||
* </pre>
|
||||
|
@ -150,7 +150,7 @@ class NumberFormat;
|
|||
*
|
||||
* UnicodeString string;
|
||||
* FieldPosition fpos = 0;
|
||||
* cout << form->format(testArgs, 2, string, fpos, success) << endl;
|
||||
* cout << form->format(testArgs, 2, string, fpos, success) << endl;
|
||||
*
|
||||
* // output, with different testArgs
|
||||
* // output: The disk "MyDisk" contains no files.
|
||||
|
@ -163,7 +163,7 @@ class NumberFormat;
|
|||
* <pre>
|
||||
* \code
|
||||
* form->applyPattern(
|
||||
* "There {0,choice,0#are no files|1#is one file|1<are {0,number,integer} files}.");
|
||||
* "There {0,choice,0#are no files|1#is one file|1<are {0,number,integer} files}.");
|
||||
* \endcode
|
||||
* </pre>
|
||||
* <P>
|
||||
|
|
|
@ -46,7 +46,7 @@ class Locale;
|
|||
* UErrorCode success = U_ZERO_ERROR;
|
||||
* NumberFormat* nf = NumberFormat::createInstance(success)
|
||||
* nf->format(myNumber, myString);
|
||||
* cout << " Example 1: " << myString << endl;
|
||||
* cout << " Example 1: " << myString << endl;
|
||||
* \endcode
|
||||
* </pre>
|
||||
* If you are formatting multiple numbers, it is more efficient to get
|
||||
|
@ -65,7 +65,7 @@ class Locale;
|
|||
* nf->format(a[i], myString);
|
||||
* myString += " ; ";
|
||||
* }
|
||||
* cout << " Example 2: " << myString << endl;
|
||||
* cout << " Example 2: " << myString << endl;
|
||||
* \endcide
|
||||
* </pre>
|
||||
* To format a number for a different Locale, specify it in the
|
||||
|
|
|
@ -58,7 +58,7 @@ class TransliterationRuleData;
|
|||
* string on the right when performing forward
|
||||
* transliteration.</dd>
|
||||
* <dt> </dt>
|
||||
* <dt><code>ai<$alefmadda;</code></dt>
|
||||
* <dt><code>ai<$alefmadda;</code></dt>
|
||||
* <dd><strong>Reverse translation rule.</strong> This rule
|
||||
* states that the string on the right will be changed to
|
||||
* the string on the left when performing reverse
|
||||
|
@ -66,7 +66,7 @@ class TransliterationRuleData;
|
|||
* </dl>
|
||||
*
|
||||
* <dl>
|
||||
* <dt><code>ai<>$alefmadda;</code></dt>
|
||||
* <dt><code>ai<>$alefmadda;</code></dt>
|
||||
* <dd><strong>Bidirectional translation rule.</strong> This
|
||||
* rule states that the string on the right will be changed
|
||||
* to the string on the left when performing forward
|
||||
|
|
|
@ -126,7 +126,7 @@ class DateFormat;
|
|||
* FieldPosition fp(0);
|
||||
* UnicodeString dateString;
|
||||
* formatter->format( currentTime_1, dateString, fp );
|
||||
* cout << "result: " << dateString << endl;
|
||||
* cout << "result: " << dateString << endl;
|
||||
*
|
||||
* // Parse the previous string back into a Date.
|
||||
* ParsePosition pp(0);
|
||||
|
|
|
@ -238,7 +238,7 @@ class CollationElementIterator;
|
|||
* \code
|
||||
* UErrorCode status = U_ZERO_ERROR;
|
||||
* RuleBasedCollator *mySimple = new
|
||||
* RuleBasedCollator(" < a < b & b < c & c < d", status);
|
||||
* RuleBasedCollator(" < a < b & b < c & c < d", status);
|
||||
* \endcode
|
||||
* </pre>
|
||||
* Or,
|
||||
|
@ -246,7 +246,7 @@ class CollationElementIterator;
|
|||
* \code
|
||||
* UErrorCode status = U_ZERO_ERROR;
|
||||
* RuleBasedCollator *mySimple = new
|
||||
* RuleBasedCollator(" < a < b < d & b < c", status);
|
||||
* RuleBasedCollator(" < a < b < d & b < c", status);
|
||||
* \endcode
|
||||
* </pre>
|
||||
* Because " < a < b < c < d" is the same as "a < b < d & b
|
||||
|
@ -331,7 +331,7 @@ class CollationElementIterator;
|
|||
* // add a few Japanese character to sort before English characters
|
||||
* // suppose the last character before the first base letter 'a' in
|
||||
* // the English collation rule is 0x2212
|
||||
* UChar jaString[] = {'&', 0x2212, '<', 0x3041, ',', 0x3042, '<',
|
||||
* UChar jaString[] = {'&', 0x2212, '<', 0x3041, ',', 0x3042, '<',
|
||||
* 0x3043, ',', 0x3044, 0};
|
||||
* UnicodeString rules(en_USCollation->getRules());
|
||||
* rules += jaString;
|
||||
|
|
Loading…
Add table
Reference in a new issue