ICU 60.2 60.2

- Main Page
- Related Pages
- Modules
- Namespaces
- Data Structures
- Files

- File List
- Globals

Macros | Typedefs | Functions
uversion.h File Reference

C API: API for accessing ICU version numbers. More...

`#include "unicode/umachine.h"`
`#include "unicode/uvernum.h"`

Go to the source code of this file.

## Macros
#define | U_COPYRIGHT_STRING_LENGTH 128
| Maximum length of the copyright string. More...
#define | U_MAX_VERSION_LENGTH 4
| An ICU version consists of up to 4 numbers from 0..255. More...
#define | U_VERSION_DELIMITER '.'
| In a string, ICU version fields are delimited by dots. More...
#define | U_MAX_VERSION_STRING_LENGTH 20
| The maximum length of an ICU version string. More...
#define | U_NAMESPACE_BEGIN
| This is used to begin a declaration of a public ICU C++ API. More...
#define | U_NAMESPACE_END
| This is used to end a declaration of a public ICU C++ API. More...
#define | U_NAMESPACE_USE
| This is used to specify that the rest of the code uses the public ICU C++ API namespace. More...
#define | U_NAMESPACE_QUALIFIER
| This is used to qualify that a function or class is part of the public ICU C++ API namespace. More...

## Typedefs
typedef uint8_t | UVersionInfo[U_MAX_VERSION_LENGTH]
| The binary form of a version on ICU APIs is an array of 4 uint8_t. More...

## Functions
void | u_versionFromString (UVersionInfo versionArray, const char *versionString)
| Parse a string with dotted-decimal version information and fill in a UVersionInfo structure with the result. More...
void | u_versionFromUString (UVersionInfo versionArray, const UChar *versionString)
| Parse a Unicode string with dotted-decimal version information and fill in a UVersionInfo structure with the result. More...
void | u_versionToString (const UVersionInfo versionArray, char *versionString)
| Write a string with dotted-decimal version information according to the input UVersionInfo. More...
void | u_getVersion (UVersionInfo versionArray)
| Gets the ICU release version. More...

## Detailed Description

C API: API for accessing ICU version numbers.

Definition in file uversion.h.

## Macro Definition Documentation

#define U_COPYRIGHT_STRING_LENGTH 128

Maximum length of the copyright string.

Stable:
  ICU 2.4

Definition at line 38 of file uversion.h.

#define U_MAX_VERSION_LENGTH 4

An ICU version consists of up to 4 numbers from 0..255.

Stable:
  ICU 2.4

Definition at line 43 of file uversion.h.

#define U_MAX_VERSION_STRING_LENGTH 20

The maximum length of an ICU version string.

Stable:
  ICU 2.4

Definition at line 53 of file uversion.h.

#define U_NAMESPACE_BEGIN

This is used to begin a declaration of a public ICU C++ API.

When not compiling for C++, it does nothing. When compiling for C++, it begins an extern "C++" linkage block (to protect against cases in which an external client includes ICU header files inside an extern "C" linkage block).

It also begins a versioned-ICU-namespace block.

Stable:
  ICU 2.4

Definition at line 131 of file uversion.h.

#define U_NAMESPACE_END

This is used to end a declaration of a public ICU C++ API.

When not compiling for C++, it does nothing. When compiling for C++, it ends the extern "C++" block begun by U_NAMESPACE_BEGIN.

It also ends the versioned-ICU-namespace block begun by U_NAMESPACE_BEGIN.

Stable:
  ICU 2.4

Definition at line 132 of file uversion.h.

Referenced by icu::StringByteSink< StringClass >::Append(), icu::Replaceable::char32At(), icu::UCharsTrieBuilder::clear(), icu::ScientificNumberFormatter::clone(), icu::Normalizer::compare(), icu::LocaleDisplayNames::createInstance(), icu::FilteredNormalizer2::FilteredNormalizer2(), icu::Formattable::fromUFormattable(), icu::SimpleDateFormat::get2DigitYearStart(), icu::MessageFormat::getApostropheMode(), icu::CollationKey::getByteArray(), icu::UnicodeSetIterator::getCodepointEnd(), icu::DecimalFormatSymbols::getCurrencyPattern(), icu::Edits::getFineIterator(), icu::CurrencyUnit::getISOCurrency(), icu::CurrencyAmount::getISOCurrency(), icu::ParagraphLayout::VisualRun::getLeading(), icu::CharacterIterator::getLength(), icu::SimpleTimeZone::getOffset(), icu::SimpleFormatter::getTextWithNoArguments(), icu::Measure::getUnit(), icu::BytesTrie::Iterator::getValue(), icu::UCharsTrie::Iterator::getValue(), icu::ErrorCode::handleFailure(), icu::MessagePattern::Part::hashCode(), icu::Locale::isBogus(), icu::BreakIterator::isBufferClone(), icu::CollationElementIterator::isIgnorable(), icu::NumberFormat::isLenient(), icu::RuleBasedNumberFormat::isLenient(), icu::IDNAInfo::isTransitionalDifferent(), icu::MeasureUnit::operator!=(), icu::FieldPositionIterator::operator!=(), icu::CurrencyPluralInfo::operator!=(), icu::TimeUnitAmount::operator!=(), icu::DateInterval::operator!=(), icu::Format::operator!=(), icu::TimeUnitFormat::operator!=(), icu::FieldPosition::operator!=(), icu::operator!=(), icu::DateIntervalInfo::operator!=(), icu::RuleBasedBreakIterator::operator!=(), icu::SearchIterator::operator!=(), icu::DateIntervalFormat::operator!=(), icu::PluralRules::operator!=(), icu::Transliterator::pointerToken(), icu::RuleBasedCollator::rbcFromUCollator(), icu::UnicodeString::reverse(), icu::ParsePosition::setErrorIndex(), icu::TimeZone::setID(), icu::UnicodeSet::spanBack(), icu::toOldUCharPtr(), icu::UnicodeStringAppendable::UnicodeStringAppendable(), icu::ures_getUnicodeStringByKey(), icu::ValueRuns::ValueRuns(), icu::Calendar::weekNumber(), and icu::FilteredBreakIteratorBuilder::wrapIteratorWithFilter().

#define U_NAMESPACE_QUALIFIER

This is used to qualify that a function or class is part of the public ICU C++ API namespace.

This macro is unnecessary since ICU 49 requires namespace support. You can just use "icu::" instead.

Stable:
  ICU 2.4

Definition at line 134 of file uversion.h.

#define U_NAMESPACE_USE

This is used to specify that the rest of the code uses the public ICU C++ API namespace.

This is invoked by default; we recommend that you turn it off: See the "Recommended Build Options" section of the ICU4C readme (http://source.icu-project.org/repos/icu/icu/trunk/readme.html#RecBuild)

Stable:
  ICU 2.4

Definition at line 133 of file uversion.h.

#define U_VERSION_DELIMITER '.'

In a string, ICU version fields are delimited by dots.

Stable:
  ICU 2.4

Definition at line 48 of file uversion.h.

## Typedef Documentation

typedef uint8_t UVersionInfo[U_MAX_VERSION_LENGTH]

The binary form of a version on ICU APIs is an array of 4 uint8_t.

To compare two versions, use memcmp(v1,v2,sizeof(UVersionInfo)).

Stable:
  ICU 2.4

Definition at line 59 of file uversion.h.

## Function Documentation

void u_getVersion | ( | UVersionInfo | versionArray | ) |

Gets the ICU release version.

The version array stores the version information for ICU. For example, release "1.3.31.2" is then represented as 0x01031F02. Definition of this function lives in putil.c

Parameters

  versionArray | the version # information, the result will be filled in

Stable:
  ICU 2.0

void u_versionFromString | ( | UVersionInfo | versionArray,
|  | const char * | versionString
| ) |  |

Parse a string with dotted-decimal version information and fill in a UVersionInfo structure with the result.

Definition of this function lives in putil.c

Parameters

  versionArray | The destination structure for the version information.
  versionString | A string with dotted-decimal version information, with up to four non-negative number fields with values of up to 255 each.

Stable:
  ICU 2.4

void u_versionFromUString | ( | UVersionInfo | versionArray,
|  | const UChar * | versionString
| ) |  |

Parse a Unicode string with dotted-decimal version information and fill in a UVersionInfo structure with the result.

Definition of this function lives in putil.c

Parameters

  versionArray | The destination structure for the version information.
  versionString | A Unicode string with dotted-decimal version information, with up to four non-negative number fields with values of up to 255 each.

Stable:
  ICU 4.2

void u_versionToString | ( | const UVersionInfo | versionArray,
|  | char * | versionString
| ) |  |

Write a string with dotted-decimal version information according to the input UVersionInfo.

Definition of this function lives in putil.c

Parameters

  versionArray | The version information to be written as a string.
  versionString | A string buffer that will be filled in with a string corresponding to the numeric version information in versionArray. The buffer size must be at least U_MAX_VERSION_STRING_LENGTH.

Stable:
  ICU 2.4