LEGlyphStorage.h   LEGlyphStorage.h 
/* /*
********************************************************************** **********************************************************************
* Copyright (C) 1998-2009, International Business Machines * Copyright (C) 1998-2010, International Business Machines
* Corporation and others. All Rights Reserved. * Corporation and others. All Rights Reserved.
********************************************************************** **********************************************************************
*/ */
#ifndef __LEGLYPHSTORAGE_H #ifndef __LEGLYPHSTORAGE_H
#define __LEGLYPHSTORAGE_H #define __LEGLYPHSTORAGE_H
#include "LETypes.h" #include "LETypes.h"
#include "LEInsertionList.h" #include "LEInsertionList.h"
skipping to change at line 328 skipping to change at line 328
* glyph array until <code>applyInsertions</code> is called. * glyph array until <code>applyInsertions</code> is called.
* *
* @param atIndex the index of the glyph to be replaced * @param atIndex the index of the glyph to be replaced
* @param insertCount the number of glyphs to replace it with * @param insertCount the number of glyphs to replace it with
* @param success set to an error code if the auxillary data cannot be retrieved. * @param success set to an error code if the auxillary data cannot be retrieved.
* *
* @return the address at which to store the replacement glyphs. * @return the address at which to store the replacement glyphs.
* *
* @see LEInsertionList.h * @see LEInsertionList.h
* *
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
LEGlyphID *insertGlyphs(le_int32 atIndex, le_int32 insertCount, LEError Code& success); LEGlyphID *insertGlyphs(le_int32 atIndex, le_int32 insertCount, LEError Code& success);
/** /**
* Call this method to replace a single glyph in the glyph array * Call this method to replace a single glyph in the glyph array
* with multiple glyphs. This method uses the <code>LEInsertionList</co de> * with multiple glyphs. This method uses the <code>LEInsertionList</co de>
* to do the insertion. It returns the address of storage where the new * to do the insertion. It returns the address of storage where the new
* glyph IDs can be stored. They will not actually be inserted into the * glyph IDs can be stored. They will not actually be inserted into the
* glyph array until <code>applyInsertions</code> is called. * glyph array until <code>applyInsertions</code> is called.
* *
skipping to change at line 364 skipping to change at line 364
* This method is used to reposition glyphs during Indic v2 processing. It moves * This method is used to reposition glyphs during Indic v2 processing. It moves
* all of the relevant glyph information ( glyph, indices, positions, a nd auxData ), * all of the relevant glyph information ( glyph, indices, positions, a nd auxData ),
* from the source position to the target position, and also allows for a marker bit * from the source position to the target position, and also allows for a marker bit
* to be set in the target glyph's auxData so that it won't be reproces sed later in the * to be set in the target glyph's auxData so that it won't be reproces sed later in the
* cycle. * cycle.
* *
* @param fromPosition - position of the glyph to be moved * @param fromPosition - position of the glyph to be moved
* @param toPosition - target position of the glyph * @param toPosition - target position of the glyph
* @param marker marker bit * @param marker marker bit
* *
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
void moveGlyph(le_int32 fromPosition, le_int32 toPosition, le_uint32 ma rker); void moveGlyph(le_int32 fromPosition, le_int32 toPosition, le_uint32 ma rker);
/** /**
* This method causes all of the glyph insertions recorded by * This method causes all of the glyph insertions recorded by
* <code>insertGlyphs</code> to be applied to the glyph array. The * <code>insertGlyphs</code> to be applied to the glyph array. The
* new slots in the char indices and the auxillary data arrays * new slots in the char indices and the auxillary data arrays
* will be filled in with the values for the glyph being replaced. * will be filled in with the values for the glyph being replaced.
* *
* @return the new size of the glyph array * @return the new size of the glyph array
 End of changes. 3 change blocks. 
3 lines changed or deleted 3 lines changed or added


 ParagraphLayout.h   ParagraphLayout.h 
/* /*
********************************************************************** **********************************************************************
* Copyright (C) 2002-2005, International Business Machines * Copyright (C) 2002-2010, International Business Machines
* Corporation and others. All Rights Reserved. * Corporation and others. All Rights Reserved.
********************************************************************** **********************************************************************
*/ */
#ifndef __PARAGRAPHLAYOUT_H #ifndef __PARAGRAPHLAYOUT_H
#define __PARAGRAPHLAYOUT_H #define __PARAGRAPHLAYOUT_H
/** /**
* \file * \file
skipping to change at line 501 skipping to change at line 501
*/ */
virtual le_int32 getLeading() const; virtual le_int32 getLeading() const;
/** /**
* Reset line breaking to start from the beginning of the paragraph. * Reset line breaking to start from the beginning of the paragraph.
* *
* *
* @stable ICU 3.2 * @stable ICU 3.2
*/ */
inline void reflow(); inline void reflow();
/**
*
* Convenience method for determining if paragraph layout processing is
complete ( i.e. there
* are no more lines left to process. )
*
* @return true if there are no more lines to be processed
*
* @internal
*/
inline le_bool isDone() const;
/** /**
* Return a <code>ParagraphLayout::Line</code> object which represents next line * Return a <code>ParagraphLayout::Line</code> object which represents next line
* in the paragraph. The width of the line is specified each time so th at it can * in the paragraph. The width of the line is specified each time so th at it can
* be varied to support arbitrary paragraph shapes. * be varied to support arbitrary paragraph shapes.
* *
* @param width is the width of the line. If <code>width</code> is less than or equal * @param width is the width of the line. If <code>width</code> is less than or equal
* to zero, a <code>ParagraphLayout::Line</code> object re presenting the * to zero, a <code>ParagraphLayout::Line</code> object re presenting the
* rest of the paragraph will be returned. * rest of the paragraph will be returned.
* *
 End of changes. 2 change blocks. 
1 lines changed or deleted 12 lines changed or added


 bytestream.h   bytestream.h 
// Copyright (C) 2009, International Business Machines // Copyright (C) 2009-2010, International Business Machines
// Corporation and others. All Rights Reserved. // Corporation and others. All Rights Reserved.
// //
// Copyright 2007 Google Inc. All Rights Reserved. // Copyright 2007 Google Inc. All Rights Reserved.
// Author: sanjay@google.com (Sanjay Ghemawat) // Author: sanjay@google.com (Sanjay Ghemawat)
// //
// Abstract interface that consumes a sequence of bytes (ByteSink). // Abstract interface that consumes a sequence of bytes (ByteSink).
// //
// Used so that we can write a single piece of code that can operate // Used so that we can write a single piece of code that can operate
// on a variety of output string types. // on a variety of output string types.
// //
skipping to change at line 46 skipping to change at line 46
*/ */
#include "unicode/utypes.h" #include "unicode/utypes.h"
#include "unicode/uobject.h" #include "unicode/uobject.h"
#include "unicode/std_string.h" #include "unicode/std_string.h"
U_NAMESPACE_BEGIN U_NAMESPACE_BEGIN
/** /**
* A ByteSink can be filled with bytes. * A ByteSink can be filled with bytes.
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
class U_COMMON_API ByteSink : public UMemory { class U_COMMON_API ByteSink : public UMemory {
public: public:
/** /**
* Default constructor. * Default constructor.
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
ByteSink() { } ByteSink() { }
/** /**
* Virtual destructor. * Virtual destructor.
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
virtual ~ByteSink() { } virtual ~ByteSink() { }
/** /**
* Append "bytes[0,n-1]" to this. * Append "bytes[0,n-1]" to this.
* @param bytes the pointer to the bytes * @param bytes the pointer to the bytes
* @param n the number of bytes; must be non-negative * @param n the number of bytes; must be non-negative
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
virtual void Append(const char* bytes, int32_t n) = 0; virtual void Append(const char* bytes, int32_t n) = 0;
/** /**
* Returns a writable buffer for appending and writes the buffer's capaci ty to * Returns a writable buffer for appending and writes the buffer's capaci ty to
* *result_capacity. Guarantees *result_capacity>=min_capacity. * *result_capacity. Guarantees *result_capacity>=min_capacity.
* May return a pointer to the caller-owned scratch buffer which must hav e * May return a pointer to the caller-owned scratch buffer which must hav e
* scratch_capacity>=min_capacity. * scratch_capacity>=min_capacity.
* The returned buffer is only valid until the next operation * The returned buffer is only valid until the next operation
* on this ByteSink. * on this ByteSink.
skipping to change at line 109 skipping to change at line 109
* *
* @param min_capacity required minimum capacity of the returned buffer; * @param min_capacity required minimum capacity of the returned buffer;
* must be non-negative * must be non-negative
* @param desired_capacity_hint desired capacity of the returned buffer; * @param desired_capacity_hint desired capacity of the returned buffer;
* must be non-negative * must be non-negative
* @param scratch default caller-owned buffer * @param scratch default caller-owned buffer
* @param scratch_capacity capacity of the scratch buffer * @param scratch_capacity capacity of the scratch buffer
* @param result_capacity pointer to an integer which will be set to the * @param result_capacity pointer to an integer which will be set to the
* capacity of the returned buffer * capacity of the returned buffer
* @return a buffer with *result_capacity>=min_capacity * @return a buffer with *result_capacity>=min_capacity
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
virtual char* GetAppendBuffer(int32_t min_capacity, virtual char* GetAppendBuffer(int32_t min_capacity,
int32_t desired_capacity_hint, int32_t desired_capacity_hint,
char* scratch, int32_t scratch_capacity, char* scratch, int32_t scratch_capacity,
int32_t* result_capacity); int32_t* result_capacity);
/** /**
* Flush internal buffers. * Flush internal buffers.
* Some byte sinks use internal buffers or provide buffering * Some byte sinks use internal buffers or provide buffering
* and require calling Flush() at the end of the stream. * and require calling Flush() at the end of the stream.
* The default implementation of Flush() does nothing. * The default implementation of Flush() does nothing.
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
virtual void Flush(); virtual void Flush();
private: private:
ByteSink(const ByteSink &); // copy constructor not implemented ByteSink(const ByteSink &); // copy constructor not implemented
ByteSink &operator=(const ByteSink &); // assignment operator not impleme nted ByteSink &operator=(const ByteSink &); // assignment operator not impleme nted
}; };
// ------------------------------------------------------------- // -------------------------------------------------------------
// Some standard implementations // Some standard implementations
/** /**
* Implementation of ByteSink that writes to a flat byte array, * Implementation of ByteSink that writes to a flat byte array,
* with bounds-checking: * with bounds-checking:
* This sink will not write more than capacity bytes to outbuf. * This sink will not write more than capacity bytes to outbuf.
* If more than capacity bytes are Append()ed, then excess bytes are ignore d, * If more than capacity bytes are Append()ed, then excess bytes are ignore d,
* and Overflowed() will return true. * and Overflowed() will return true.
* Overflow does not cause a runtime error. * Overflow does not cause a runtime error.
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
class U_COMMON_API CheckedArrayByteSink : public ByteSink { class U_COMMON_API CheckedArrayByteSink : public ByteSink {
public: public:
/** /**
* Constructs a ByteSink that will write to outbuf[0..capacity-1]. * Constructs a ByteSink that will write to outbuf[0..capacity-1].
* @param outbuf buffer to write to * @param outbuf buffer to write to
* @param capacity size of the buffer * @param capacity size of the buffer
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
CheckedArrayByteSink(char* outbuf, int32_t capacity); CheckedArrayByteSink(char* outbuf, int32_t capacity);
/** /**
* Append "bytes[0,n-1]" to this. * Append "bytes[0,n-1]" to this.
* @param bytes the pointer to the bytes * @param bytes the pointer to the bytes
* @param n the number of bytes; must be non-negative * @param n the number of bytes; must be non-negative
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
virtual void Append(const char* bytes, int32_t n); virtual void Append(const char* bytes, int32_t n);
/** /**
* Returns a writable buffer for appending and writes the buffer's capaci ty to * Returns a writable buffer for appending and writes the buffer's capaci ty to
* *result_capacity. For details see the base class documentation. * *result_capacity. For details see the base class documentation.
* @param min_capacity required minimum capacity of the returned buffer; * @param min_capacity required minimum capacity of the returned buffer;
* must be non-negative * must be non-negative
* @param desired_capacity_hint desired capacity of the returned buffer; * @param desired_capacity_hint desired capacity of the returned buffer;
* must be non-negative * must be non-negative
* @param scratch default caller-owned buffer * @param scratch default caller-owned buffer
* @param scratch_capacity capacity of the scratch buffer * @param scratch_capacity capacity of the scratch buffer
* @param result_capacity pointer to an integer which will be set to the * @param result_capacity pointer to an integer which will be set to the
* capacity of the returned buffer * capacity of the returned buffer
* @return a buffer with *result_capacity>=min_capacity * @return a buffer with *result_capacity>=min_capacity
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
virtual char* GetAppendBuffer(int32_t min_capacity, virtual char* GetAppendBuffer(int32_t min_capacity,
int32_t desired_capacity_hint, int32_t desired_capacity_hint,
char* scratch, int32_t scratch_capacity, char* scratch, int32_t scratch_capacity,
int32_t* result_capacity); int32_t* result_capacity);
/** /**
* Returns the number of bytes actually written to the sink. * Returns the number of bytes actually written to the sink.
* @return number of bytes written to the buffer * @return number of bytes written to the buffer
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
int32_t NumberOfBytesWritten() const { return size_; } int32_t NumberOfBytesWritten() const { return size_; }
/** /**
* Returns true if any bytes were discarded, i.e., if there was an * Returns true if any bytes were discarded, i.e., if there was an
* attempt to write more than 'capacity' bytes. * attempt to write more than 'capacity' bytes.
* @return TRUE if more than 'capacity' bytes were Append()ed * @return TRUE if more than 'capacity' bytes were Append()ed
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
UBool Overflowed() const { return overflowed_; } UBool Overflowed() const { return overflowed_; }
private: private:
char* outbuf_; char* outbuf_;
const int32_t capacity_; const int32_t capacity_;
int32_t size_; int32_t size_;
bool overflowed_; bool overflowed_;
CheckedArrayByteSink(); ///< default constructor not implemented CheckedArrayByteSink(); ///< default constructor not implemented
CheckedArrayByteSink(const CheckedArrayByteSink &); ///< copy constructor not implemented CheckedArrayByteSink(const CheckedArrayByteSink &); ///< copy constructor not implemented
CheckedArrayByteSink &operator=(const CheckedArrayByteSink &); ///< assig nment operator not implemented CheckedArrayByteSink &operator=(const CheckedArrayByteSink &); ///< assig nment operator not implemented
}; };
#if U_HAVE_STD_STRING #if U_HAVE_STD_STRING
/** /**
* Implementation of ByteSink that writes to a "string". * Implementation of ByteSink that writes to a "string".
* The StringClass is usually instantiated with a std::string. * The StringClass is usually instantiated with a std::string.
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
template<typename StringClass> template<typename StringClass>
class StringByteSink : public ByteSink { class StringByteSink : public ByteSink {
public: public:
/** /**
* Constructs a ByteSink that will append bytes to the dest string. * Constructs a ByteSink that will append bytes to the dest string.
* @param dest pointer to string object to append to * @param dest pointer to string object to append to
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
StringByteSink(StringClass* dest) : dest_(dest) { } StringByteSink(StringClass* dest) : dest_(dest) { }
/** /**
* Append "bytes[0,n-1]" to this. * Append "bytes[0,n-1]" to this.
* @param bytes the pointer to the bytes * @param bytes the pointer to the bytes
* @param n the number of bytes; must be non-negative * @param n the number of bytes; must be non-negative
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
virtual void Append(const char* data, int32_t n) { dest_->append(data, n) ; } virtual void Append(const char* data, int32_t n) { dest_->append(data, n) ; }
private: private:
StringClass* dest_; StringClass* dest_;
StringByteSink(); ///< default constructor not implemented StringByteSink(); ///< default constructor not implemented
StringByteSink(const StringByteSink &); ///< copy constructor not impleme nted StringByteSink(const StringByteSink &); ///< copy constructor not impleme nted
StringByteSink &operator=(const StringByteSink &); ///< assignment operat or not implemented StringByteSink &operator=(const StringByteSink &); ///< assignment operat or not implemented
}; };
#endif #endif
 End of changes. 16 change blocks. 
16 lines changed or deleted 16 lines changed or added


 calendar.h   calendar.h 
/* /*
*************************************************************************** ***** *************************************************************************** *****
* Copyright (C) 1997-2009, International Business Machines * Copyright (C) 1997-2010, International Business Machines
* Corporation and others. All Rights Reserved. * Corporation and others. All Rights Reserved.
*************************************************************************** ***** *************************************************************************** *****
* *
* File CALENDAR.H * File CALENDAR.H
* *
* Modification History: * Modification History:
* *
* Date Name Description * Date Name Description
* 04/22/97 aliu Expanded and corrected comments and other heade r * 04/22/97 aliu Expanded and corrected comments and other heade r
* contents. * contents.
skipping to change at line 382 skipping to change at line 382
* plus input keyword and that value has different behavior than creati on with the * plus input keyword and that value has different behavior than creati on with the
* input locale alone. * input locale alone.
* @param key one of the keys supported by this service. For now, only * @param key one of the keys supported by this service. For now, only
* "calendar" is supported. * "calendar" is supported.
* @param locale the locale * @param locale the locale
* @param commonlyUsed if set to true it will return only commonly use d values * @param commonlyUsed if set to true it will return only commonly use d values
* with the given locale in preferred order. Othe rwise, * with the given locale in preferred order. Othe rwise,
* it will return all the available values for the locale. * it will return all the available values for the locale.
* @param status ICU Error Code * @param status ICU Error Code
* @return a string enumeration over keyword values for the given key a nd the locale. * @return a string enumeration over keyword values for the given key a nd the locale.
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
static StringEnumeration* U_EXPORT2 getKeywordValuesForLocale(const cha r* key, static StringEnumeration* U_EXPORT2 getKeywordValuesForLocale(const cha r* key,
const Locale& locale, UBool commonlyUsed, UErrorCode& s tatus); const Locale& locale, UBool commonlyUsed, UErrorCode& s tatus);
/** /**
* Returns the current UTC (GMT) time measured in milliseconds since 0: 00:00 on 1/1/70 * Returns the current UTC (GMT) time measured in milliseconds since 0: 00:00 on 1/1/70
* (derived from the system time). * (derived from the system time).
* *
* @return The current UTC time in milliseconds. * @return The current UTC time in milliseconds.
* @stable ICU 2.0 * @stable ICU 2.0
skipping to change at line 1192 skipping to change at line 1192
/** /**
* Returns the resource key string used for this calendar type. * Returns the resource key string used for this calendar type.
* For example, prepending "Eras_" to this string could return "Eras_ja panese" * For example, prepending "Eras_" to this string could return "Eras_ja panese"
* or "Eras_gregorian". * or "Eras_gregorian".
* *
* @returns static string, for example, "gregorian" or "japanese" * @returns static string, for example, "gregorian" or "japanese"
* @internal * @internal
*/ */
virtual const char * getType() const = 0; virtual const char * getType() const = 0;
/**
* Returns whether the given day of the week is a weekday, a
* weekend day, or a day that transitions from one to the other,
* in this calendar system. If a transition occurs at midnight,
* then the days before and after the transition will have the
* type UCAL_WEEKDAY or UCAL_WEEKEND. If a transition occurs at a ti
me
* other than midnight, then the day of the transition will have
* the type UCAL_WEEKEND_ONSET or UCAL_WEEKEND_CEASE. In this case,
the
* method getWeekendTransition() will return the point of
* transition.
* @param dayOfWeek The day of the week whose type is desired (UCAL_
SUNDAY..UCAL_SATURDAY).
* @param status The error code for the operation.
* @return The UCalendarWeekdayType for the day of the week.
* @draft ICU 4.4
*/
virtual UCalendarWeekdayType getDayOfWeekType(UCalendarDaysOfWeek dayOf
Week, UErrorCode &status) const;
/**
* Returns the time during the day at which the weekend begins or en
ds in
* this calendar system. If getDayOfWeekType() rerturns UCAL_WEEKEN
D_ONSET
* for the specified dayOfWeek, return the time at which the weekend
begins.
* If getDayOfWeekType() returns UCAL_WEEKEND_CEASE for the specifie
d dayOfWeek,
* return the time at which the weekend ends. If getDayOfWeekType()
returns
* some other UCalendarWeekdayType for the specified dayOfWeek, is i
t an error condition
* (U_ILLEGAL_ARGUMENT_ERROR).
* @param dayOfWeek The day of the week for which the weekend transi
tion time is
* desired (UCAL_SUNDAY..UCAL_SATURDAY).
* @param status The error code for the operation.
* @return The milliseconds after midnight at which the weekend begi
ns or ends.
* @draft ICU 4.4
*/
virtual int32_t getWeekendTransition(UCalendarDaysOfWeek dayOfWeek, UEr
rorCode &status) const;
/**
* Returns TRUE if the given UDate is in the weekend in
* this calendar system.
* @param date The UDate in question.
* @param status The error code for the operation.
* @return TRUE if the given UDate is in the weekend in
* this calendar system, FALSE otherwise.
* @draft ICU 4.4
*/
virtual UBool isWeekend(UDate date, UErrorCode &status) const;
/**
* Returns TRUE if this Calendar's current date-time is in the weeke
nd in
* this calendar system.
* @return TRUE if this Calendar's current date-time is in the weeke
nd in
* this calendar system, FALSE otherwise.
* @draft ICU 4.4
*/
virtual UBool isWeekend(void) const;
protected: protected:
/** /**
* Constructs a Calendar with the default time zone as returned by * Constructs a Calendar with the default time zone as returned by
* TimeZone::createInstance(), and the default locale. * TimeZone::createInstance(), and the default locale.
* *
* @param success Indicates the status of Calendar object constructio n. Returns * @param success Indicates the status of Calendar object constructio n. Returns
* U_ZERO_ERROR if constructed successfully. * U_ZERO_ERROR if constructed successfully.
* @stable ICU 2.0 * @stable ICU 2.0
*/ */
 End of changes. 3 change blocks. 
2 lines changed or deleted 70 lines changed or added


 caniter.h   caniter.h 
/* /*
************************************************************************** ***** ************************************************************************** *****
* Copyright (C) 1996-2006, International Business Machines Corporation and * * Copyright (C) 1996-2010, International Business Machines Corporation and *
* others. All Rights Reserved. * * others. All Rights Reserved. *
************************************************************************** ***** ************************************************************************** *****
*/ */
#ifndef CANITER_H #ifndef CANITER_H
#define CANITER_H #define CANITER_H
#include "unicode/utypes.h" #include "unicode/utypes.h"
#if !UCONFIG_NO_NORMALIZATION #if !UCONFIG_NO_NORMALIZATION
skipping to change at line 34 skipping to change at line 34
* Should be either TRUE or FALSE. This is a compile time option * Should be either TRUE or FALSE. This is a compile time option
* @stable ICU 2.4 * @stable ICU 2.4
*/ */
#ifndef CANITER_SKIP_ZEROES #ifndef CANITER_SKIP_ZEROES
#define CANITER_SKIP_ZEROES TRUE #define CANITER_SKIP_ZEROES TRUE
#endif #endif
U_NAMESPACE_BEGIN U_NAMESPACE_BEGIN
class Hashtable; class Hashtable;
class Normalizer2;
/** /**
* This class allows one to iterate through all the strings that are canoni cally equivalent to a given * This class allows one to iterate through all the strings that are canoni cally equivalent to a given
* string. For example, here are some sample results: * string. For example, here are some sample results:
Results for: {LATIN CAPITAL LETTER A WITH RING ABOVE}{LATIN SMALL LETTER D} {COMBINING DOT ABOVE}{COMBINING CEDILLA} Results for: {LATIN CAPITAL LETTER A WITH RING ABOVE}{LATIN SMALL LETTER D} {COMBINING DOT ABOVE}{COMBINING CEDILLA}
1: \\u0041\\u030A\\u0064\\u0307\\u0327 1: \\u0041\\u030A\\u0064\\u0307\\u0327
= {LATIN CAPITAL LETTER A}{COMBINING RING ABOVE}{LATIN SMALL LETTER D}{COM BINING DOT ABOVE}{COMBINING CEDILLA} = {LATIN CAPITAL LETTER A}{COMBINING RING ABOVE}{LATIN SMALL LETTER D}{COM BINING DOT ABOVE}{COMBINING CEDILLA}
2: \\u0041\\u030A\\u0064\\u0327\\u0307 2: \\u0041\\u030A\\u0064\\u0327\\u0307
= {LATIN CAPITAL LETTER A}{COMBINING RING ABOVE}{LATIN SMALL LETTER D}{COM BINING CEDILLA}{COMBINING DOT ABOVE} = {LATIN CAPITAL LETTER A}{COMBINING RING ABOVE}{LATIN SMALL LETTER D}{COM BINING CEDILLA}{COMBINING DOT ABOVE}
3: \\u0041\\u030A\\u1E0B\\u0327 3: \\u0041\\u030A\\u1E0B\\u0327
skipping to change at line 176 skipping to change at line 177
int32_t pieces_length; int32_t pieces_length;
int32_t *pieces_lengths; int32_t *pieces_lengths;
// current is used in iterating to combine pieces // current is used in iterating to combine pieces
int32_t *current; int32_t *current;
int32_t current_length; int32_t current_length;
// transient fields // transient fields
UnicodeString buffer; UnicodeString buffer;
const Normalizer2 &nfd;
// we have a segment, in NFD. Find all the strings that are canonically equivalent to it. // we have a segment, in NFD. Find all the strings that are canonically equivalent to it.
UnicodeString *getEquivalents(const UnicodeString &segment, int32_t &re sult_len, UErrorCode &status); //private String[] getEquivalents(String seg ment) UnicodeString *getEquivalents(const UnicodeString &segment, int32_t &re sult_len, UErrorCode &status); //private String[] getEquivalents(String seg ment)
//Set getEquivalents2(String segment); //Set getEquivalents2(String segment);
Hashtable *getEquivalents2(Hashtable *fillinResult, const UChar *segmen t, int32_t segLen, UErrorCode &status); Hashtable *getEquivalents2(Hashtable *fillinResult, const UChar *segmen t, int32_t segLen, UErrorCode &status);
//Hashtable *getEquivalents2(const UnicodeString &segment, int32_t segL en, UErrorCode &status); //Hashtable *getEquivalents2(const UnicodeString &segment, int32_t segL en, UErrorCode &status);
/** /**
* See if the decomposition of cp2 is at segment starting at segmentPos * See if the decomposition of cp2 is at segment starting at segmentPos
* (with canonical rearrangment!) * (with canonical rearrangment!)
 End of changes. 3 change blocks. 
1 lines changed or deleted 4 lines changed or added


 coll.h   coll.h 
/* /*
*************************************************************************** *** *************************************************************************** ***
* Copyright (C) 1996-2009, International Business Machines * * Copyright (C) 1996-2010, International Business Machines *
* Corporation and others. All Rights Reserved. * * Corporation and others. All Rights Reserved. *
*************************************************************************** *** *************************************************************************** ***
*/ */
/** /**
* \file * \file
* \brief C++ API: Collation Service. * \brief C++ API: Collation Service.
*/ */
/** /**
skipping to change at line 451 skipping to change at line 451
/** /**
* Compares two strings using the Collator. * Compares two strings using the Collator.
* Returns whether the first one compares less than/equal to/greater th an * Returns whether the first one compares less than/equal to/greater th an
* the second one. * the second one.
* This version takes UCharIterator input. * This version takes UCharIterator input.
* @param sIter the first ("source") string iterator * @param sIter the first ("source") string iterator
* @param tIter the second ("target") string iterator * @param tIter the second ("target") string iterator
* @param status ICU status * @param status ICU status
* @return UCOL_LESS, UCOL_EQUAL or UCOL_GREATER * @return UCOL_LESS, UCOL_EQUAL or UCOL_GREATER
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
virtual UCollationResult compare(UCharIterator &sIter, virtual UCollationResult compare(UCharIterator &sIter,
UCharIterator &tIter, UCharIterator &tIter,
UErrorCode &status) const; UErrorCode &status) const;
/** /**
* Compares two UTF-8 strings using the Collator. * Compares two UTF-8 strings using the Collator.
* Returns whether the first one compares less than/equal to/greater th an * Returns whether the first one compares less than/equal to/greater th an
* the second one. * the second one.
* This version takes UTF-8 input. * This version takes UTF-8 input.
* Note that a StringPiece can be implicitly constructed * Note that a StringPiece can be implicitly constructed
* from a std::string or a NUL-terminated const char * string. * from a std::string or a NUL-terminated const char * string.
* @param source the first UTF-8 string * @param source the first UTF-8 string
* @param target the second UTF-8 string * @param target the second UTF-8 string
* @param status ICU status * @param status ICU status
* @return UCOL_LESS, UCOL_EQUAL or UCOL_GREATER * @return UCOL_LESS, UCOL_EQUAL or UCOL_GREATER
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
virtual UCollationResult compareUTF8(const StringPiece &source, virtual UCollationResult compareUTF8(const StringPiece &source,
const StringPiece &target, const StringPiece &target,
UErrorCode &status) const; UErrorCode &status) const;
/** /**
* Transforms the string into a series of characters that can be compar ed * Transforms the string into a series of characters that can be compar ed
* with CollationKey::compareTo. It is not possible to restore the orig inal * with CollationKey::compareTo. It is not possible to restore the orig inal
* string from the chars in the sort key. The generated sort key handl es * string from the chars in the sort key. The generated sort key handl es
* only a limited number of ignorable characters. * only a limited number of ignorable characters.
skipping to change at line 685 skipping to change at line 685
* plus input keyword and that value has different behavior than creati on with the * plus input keyword and that value has different behavior than creati on with the
* input locale alone. * input locale alone.
* @param keyword one of the keys supported by this service. Fo r now, only * @param keyword one of the keys supported by this service. Fo r now, only
* "collation" is supported. * "collation" is supported.
* @param locale the locale * @param locale the locale
* @param commonlyUsed if set to true it will return only commonly use d values * @param commonlyUsed if set to true it will return only commonly use d values
* with the given locale in preferred order. Othe rwise, * with the given locale in preferred order. Othe rwise,
* it will return all the available values for the locale. * it will return all the available values for the locale.
* @param status ICU status * @param status ICU status
* @return a string enumeration over keyword values for the given key a nd the locale. * @return a string enumeration over keyword values for the given key a nd the locale.
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
static StringEnumeration* U_EXPORT2 getKeywordValuesForLocale(const cha r* keyword, const Locale& locale, static StringEnumeration* U_EXPORT2 getKeywordValuesForLocale(const cha r* keyword, const Locale& locale,
UBool c ommonlyUsed, UErrorCode& status); UBool c ommonlyUsed, UErrorCode& status);
/** /**
* Return the functionally equivalent locale for the given * Return the functionally equivalent locale for the given
* requested locale, with respect to given keyword, for the * requested locale, with respect to given keyword, for the
* collation service. If two locales return the same result, then * collation service. If two locales return the same result, then
* collators instantiated for these locales will behave * collators instantiated for these locales will behave
* equivalently. The converse is not always true; two collators * equivalently. The converse is not always true; two collators
 End of changes. 4 change blocks. 
4 lines changed or deleted 4 lines changed or added


 currpinf.h   currpinf.h 
/* /*
************************************************************************** ***** ************************************************************************** *****
* Copyright (C) 2009, International Business Machines Corporation and * * Copyright (C) 2009-2010, International Business Machines Corporation and *
* others. All Rights Reserved. * * others. All Rights Reserved. *
************************************************************************** ***** ************************************************************************** *****
*/ */
#ifndef CURRPINF_H #ifndef CURRPINF_H
#define CURRPINF_H #define CURRPINF_H
#include "unicode/utypes.h" #include "unicode/utypes.h"
/** /**
* \file * \file
skipping to change at line 44 skipping to change at line 44
* CurrencyPluralInfo from its locale data. * CurrencyPluralInfo from its locale data.
* If you need to change any of these symbols, you can get the * If you need to change any of these symbols, you can get the
* CurrencyPluralInfo object from your * CurrencyPluralInfo object from your
* DecimalFormat and modify it. * DecimalFormat and modify it.
* *
* Following are the information needed for currency plural format and pars e: * Following are the information needed for currency plural format and pars e:
* locale information, * locale information,
* plural rule of the locale, * plural rule of the locale,
* currency plural pattern of the locale. * currency plural pattern of the locale.
* *
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
class U_I18N_API CurrencyPluralInfo : public UObject { class U_I18N_API CurrencyPluralInfo : public UObject {
public: public:
/** /**
* Create a CurrencyPluralInfo object for the default locale. * Create a CurrencyPluralInfo object for the default locale.
* @param status output param set to success/failure code on exit * @param status output param set to success/failure code on exit
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
CurrencyPluralInfo(UErrorCode& status); CurrencyPluralInfo(UErrorCode& status);
/** /**
* Create a CurrencyPluralInfo object for the given locale. * Create a CurrencyPluralInfo object for the given locale.
* @param locale the locale * @param locale the locale
* @param status output param set to success/failure code on exit * @param status output param set to success/failure code on exit
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
CurrencyPluralInfo(const Locale& locale, UErrorCode& status); CurrencyPluralInfo(const Locale& locale, UErrorCode& status);
/** /**
* Copy constructor * Copy constructor
* *
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
CurrencyPluralInfo(const CurrencyPluralInfo& info); CurrencyPluralInfo(const CurrencyPluralInfo& info);
/** /**
* Assignment operator * Assignment operator
* *
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
CurrencyPluralInfo& operator=(const CurrencyPluralInfo& info); CurrencyPluralInfo& operator=(const CurrencyPluralInfo& info);
/** /**
* Destructor * Destructor
* *
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
virtual ~CurrencyPluralInfo(); virtual ~CurrencyPluralInfo();
/** /**
* Equal operator. * Equal operator.
* *
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
UBool operator==(const CurrencyPluralInfo& info) const; UBool operator==(const CurrencyPluralInfo& info) const;
/** /**
* Not equal operator * Not equal operator
* *
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
UBool operator!=(const CurrencyPluralInfo& info) const; UBool operator!=(const CurrencyPluralInfo& info) const;
/** /**
* Clone * Clone
* *
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
CurrencyPluralInfo* clone() const; CurrencyPluralInfo* clone() const;
/** /**
* Gets plural rules of this locale, used for currency plural format * Gets plural rules of this locale, used for currency plural format
* *
* @return plural rule * @return plural rule
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
const PluralRules* getPluralRules() const; const PluralRules* getPluralRules() const;
/** /**
* Given a plural count, gets currency plural pattern of this locale, * Given a plural count, gets currency plural pattern of this locale,
* used for currency plural format * used for currency plural format
* *
* @param pluralCount currency plural count * @param pluralCount currency plural count
* @param result output param to receive the pattern * @param result output param to receive the pattern
* @return a currency plural pattern based on plural count * @return a currency plural pattern based on plural count
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
UnicodeString& getCurrencyPluralPattern(const UnicodeString& pluralCoun t, UnicodeString& getCurrencyPluralPattern(const UnicodeString& pluralCoun t,
UnicodeString& result) const; UnicodeString& result) const;
/** /**
* Get locale * Get locale
* *
* @return locale * @return locale
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
const Locale& getLocale() const; const Locale& getLocale() const;
/** /**
* Set plural rules. * Set plural rules.
* The plural rule is set when CurrencyPluralInfo * The plural rule is set when CurrencyPluralInfo
* instance is created. * instance is created.
* You can call this method to reset plural rules only if you want * You can call this method to reset plural rules only if you want
* to modify the default plural rule of the locale. * to modify the default plural rule of the locale.
* *
* @param ruleDescription new plural rule description * @param ruleDescription new plural rule description
* @param status output param set to success/failure code on exit * @param status output param set to success/failure code on exit
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
void setPluralRules(const UnicodeString& ruleDescription, void setPluralRules(const UnicodeString& ruleDescription,
UErrorCode& status); UErrorCode& status);
/** /**
* Set currency plural pattern. * Set currency plural pattern.
* The currency plural pattern is set when CurrencyPluralInfo * The currency plural pattern is set when CurrencyPluralInfo
* instance is created. * instance is created.
* You can call this method to reset currency plural pattern only if * You can call this method to reset currency plural pattern only if
* you want to modify the default currency plural pattern of the locale . * you want to modify the default currency plural pattern of the locale .
* *
* @param pluralCount the plural count for which the currency pattern w ill * @param pluralCount the plural count for which the currency pattern w ill
* be overridden. * be overridden.
* @param pattern the new currency plural pattern * @param pattern the new currency plural pattern
* @param status output param set to success/failure code on exit * @param status output param set to success/failure code on exit
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
void setCurrencyPluralPattern(const UnicodeString& pluralCount, void setCurrencyPluralPattern(const UnicodeString& pluralCount,
const UnicodeString& pattern, const UnicodeString& pattern,
UErrorCode& status); UErrorCode& status);
/** /**
* Set locale * Set locale
* *
* @param loc the new locale to set * @param loc the new locale to set
* @param status output param set to success/failure code on exit * @param status output param set to success/failure code on exit
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
void setLocale(const Locale& loc, UErrorCode& status); void setLocale(const Locale& loc, UErrorCode& status);
/** /**
* ICU "poor man's RTTI", returns a UClassID for the actual class. * ICU "poor man's RTTI", returns a UClassID for the actual class.
* *
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
virtual UClassID getDynamicClassID() const; virtual UClassID getDynamicClassID() const;
/** /**
* ICU "poor man's RTTI", returns a UClassID for this class. * ICU "poor man's RTTI", returns a UClassID for this class.
* *
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
static UClassID U_EXPORT2 getStaticClassID(); static UClassID U_EXPORT2 getStaticClassID();
private: private:
friend class DecimalFormat; friend class DecimalFormat;
void initialize(const Locale& loc, UErrorCode& status); void initialize(const Locale& loc, UErrorCode& status);
void setupCurrencyPluralPattern(const Locale& loc, UErrorCode& status); void setupCurrencyPluralPattern(const Locale& loc, UErrorCode& status);
 End of changes. 18 change blocks. 
18 lines changed or deleted 18 lines changed or added


 datefmt.h   datefmt.h 
/* /*
************************************************************************** ****** ************************************************************************** ******
* Copyright (C) 1997-2009, International Business Machines * Copyright (C) 1997-2010, International Business Machines
* Corporation and others. All Rights Reserved. * Corporation and others. All Rights Reserved.
************************************************************************** ****** ************************************************************************** ******
* *
* File DATEFMT.H * File DATEFMT.H
* *
* Modification History: * Modification History:
* *
* Date Name Description * Date Name Description
* 02/19/97 aliu Converted from java. * 02/19/97 aliu Converted from java.
* 04/01/97 aliu Added support for centuries. * 04/01/97 aliu Added support for centuries.
skipping to change at line 231 skipping to change at line 231
* @param status Output param filled with success/failure status. * @param status Output param filled with success/failure status.
* @return Reference to 'appendTo' parameter. * @return Reference to 'appendTo' parameter.
* @stable ICU 2.0 * @stable ICU 2.0
*/ */
virtual UnicodeString& format(const Formattable& obj, virtual UnicodeString& format(const Formattable& obj,
UnicodeString& appendTo, UnicodeString& appendTo,
FieldPosition& pos, FieldPosition& pos,
UErrorCode& status) const; UErrorCode& status) const;
/** /**
* Format an object to produce a string. This method handles Formattabl
e
* objects with a UDate type. If a the Formattable object type is not a
Date,
* then it returns a failing UErrorCode.
*
* @param obj The object to format. Must be a Date.
* @param appendTo Output parameter to receive result.
* Result is appended to existing contents.
* @param posIter On return, can be used to iterate over positions
* of fields generated by this format call. Field val
ues
* are defined in UDateFormatField.
* @param status Output param filled with success/failure status.
* @return Reference to 'appendTo' parameter.
* @draft ICU 4.4
*/
virtual UnicodeString& format(const Formattable& obj,
UnicodeString& appendTo,
FieldPositionIterator& posIter,
UErrorCode& status) const;
/**
* Formats a date into a date/time string. This is an abstract method w hich * Formats a date into a date/time string. This is an abstract method w hich
* concrete subclasses must implement. * concrete subclasses must implement.
* <P> * <P>
* On input, the FieldPosition parameter may have its "field" member fi lled with * On input, the FieldPosition parameter may have its "field" member fi lled with
* an enum value specifying a field. On output, the FieldPosition will be filled * an enum value specifying a field. On output, the FieldPosition will be filled
* in with the text offsets for that field. * in with the text offsets for that field.
* <P> For example, given a time text * <P> For example, given a time text
* "1996.07.10 AD at 15:08:56 PDT", if the given fieldPosition.field is * "1996.07.10 AD at 15:08:56 PDT", if the given fieldPosition.field is
* UDAT_YEAR_FIELD, the offsets fieldPosition.beginIndex and * UDAT_YEAR_FIELD, the offsets fieldPosition.beginIndex and
* statfieldPositionus.getEndIndex will be set to 0 and 4, respectively . * statfieldPositionus.getEndIndex will be set to 0 and 4, respectively .
skipping to change at line 268 skipping to change at line 287
* @param fieldPosition On input: an alignment field, if desired (see e xamples above) * @param fieldPosition On input: an alignment field, if desired (see e xamples above)
* On output: the offsets of the alignment field ( see examples above) * On output: the offsets of the alignment field ( see examples above)
* @return Reference to 'appendTo' parameter. * @return Reference to 'appendTo' parameter.
* @stable ICU 2.1 * @stable ICU 2.1
*/ */
virtual UnicodeString& format( Calendar& cal, virtual UnicodeString& format( Calendar& cal,
UnicodeString& appendTo, UnicodeString& appendTo,
FieldPosition& fieldPosition) const = 0 ; FieldPosition& fieldPosition) const = 0 ;
/** /**
* Formats a date into a date/time string. Subclasses should implement
this method.
*
* @param cal Calendar set to the date and time to be formatted
* into a date/time string. When the calendar type is
* different from the internal calendar held by this
* DateFormat instance, the date and the time zone wil
l
* be inherited from the input calendar, but other cal
endar
* field values will be calculated by the internal cal
endar.
* @param appendTo Output parameter to receive result.
* Result is appended to existing contents.
* @param posIter On return, can be used to iterate over positions
* of fields generated by this format call. Field val
ues
* are defined in UDateFormatField.
* @param status error status.
* @return Reference to 'appendTo' parameter.
* @draft ICU 4.4
*/
virtual UnicodeString& format(Calendar& cal,
UnicodeString& appendTo,
FieldPositionIterator& posIter,
UErrorCode& status) const;
/**
* Formats a UDate into a date/time string. * Formats a UDate into a date/time string.
* <P> * <P>
* On input, the FieldPosition parameter may have its "field" member fi lled with * On input, the FieldPosition parameter may have its "field" member fi lled with
* an enum value specifying a field. On output, the FieldPosition will be filled * an enum value specifying a field. On output, the FieldPosition will be filled
* in with the text offsets for that field. * in with the text offsets for that field.
* <P> For example, given a time text * <P> For example, given a time text
* "1996.07.10 AD at 15:08:56 PDT", if the given fieldPosition.field is * "1996.07.10 AD at 15:08:56 PDT", if the given fieldPosition.field is
* UDAT_YEAR_FIELD, the offsets fieldPosition.beginIndex and * UDAT_YEAR_FIELD, the offsets fieldPosition.beginIndex and
* statfieldPositionus.getEndIndex will be set to 0 and 4, respectively . * statfieldPositionus.getEndIndex will be set to 0 and 4, respectively .
* <P> Notice * <P> Notice
skipping to change at line 299 skipping to change at line 340
* @param fieldPosition On input: an alignment field, if desired (see e xamples above) * @param fieldPosition On input: an alignment field, if desired (see e xamples above)
* On output: the offsets of the alignment field ( see examples above) * On output: the offsets of the alignment field ( see examples above)
* @return Reference to 'appendTo' parameter. * @return Reference to 'appendTo' parameter.
* @stable ICU 2.0 * @stable ICU 2.0
*/ */
UnicodeString& format( UDate date, UnicodeString& format( UDate date,
UnicodeString& appendTo, UnicodeString& appendTo,
FieldPosition& fieldPosition) const; FieldPosition& fieldPosition) const;
/** /**
* Formats a UDate into a date/time string.
*
* @param date UDate to be formatted into a date/time string.
* @param appendTo Output parameter to receive result.
* Result is appended to existing contents.
* @param posIter On return, can be used to iterate over positions
* of fields generated by this format call. Field val
ues
* are defined in UDateFormatField.
* @param status error status.
* @return Reference to 'appendTo' parameter.
* @draft ICU 4.4
*/
UnicodeString& format(UDate date,
UnicodeString& appendTo,
FieldPositionIterator& posIter,
UErrorCode& status) const;
/**
* Formats a UDate into a date/time string. If there is a problem, you won't * Formats a UDate into a date/time string. If there is a problem, you won't
* know, using this method. Use the overloaded format() method which ta kes a * know, using this method. Use the overloaded format() method which ta kes a
* FieldPosition& to detect formatting problems. * FieldPosition& to detect formatting problems.
* *
* @param date The UDate value to be formatted into a string. * @param date The UDate value to be formatted into a string.
* @param appendTo Output parameter to receive result. * @param appendTo Output parameter to receive result.
* Result is appended to existing contents. * Result is appended to existing contents.
* @return Reference to 'appendTo' parameter. * @return Reference to 'appendTo' parameter.
* @stable ICU 2.0 * @stable ICU 2.0
*/ */
 End of changes. 4 change blocks. 
1 lines changed or deleted 68 lines changed or added


 dcfmtsym.h   dcfmtsym.h 
/* /*
*************************************************************************** ***** *************************************************************************** *****
* Copyright (C) 1997-2009, International Business Machines * Copyright (C) 1997-2010, International Business Machines
* Corporation and others. All Rights Reserved. * Corporation and others. All Rights Reserved.
*************************************************************************** ***** *************************************************************************** *****
* *
* File DCFMTSYM.H * File DCFMTSYM.H
* *
* Modification History: * Modification History:
* *
* Date Name Description * Date Name Description
* 02/19/97 aliu Converted from java. * 02/19/97 aliu Converted from java.
* 03/18/97 clhuang Updated per C++ implementation. * 03/18/97 clhuang Updated per C++ implementation.
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 decimfmt.h   decimfmt.h 
/* /*
*************************************************************************** ***** *************************************************************************** *****
* Copyright (C) 1997-2009, International Business Machines * Copyright (C) 1997-2010, International Business Machines
* Corporation and others. All Rights Reserved. * Corporation and others. All Rights Reserved.
*************************************************************************** ***** *************************************************************************** *****
* *
* File DECIMFMT.H * File DECIMFMT.H
* *
* Modification History: * Modification History:
* *
* Date Name Description * Date Name Description
* 02/19/97 aliu Converted from java. * 02/19/97 aliu Converted from java.
* 03/20/97 clhuang Updated per C++ implementation. * 03/20/97 clhuang Updated per C++ implementation.
skipping to change at line 38 skipping to change at line 38
/** /**
* \file * \file
* \brief C++ API: Formats decimal numbers. * \brief C++ API: Formats decimal numbers.
*/ */
#if !UCONFIG_NO_FORMATTING #if !UCONFIG_NO_FORMATTING
#include "unicode/dcfmtsym.h" #include "unicode/dcfmtsym.h"
#include "unicode/numfmt.h" #include "unicode/numfmt.h"
#include "unicode/locid.h" #include "unicode/locid.h"
#include "unicode/fpositer.h"
#include "unicode/stringpiece.h"
union UHashTok; union UHashTok;
U_NAMESPACE_BEGIN U_NAMESPACE_BEGIN
U_CDECL_BEGIN
/**
* @internal ICU 4.2
*/
UBool U_CALLCONV decimfmtAffixValueComparator(UHashTok val1, UHashTok val2)
;
/**
* @internal ICU 4.2
*/
UBool U_CALLCONV decimfmtAffixPatternValueComparator(UHashTok val1, UHashTo
k val2) ;
U_CDECL_END
class DigitList; class DigitList;
class ChoiceFormat; class ChoiceFormat;
class CurrencyPluralInfo; class CurrencyPluralInfo;
class Hashtable; class Hashtable;
class FieldPositionHandler;
/** /**
* DecimalFormat is a concrete subclass of NumberFormat that formats decima l * DecimalFormat is a concrete subclass of NumberFormat that formats decima l
* numbers. It has a variety of features designed to make it possible to pa rse * numbers. It has a variety of features designed to make it possible to pa rse
* and format numbers in any locale, including support for Western, Arabic, or * and format numbers in any locale, including support for Western, Arabic, or
* Indic digits. It also supports different flavors of numbers, including * Indic digits. It also supports different flavors of numbers, including
* integers ("123"), fixed-point numbers ("123.4"), scientific notation * integers ("123"), fixed-point numbers ("123.4"), scientific notation
* ("1.23E4"), percentages ("12%"), and currency amounts ("$123", "USD123", * ("1.23E4"), percentages ("12%"), and currency amounts ("$123", "USD123",
* "123 US dollars"). All of these flavors can be easily localized. * "123 US dollars"). All of these flavors can be easily localized.
* *
skipping to change at line 851 skipping to change at line 840
* @param appendTo Output parameter to receive result. * @param appendTo Output parameter to receive result.
* Result is appended to existing contents. * Result is appended to existing contents.
* @param pos On input: an alignment field, if desired. * @param pos On input: an alignment field, if desired.
* On output: the offsets of the alignment field. * On output: the offsets of the alignment field.
* @return Reference to 'appendTo' parameter. * @return Reference to 'appendTo' parameter.
* @stable ICU 2.0 * @stable ICU 2.0
*/ */
virtual UnicodeString& format(double number, virtual UnicodeString& format(double number,
UnicodeString& appendTo, UnicodeString& appendTo,
FieldPosition& pos) const; FieldPosition& pos) const;
/**
* Format a double or long number using base-10 representation.
*
* @param number The value to be formatted.
* @param appendTo Output parameter to receive result.
* Result is appended to existing contents.
* @param posIter On return, can be used to iterate over positions
* of fields generated by this format call.
* @param status Output param filled with success/failure status.
* @return Reference to 'appendTo' parameter.
* @draft 4.4
*/
virtual UnicodeString& format(double number,
UnicodeString& appendTo,
FieldPositionIterator& posIter,
UErrorCode& status) const;
/** /**
* Format a long number using base-10 representation. * Format a long number using base-10 representation.
* *
* @param number The value to be formatted. * @param number The value to be formatted.
* @param appendTo Output parameter to receive result. * @param appendTo Output parameter to receive result.
* Result is appended to existing contents. * Result is appended to existing contents.
* @param pos On input: an alignment field, if desired. * @param pos On input: an alignment field, if desired.
* On output: the offsets of the alignment field. * On output: the offsets of the alignment field.
* @return Reference to 'appendTo' parameter. * @return Reference to 'appendTo' parameter.
* @stable ICU 2.0 * @stable ICU 2.0
*/ */
virtual UnicodeString& format(int32_t number, virtual UnicodeString& format(int32_t number,
UnicodeString& appendTo, UnicodeString& appendTo,
FieldPosition& pos) const; FieldPosition& pos) const;
/**
* Format a long number using base-10 representation.
*
* @param number The value to be formatted.
* @param appendTo Output parameter to receive result.
* Result is appended to existing contents.
* @param posIter On return, can be used to iterate over positions
* of fields generated by this format call.
* @param status Output param filled with success/failure status.
* @return Reference to 'appendTo' parameter.
* @draft 4.4
*/
virtual UnicodeString& format(int32_t number,
UnicodeString& appendTo,
FieldPositionIterator& posIter,
UErrorCode& status) const;
/** /**
* Format an int64 number using base-10 representation. * Format an int64 number using base-10 representation.
* *
* @param number The value to be formatted. * @param number The value to be formatted.
* @param appendTo Output parameter to receive result. * @param appendTo Output parameter to receive result.
* Result is appended to existing contents. * Result is appended to existing contents.
* @param pos On input: an alignment field, if desired. * @param pos On input: an alignment field, if desired.
* On output: the offsets of the alignment field. * On output: the offsets of the alignment field.
* @return Reference to 'appendTo' parameter. * @return Reference to 'appendTo' parameter.
* @stable ICU 2.8 * @stable ICU 2.8
*/ */
virtual UnicodeString& format(int64_t number, virtual UnicodeString& format(int64_t number,
UnicodeString& appendTo, UnicodeString& appendTo,
FieldPosition& pos) const; FieldPosition& pos) const;
/** /**
* Format an int64 number using base-10 representation.
*
* @param number The value to be formatted.
* @param appendTo Output parameter to receive result.
* Result is appended to existing contents.
* @param posIter On return, can be used to iterate over positions
* of fields generated by this format call.
* @param status Output param filled with success/failure status.
* @return Reference to 'appendTo' parameter.
* @draft 4.4
*/
virtual UnicodeString& format(int64_t number,
UnicodeString& appendTo,
FieldPositionIterator& posIter,
UErrorCode& status) const;
/**
* Format a decimal number.
* The syntax of the unformatted number is a "numeric string"
* as defined in the Decimal Arithmetic Specification, available at
* http://speleotrove.com/decimal
*
* @param number The unformatted number, as a string.
* @param appendTo Output parameter to receive result.
* Result is appended to existing contents.
* @param posIter On return, can be used to iterate over positions
* of fields generated by this format call.
* @param status Output param filled with success/failure status.
* @return Reference to 'appendTo' parameter.
* @draft 4.4
*/
virtual UnicodeString& format(const StringPiece &number,
UnicodeString& appendTo,
FieldPositionIterator& posIter,
UErrorCode& status) const;
/**
* Format a Formattable using base-10 representation. * Format a Formattable using base-10 representation.
* *
* @param obj The value to be formatted. * @param obj The value to be formatted.
* @param appendTo Output parameter to receive result. * @param appendTo Output parameter to receive result.
* Result is appended to existing contents. * Result is appended to existing contents.
* @param pos On input: an alignment field, if desired. * @param pos On input: an alignment field, if desired.
* On output: the offsets of the alignment field. * On output: the offsets of the alignment field.
* @param status Error code indicating success or failure. * @param status Error code indicating success or failure.
* @return Reference to 'appendTo' parameter. * @return Reference to 'appendTo' parameter.
* @stable ICU 2.0 * @stable ICU 2.0
skipping to change at line 1040 skipping to change at line 1102
* by the programmer or user. * by the programmer or user.
* @param symbols DecimalFormatSymbols. * @param symbols DecimalFormatSymbols.
* @stable ICU 2.0 * @stable ICU 2.0
*/ */
virtual void setDecimalFormatSymbols(const DecimalFormatSymbols& symbol s); virtual void setDecimalFormatSymbols(const DecimalFormatSymbols& symbol s);
/** /**
* Returns the currency plural format information, * Returns the currency plural format information,
* which is generally not changed by the programmer or user. * which is generally not changed by the programmer or user.
* @return desired CurrencyPluralInfo * @return desired CurrencyPluralInfo
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
virtual const CurrencyPluralInfo* getCurrencyPluralInfo(void) const; virtual const CurrencyPluralInfo* getCurrencyPluralInfo(void) const;
/** /**
* Sets the currency plural format information, * Sets the currency plural format information,
* which is generally not changed by the programmer or user. * which is generally not changed by the programmer or user.
* @param toAdopt CurrencyPluralInfo to be adopted. * @param toAdopt CurrencyPluralInfo to be adopted.
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
virtual void adoptCurrencyPluralInfo(CurrencyPluralInfo* toAdopt); virtual void adoptCurrencyPluralInfo(CurrencyPluralInfo* toAdopt);
/** /**
* Sets the currency plural format information, * Sets the currency plural format information,
* which is generally not changed by the programmer or user. * which is generally not changed by the programmer or user.
* @param info Currency Plural Info. * @param info Currency Plural Info.
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
virtual void setCurrencyPluralInfo(const CurrencyPluralInfo& info); virtual void setCurrencyPluralInfo(const CurrencyPluralInfo& info);
/** /**
* Get the positive prefix. * Get the positive prefix.
* *
* @param result Output param which will receive the positive prefix . * @param result Output param which will receive the positive prefix .
* @return A reference to 'result'. * @return A reference to 'result'.
* Examples: +123, $123, sFr123 * Examples: +123, $123, sFr123
* @stable ICU 2.0 * @stable ICU 2.0
skipping to change at line 1734 skipping to change at line 1796
* clone() methods call this method. * clone() methods call this method.
* *
* @return The class ID for this object. All objects of a * @return The class ID for this object. All objects of a
* given class have the same class ID. Objects of * given class have the same class ID. Objects of
* other classes have different class IDs. * other classes have different class IDs.
* @stable ICU 2.0 * @stable ICU 2.0
*/ */
virtual UClassID getDynamicClassID(void) const; virtual UClassID getDynamicClassID(void) const;
private: private:
friend UBool U_CALLCONV decimfmtAffixValueComparator(UHashTok val1, UHa
shTok val2);
friend UBool U_CALLCONV decimfmtAffixPatternValueComparator(UHashTok va
l1, UHashTok val2);
DecimalFormat(); // default constructor not implemented DecimalFormat(); // default constructor not implemented
int32_t precision(UBool isIntegral) const; int32_t precision(UBool isIntegral) const;
/** /**
* Do real work of constructing a new DecimalFormat. * Do real work of constructing a new DecimalFormat.
*/ */
void construct(UErrorCode& status, void construct(UErrorCode& status,
UParseError& parseErr, UParseError& parseErr,
skipping to change at line 1802 skipping to change at line 1862
/* /*
* expand affixes (after apply patter) and re-compute fFormatWidth * expand affixes (after apply patter) and re-compute fFormatWidth
*/ */
void expandAffixAdjustWidth(const UnicodeString* pluralCount); void expandAffixAdjustWidth(const UnicodeString* pluralCount);
/** /**
* Do the work of formatting a number, either a double or a long. * Do the work of formatting a number, either a double or a long.
* *
* @param appendTo Output parameter to receive result. * @param appendTo Output parameter to receive result.
* Result is appended to existing contents. * Result is appended to existing contents.
* @param fieldPosition On input: an alignment field, if desired. * @param handler Records information about field positions.
* On output: the offsets of the alignment field.
* @param digits the digits to be formatted. * @param digits the digits to be formatted.
* @param isInteger if TRUE format the digits as Integer. * @param isInteger if TRUE format the digits as Integer.
* @return Reference to 'appendTo' parameter. * @return Reference to 'appendTo' parameter.
*/ */
UnicodeString& subformat(UnicodeString& appendTo, UnicodeString& subformat(UnicodeString& appendTo,
FieldPosition& fieldPosition, FieldPositionHandler& handler,
DigitList& digits, DigitList& digits,
UBool isInteger) const; UBool isInteger) const;
void parse(const UnicodeString& text, void parse(const UnicodeString& text,
Formattable& result, Formattable& result,
ParsePosition& pos, ParsePosition& pos,
UBool parseCurrency) const; UBool parseCurrency) const;
enum { enum {
fgStatusInfinite, fgStatusInfinite,
fgStatusLength // Leave last in list. fgStatusLength // Leave last in list.
} StatusFlags; } StatusFlags;
skipping to change at line 1881 skipping to change at line 1940
static int32_t match(const UnicodeString& text, int32_t pos, const Unic odeString& str); static int32_t match(const UnicodeString& text, int32_t pos, const Unic odeString& str);
/** /**
* Get a decimal format symbol. * Get a decimal format symbol.
* Returns a const reference to the symbol string. * Returns a const reference to the symbol string.
* @internal * @internal
*/ */
inline const UnicodeString &getConstSymbol(DecimalFormatSymbols::ENumbe rFormatSymbol symbol) const; inline const UnicodeString &getConstSymbol(DecimalFormatSymbols::ENumbe rFormatSymbol symbol) const;
int32_t appendAffix(UnicodeString& buf, double number, int32_t appendAffix(UnicodeString& buf,
UBool isNegative, UBool isPrefix) const; double number,
FieldPositionHandler& handler,
UBool isNegative,
UBool isPrefix) const;
/** /**
* Append an affix to the given UnicodeString, using quotes if * Append an affix to the given UnicodeString, using quotes if
* there are special characters. Single quotes themselves must be * there are special characters. Single quotes themselves must be
* escaped in either case. * escaped in either case.
*/ */
void appendAffixPattern(UnicodeString& appendTo, const UnicodeString& a ffix, void appendAffixPattern(UnicodeString& appendTo, const UnicodeString& a ffix,
UBool localized) const; UBool localized) const;
void appendAffixPattern(UnicodeString& appendTo, void appendAffixPattern(UnicodeString& appendTo,
const UnicodeString* affixPattern, const UnicodeString* affixPattern,
const UnicodeString& expAffix, UBool localized) const; const UnicodeString& expAffix, UBool localized) const;
void expandAffix(const UnicodeString& pattern, void expandAffix(const UnicodeString& pattern,
UnicodeString& affix, UnicodeString& affix,
double number, double number,
FieldPositionHandler& handler,
UBool doFormat, UBool doFormat,
const UnicodeString* pluralCount) const; const UnicodeString* pluralCount) const;
void expandAffixes(const UnicodeString* pluralCount); void expandAffixes(const UnicodeString* pluralCount);
static double round(double a, ERoundingMode mode, UBool isNegative); static double round(double a, ERoundingMode mode, UBool isNegative);
void addPadding(UnicodeString& appendTo, void addPadding(UnicodeString& appendTo,
FieldPosition& fieldPosition, FieldPositionHandler& handler,
int32_t prefixLen, int32_t suffixLen) const; int32_t prefixLen, int32_t suffixLen) const;
UBool isGroupingPosition(int32_t pos) const; UBool isGroupingPosition(int32_t pos) const;
void setCurrencyForSymbols(); void setCurrencyForSymbols();
// similar to setCurrency without re-compute the affixes for currency. // similar to setCurrency without re-compute the affixes for currency.
// If currency changes, the affix pattern for currency is not changed, // If currency changes, the affix pattern for currency is not changed,
// but the affix will be changed. So, affixes need to be // but the affix will be changed. So, affixes need to be
// re-computed in setCurrency(), but not in setCurrencyInternally(). // re-computed in setCurrency(), but not in setCurrencyInternally().
skipping to change at line 1947 skipping to change at line 2010
Hashtable* initHashForAffix(UErrorCode& status); Hashtable* initHashForAffix(UErrorCode& status);
void deleteHashForAffixPattern(); void deleteHashForAffixPattern();
void deleteHashForAffix(Hashtable*& table); void deleteHashForAffix(Hashtable*& table);
void copyHashForAffixPattern(const Hashtable* source, void copyHashForAffixPattern(const Hashtable* source,
Hashtable* target, UErrorCode& status); Hashtable* target, UErrorCode& status);
void copyHashForAffix(const Hashtable* source, void copyHashForAffix(const Hashtable* source,
Hashtable* target, UErrorCode& status); Hashtable* target, UErrorCode& status);
UnicodeString& _format(int64_t number,
UnicodeString& appendTo,
FieldPositionHandler& handler) const;
UnicodeString& _format(double number,
UnicodeString& appendTo,
FieldPositionHandler& handler) const;
// currency sign count // currency sign count
enum { enum {
fgCurrencySignCountZero, fgCurrencySignCountZero,
fgCurrencySignCountInSymbolFormat, fgCurrencySignCountInSymbolFormat,
fgCurrencySignCountInISOFormat, fgCurrencySignCountInISOFormat,
fgCurrencySignCountInPluralFormat fgCurrencySignCountInPluralFormat
} CurrencySignCount; } CurrencySignCount;
/** /**
* Constants. * Constants.
skipping to change at line 2031 skipping to change at line 2101
*/ */
int fCurrencySignCount; int fCurrencySignCount;
/* For currency parsing purose, /* For currency parsing purose,
* Need to remember all prefix patterns and suffix patterns of * Need to remember all prefix patterns and suffix patterns of
* every currency format pattern, * every currency format pattern,
* including the pattern of default currecny style * including the pattern of default currecny style
* and plural currency style. And the patterns are set through applyPat tern. * and plural currency style. And the patterns are set through applyPat tern.
*/ */
// TODO: innerclass? // TODO: innerclass?
/* This is not needed in the class declaration, so it is moved into decimfmp.cpp
struct AffixPatternsForCurrency : public UMemory { struct AffixPatternsForCurrency : public UMemory {
// negative prefix pattern // negative prefix pattern
UnicodeString negPrefixPatternForCurrency; UnicodeString negPrefixPatternForCurrency;
// negative suffix pattern // negative suffix pattern
UnicodeString negSuffixPatternForCurrency; UnicodeString negSuffixPatternForCurrency;
// positive prefix pattern // positive prefix pattern
UnicodeString posPrefixPatternForCurrency; UnicodeString posPrefixPatternForCurrency;
// positive suffix pattern // positive suffix pattern
UnicodeString posSuffixPatternForCurrency; UnicodeString posSuffixPatternForCurrency;
int8_t patternType; int8_t patternType;
skipping to change at line 2054 skipping to change at line 2125
const UnicodeString& posPrefix, const UnicodeString& posPrefix,
const UnicodeString& posSuffix, const UnicodeString& posSuffix,
int8_t type) { int8_t type) {
negPrefixPatternForCurrency = negPrefix; negPrefixPatternForCurrency = negPrefix;
negSuffixPatternForCurrency = negSuffix; negSuffixPatternForCurrency = negSuffix;
posPrefixPatternForCurrency = posPrefix; posPrefixPatternForCurrency = posPrefix;
posSuffixPatternForCurrency = posSuffix; posSuffixPatternForCurrency = posSuffix;
patternType = type; patternType = type;
} }
}; };
*/
/* affix for currency formatting when the currency sign in the pattern /* affix for currency formatting when the currency sign in the pattern
* equals to 3, such as the pattern contains 3 currency sign or * equals to 3, such as the pattern contains 3 currency sign or
* the formatter style is currency plural format style. * the formatter style is currency plural format style.
*/ */
/* This is not needed in the class declaration, so it is moved into decimfmp.cpp
struct AffixesForCurrency : public UMemory { struct AffixesForCurrency : public UMemory {
// negative prefix // negative prefix
UnicodeString negPrefixForCurrency; UnicodeString negPrefixForCurrency;
// negative suffix // negative suffix
UnicodeString negSuffixForCurrency; UnicodeString negSuffixForCurrency;
// positive prefix // positive prefix
UnicodeString posPrefixForCurrency; UnicodeString posPrefixForCurrency;
// positive suffix // positive suffix
UnicodeString posSuffixForCurrency; UnicodeString posSuffixForCurrency;
skipping to change at line 2081 skipping to change at line 2154
AffixesForCurrency(const UnicodeString& negPrefix, AffixesForCurrency(const UnicodeString& negPrefix,
const UnicodeString& negSuffix, const UnicodeString& negSuffix,
const UnicodeString& posPrefix, const UnicodeString& posPrefix,
const UnicodeString& posSuffix) { const UnicodeString& posSuffix) {
negPrefixForCurrency = negPrefix; negPrefixForCurrency = negPrefix;
negSuffixForCurrency = negSuffix; negSuffixForCurrency = negSuffix;
posPrefixForCurrency = posPrefix; posPrefixForCurrency = posPrefix;
posSuffixForCurrency = posSuffix; posSuffixForCurrency = posSuffix;
} }
}; };
*/
// Affix pattern set for currency. // Affix pattern set for currency.
// It is a set of AffixPatternsForCurrency, // It is a set of AffixPatternsForCurrency,
// each element of the set saves the negative prefix pattern, // each element of the set saves the negative prefix pattern,
// negative suffix pattern, positive prefix pattern, // negative suffix pattern, positive prefix pattern,
// and positive suffix pattern of a pattern. // and positive suffix pattern of a pattern.
// It is used for currency mixed style parsing. // It is used for currency mixed style parsing.
// It is actually is a set. // It is actually is a set.
// The set contains the default currency pattern from the locale, // The set contains the default currency pattern from the locale,
// and the currency plural patterns. // and the currency plural patterns.
 End of changes. 21 change blocks. 
32 lines changed or deleted 102 lines changed or added


 dtfmtsym.h   dtfmtsym.h 
/* /*
*************************************************************************** ***** *************************************************************************** *****
* Copyright (C) 1997-2008, International Business Machines * Copyright (C) 1997-2010, International Business Machines
* Corporation and others. All Rights Reserved. * Corporation and others. All Rights Reserved.
*************************************************************************** ***** *************************************************************************** *****
* *
* File DTFMTSYM.H * File DTFMTSYM.H
* *
* Modification History: * Modification History:
* *
* Date Name Description * Date Name Description
* 02/19/97 aliu Converted from java. * 02/19/97 aliu Converted from java.
* 07/21/98 stephen Added getZoneIndex() * 07/21/98 stephen Added getZoneIndex()
skipping to change at line 221 skipping to change at line 221
* @param count Filled in with length of the array. * @param count Filled in with length of the array.
* @stable ICU 3.6 * @stable ICU 3.6
*/ */
void setEraNames(const UnicodeString* eraNames, int32_t count); void setEraNames(const UnicodeString* eraNames, int32_t count);
/** /**
* Gets narrow era strings. For example: A" and "D". * Gets narrow era strings. For example: A" and "D".
* *
* @param count Filled in with length of the array. * @param count Filled in with length of the array.
* @return the narrow era strings. * @return the narrow era strings.
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
const UnicodeString* getNarrowEras(int32_t& count) const; const UnicodeString* getNarrowEras(int32_t& count) const;
/** /**
* Sets narrow era strings. For example: "A" and "B". * Sets narrow era strings. For example: "A" and "B".
* @param narrowEras Array of narrow era strings (DateFormatSymbols re tains ownership.) * @param narrowEras Array of narrow era strings (DateFormatSymbols re tains ownership.)
* @param count Filled in with length of the array. * @param count Filled in with length of the array.
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
void setNarrowEras(const UnicodeString* narrowEras, int32_t count); void setNarrowEras(const UnicodeString* narrowEras, int32_t count);
/** /**
* Gets month strings. For example: "January", "February", etc. * Gets month strings. For example: "January", "February", etc.
* @param count Filled in with length of the array. * @param count Filled in with length of the array.
* @return the month strings. (DateFormatSymbols retains ownership.) * @return the month strings. (DateFormatSymbols retains ownership.)
* @stable ICU 2.0 * @stable ICU 2.0
*/ */
const UnicodeString* getMonths(int32_t& count) const; const UnicodeString* getMonths(int32_t& count) const;
 End of changes. 3 change blocks. 
3 lines changed or deleted 3 lines changed or added


 dtitvinf.h   dtitvinf.h 
/* /*
************************************************************************** ***** ************************************************************************** *****
* Copyright (C) 2008-2009, International Business Machines Corporation and * Copyright (C) 2008-2010, International Business Machines Corporation and
* others. All Rights Reserved. * others. All Rights Reserved.
************************************************************************** ***** ************************************************************************** *****
* *
* File DTITVINF.H * File DTITVINF.H
* *
************************************************************************** ***** ************************************************************************** *****
*/ */
#ifndef __DTITVINF_H__ #ifndef __DTITVINF_H__
#define __DTITVINF_H__ #define __DTITVINF_H__
skipping to change at line 38 skipping to change at line 38
//#include "dtitv_impl.h" //#include "dtitv_impl.h"
/** /**
* @internal ICU 4.0 * @internal ICU 4.0
*/ */
union UHashTok; union UHashTok;
U_NAMESPACE_BEGIN U_NAMESPACE_BEGIN
U_CDECL_BEGIN
/**
* @internal ICU 4.0
*/
UBool U_CALLCONV dtitvinfHashTableValueComparator(UHashTok val1, UHashTok v
al2) ;
U_CDECL_END
/** /**
* DateIntervalInfo is a public class for encapsulating localizable * DateIntervalInfo is a public class for encapsulating localizable
* date time interval patterns. It is used by DateIntervalFormat. * date time interval patterns. It is used by DateIntervalFormat.
* *
* <P> * <P>
* For most users, ordinary use of DateIntervalFormat does not need to crea te * For most users, ordinary use of DateIntervalFormat does not need to crea te
* DateIntervalInfo object directly. * DateIntervalInfo object directly.
* DateIntervalFormat will take care of it when creating a date interval * DateIntervalFormat will take care of it when creating a date interval
* formatter when user pass in skeleton and locale. * formatter when user pass in skeleton and locale.
* *
skipping to change at line 346 skipping to change at line 337
/** /**
* DateIntervalFormat will need access to * DateIntervalFormat will need access to
* getBestSkeleton(), parseSkeleton(), enum IntervalPatternIndex, * getBestSkeleton(), parseSkeleton(), enum IntervalPatternIndex,
* and calendarFieldToPatternIndex(). * and calendarFieldToPatternIndex().
* *
* Instead of making above public, * Instead of making above public,
* make DateIntervalFormat a friend of DateIntervalInfo. * make DateIntervalFormat a friend of DateIntervalInfo.
*/ */
friend class DateIntervalFormat; friend class DateIntervalFormat;
friend UBool U_CALLCONV dtitvinfHashTableValueComparator(UHashTok val1,
UHashTok val2) ;
/** /**
* Following is for saving the interval patterns. * Following is for saving the interval patterns.
* We only support interval patterns on * We only support interval patterns on
* ERA, YEAR, MONTH, DAY, AM_PM, HOUR, and MINUTE * ERA, YEAR, MONTH, DAY, AM_PM, HOUR, and MINUTE
*/ */
enum IntervalPatternIndex enum IntervalPatternIndex
{ {
kIPI_ERA, kIPI_ERA,
kIPI_YEAR, kIPI_YEAR,
kIPI_MONTH, kIPI_MONTH,
kIPI_DATE, kIPI_DATE,
kIPI_AM_PM, kIPI_AM_PM,
kIPI_HOUR, kIPI_HOUR,
kIPI_MINUTE, kIPI_MINUTE,
kIPI_MAX_INDEX kIPI_MAX_INDEX
}; };
public:
/**
* Max index for stored interval patterns
* @internal ICU 4.4
*/
enum {
kMaxIntervalPatternIndex = kIPI_MAX_INDEX
};
private:
/** /**
* Initialize the DateIntervalInfo from locale * Initialize the DateIntervalInfo from locale
* @param locale the given locale. * @param locale the given locale.
* @param status output param set to success/failure code on exit * @param status output param set to success/failure code on exit
* @internal ICU 4.0 * @internal ICU 4.0
*/ */
void initializeData(const Locale& locale, UErrorCode& status); void initializeData(const Locale& locale, UErrorCode& status);
/* Set Interval pattern. /* Set Interval pattern.
 End of changes. 4 change blocks. 
14 lines changed or deleted 10 lines changed or added


 dtptngen.h   dtptngen.h 
skipping to change at line 255 skipping to change at line 255
* For example, "MMMdd" and "mmhh" are skeletons. * For example, "MMMdd" and "mmhh" are skeletons.
* @param status Output param set to success/failure code on exit, * @param status Output param set to success/failure code on exit,
* which must not indicate a failure before the function call. * which must not indicate a failure before the function call.
* @return bestPattern * @return bestPattern
* The best pattern found from the given skeleton. * The best pattern found from the given skeleton.
* @stable ICU 3.8 * @stable ICU 3.8
*/ */
UnicodeString getBestPattern(const UnicodeString& skeleton, UErrorCode & status); UnicodeString getBestPattern(const UnicodeString& skeleton, UErrorCode & status);
/** /**
* Return the best pattern matching the input skeleton. It is guarantee
d to
* have all of the fields in the skeleton.
*
* @param skeleton
* The skeleton is a pattern containing only the variable fi
elds.
* For example, "MMMdd" and "mmhh" are skeletons.
* @param options
* Options for forcing the length of specified fields in the
* returned pattern to match those in the skeleton (when thi
s
* would not happen otherwise). For default behavior, use
* UDATPG_MATCH_NO_OPTIONS.
* @param status
* Output param set to success/failure code on exit,
* which must not indicate a failure before the function cal
l.
* @return bestPattern
* The best pattern found from the given skeleton.
* @draft ICU 4.4
*/
UnicodeString getBestPattern(const UnicodeString& skeleton,
UDateTimePatternMatchOptions options,
UErrorCode& status);
/**
* Adjusts the field types (width and subtype) of a pattern to match wh at is * Adjusts the field types (width and subtype) of a pattern to match wh at is
* in a skeleton. That is, if you supply a pattern like "d-M H:m", and a * in a skeleton. That is, if you supply a pattern like "d-M H:m", and a
* skeleton of "MMMMddhhmm", then the input pattern is adjusted to be * skeleton of "MMMMddhhmm", then the input pattern is adjusted to be
* "dd-MMMM hh:mm". This is used internally to get the best match for t he * "dd-MMMM hh:mm". This is used internally to get the best match for t he
* input skeleton, but can also be used externally. * input skeleton, but can also be used externally.
* *
* @param pattern Input pattern * @param pattern Input pattern
* @param skeleton * @param skeleton
* The skeleton is a pattern containing only the variable fi elds. * The skeleton is a pattern containing only the variable fi elds.
* For example, "MMMdd" and "mmhh" are skeletons. * For example, "MMMdd" and "mmhh" are skeletons.
* @param status Output param set to success/failure code on exit, * @param status Output param set to success/failure code on exit,
* which must not indicate a failure before the function call. * which must not indicate a failure before the function call.
* @return pattern adjusted to match the skeleton fields widths and sub types. * @return pattern adjusted to match the skeleton fields widths and sub types.
* @stable ICU 3.8 * @stable ICU 3.8
*/ */
UnicodeString replaceFieldTypes(const UnicodeString& pattern, UnicodeString replaceFieldTypes(const UnicodeString& pattern,
const UnicodeString& skeleton, const UnicodeString& skeleton,
UErrorCode& status); UErrorCode& status);
/** /**
* Adjusts the field types (width and subtype) of a pattern to match wh
at is
* in a skeleton. That is, if you supply a pattern like "d-M H:m", and
a
* skeleton of "MMMMddhhmm", then the input pattern is adjusted to be
* "dd-MMMM hh:mm". This is used internally to get the best match for t
he
* input skeleton, but can also be used externally.
*
* @param pattern Input pattern
* @param skeleton
* The skeleton is a pattern containing only the variable fi
elds.
* For example, "MMMdd" and "mmhh" are skeletons.
* @param options
* Options controlling whether the length of specified field
s in the
* pattern are adjusted to match those in the skeleton (when
this
* would not happen otherwise). For default behavior, use
* UDATPG_MATCH_NO_OPTIONS.
* @param status
* Output param set to success/failure code on exit,
* which must not indicate a failure before the function cal
l.
* @return pattern adjusted to match the skeleton fields widths and sub
types.
* @draft ICU 4.4
*/
UnicodeString replaceFieldTypes(const UnicodeString& pattern,
const UnicodeString& skeleton,
UDateTimePatternMatchOptions options,
UErrorCode& status);
/**
* Return a list of all the skeletons (in canonical form) from this cla ss. * Return a list of all the skeletons (in canonical form) from this cla ss.
* *
* Call getPatternForSkeleton() to get the corresponding pattern. * Call getPatternForSkeleton() to get the corresponding pattern.
* *
* @param status Output param set to success/failure code on exit, * @param status Output param set to success/failure code on exit,
* which must not indicate a failure before the function call. * which must not indicate a failure before the function call.
* @return StringEnumeration with the skeletons. * @return StringEnumeration with the skeletons.
* The caller must delete the object. * The caller must delete the object.
* @stable ICU 3.8 * @stable ICU 3.8
*/ */
skipping to change at line 410 skipping to change at line 460
void addCLDRData(const Locale& locale, UErrorCode& status); void addCLDRData(const Locale& locale, UErrorCode& status);
UDateTimePatternConflict addPatternWithSkeleton(const UnicodeString& pa ttern, const UnicodeString * skeletonToUse, UBool override, UnicodeString& conflictingPattern, UErrorCode& status); UDateTimePatternConflict addPatternWithSkeleton(const UnicodeString& pa ttern, const UnicodeString * skeletonToUse, UBool override, UnicodeString& conflictingPattern, UErrorCode& status);
void initHashtable(UErrorCode& status); void initHashtable(UErrorCode& status);
void setDateTimeFromCalendar(const Locale& locale, UErrorCode& status); void setDateTimeFromCalendar(const Locale& locale, UErrorCode& status);
void setDecimalSymbols(const Locale& locale, UErrorCode& status); void setDecimalSymbols(const Locale& locale, UErrorCode& status);
UDateTimePatternField getAppendFormatNumber(const char* field) const; UDateTimePatternField getAppendFormatNumber(const char* field) const;
UDateTimePatternField getAppendNameNumber(const char* field) const; UDateTimePatternField getAppendNameNumber(const char* field) const;
void getAppendName(UDateTimePatternField field, UnicodeString& value); void getAppendName(UDateTimePatternField field, UnicodeString& value);
int32_t getCanonicalIndex(const UnicodeString& field); int32_t getCanonicalIndex(const UnicodeString& field);
const UnicodeString* getBestRaw(DateTimeMatcher& source, int32_t includ eMask, DistanceInfo* missingFields, const PtnSkeleton** specifiedSkeletonPt r = 0); const UnicodeString* getBestRaw(DateTimeMatcher& source, int32_t includ eMask, DistanceInfo* missingFields, const PtnSkeleton** specifiedSkeletonPt r = 0);
UnicodeString adjustFieldTypes(const UnicodeString& pattern, const PtnS UnicodeString adjustFieldTypes(const UnicodeString& pattern, const PtnS
keleton* specifiedSkeleton, UBool fixFractionalSeconds); keleton* specifiedSkeleton, UBool fixFractionalSeconds, UDateTimePatternMat
UnicodeString getBestAppending(int32_t missingFields); chOptions options = UDATPG_MATCH_NO_OPTIONS);
UnicodeString getBestAppending(int32_t missingFields, UDateTimePatternM
atchOptions options = UDATPG_MATCH_NO_OPTIONS);
int32_t getTopBitNumber(int32_t foundMask); int32_t getTopBitNumber(int32_t foundMask);
void setAvailableFormat(const UnicodeString &key, UErrorCode& status); void setAvailableFormat(const UnicodeString &key, UErrorCode& status);
UBool isAvailableFormatSet(const UnicodeString &key) const; UBool isAvailableFormatSet(const UnicodeString &key) const;
void copyHashtable(Hashtable *other, UErrorCode &status); void copyHashtable(Hashtable *other, UErrorCode &status);
UBool isCanonicalItem(const UnicodeString& item) const; UBool isCanonicalItem(const UnicodeString& item) const;
} ;// end class DateTimePatternGenerator } ;// end class DateTimePatternGenerator
U_NAMESPACE_END U_NAMESPACE_END
#endif #endif
 End of changes. 3 change blocks. 
3 lines changed or deleted 67 lines changed or added


 errorcode.h   errorcode.h 
/* /*
*************************************************************************** **** *************************************************************************** ****
* *
* Copyright (C) 2009, International Business Machines * Copyright (C) 2009-2010, International Business Machines
* Corporation and others. All Rights Reserved. * Corporation and others. All Rights Reserved.
* *
*************************************************************************** **** *************************************************************************** ****
* file name: errorcode.h * file name: errorcode.h
* encoding: US-ASCII * encoding: US-ASCII
* tab size: 8 (not used) * tab size: 8 (not used)
* indentation:4 * indentation:4
* *
* created on: 2009mar10 * created on: 2009mar10
* created by: Markus W. Scherer * created by: Markus W. Scherer
skipping to change at line 77 skipping to change at line 77
* exit(errorCode); * exit(errorCode);
* } * }
* }; * };
* IcuErrorCode error_code; * IcuErrorCode error_code;
* UConverter *cnv = ucnv_open("Shift-JIS", error_code); * UConverter *cnv = ucnv_open("Shift-JIS", error_code);
* length = ucnv_fromUChars(dest, capacity, src, length, error_code); * length = ucnv_fromUChars(dest, capacity, src, length, error_code);
* ucnv_close(cnv); * ucnv_close(cnv);
* // IcuErrorCode destructor checks for success. * // IcuErrorCode destructor checks for success.
* \endcode * \endcode
* *
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
class U_COMMON_API ErrorCode: public UMemory { class U_COMMON_API ErrorCode: public UMemory {
public: public:
/** /**
* Default constructor. Initializes its UErrorCode to U_ZERO_ERROR. * Default constructor. Initializes its UErrorCode to U_ZERO_ERROR.
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
ErrorCode() : errorCode(U_ZERO_ERROR) {} ErrorCode() : errorCode(U_ZERO_ERROR) {}
/** Destructor, does nothing. See class documentation for details. @dra ft ICU 4.2 */ /** Destructor, does nothing. See class documentation for details. @sta ble ICU 4.4 */
virtual ~ErrorCode() {} virtual ~ErrorCode() {}
/** Conversion operator, returns a reference. @draft ICU 4.2 */ /** Conversion operator, returns a reference. @stable ICU 4.4 */
operator UErrorCode & () { return errorCode; } operator UErrorCode & () { return errorCode; }
/** Conversion operator, returns a pointer. @draft ICU 4.2 */ /** Conversion operator, returns a pointer. @stable ICU 4.4 */
operator UErrorCode * () { return &errorCode; } operator UErrorCode * () { return &errorCode; }
/** Tests for U_SUCCESS(). @draft ICU 4.2 */ /** Tests for U_SUCCESS(). @stable ICU 4.4 */
UBool isSuccess() const { return U_SUCCESS(errorCode); } UBool isSuccess() const { return U_SUCCESS(errorCode); }
/** Tests for U_FAILURE(). @draft ICU 4.2 */ /** Tests for U_FAILURE(). @stable ICU 4.4 */
UBool isFailure() const { return U_FAILURE(errorCode); } UBool isFailure() const { return U_FAILURE(errorCode); }
/** Returns the UErrorCode value. @draft ICU 4.2 */ /** Returns the UErrorCode value. @stable ICU 4.4 */
UErrorCode get() const { return errorCode; } UErrorCode get() const { return errorCode; }
/** Sets the UErrorCode value. @draft ICU 4.2 */ /** Sets the UErrorCode value. @stable ICU 4.4 */
void set(UErrorCode value) { errorCode=value; } void set(UErrorCode value) { errorCode=value; }
/** Returns the UErrorCode value and resets it to U_ZERO_ERROR. @draft ICU 4.2 */ /** Returns the UErrorCode value and resets it to U_ZERO_ERROR. @stable ICU 4.4 */
UErrorCode reset(); UErrorCode reset();
/** /**
* Asserts isSuccess(). * Asserts isSuccess().
* In other words, this method checks for a failure code, * In other words, this method checks for a failure code,
* and the base class handles it like this: * and the base class handles it like this:
* \code * \code
* if(isFailure()) { handleFailure(); } * if(isFailure()) { handleFailure(); }
* \endcode * \endcode
* @draft ICU 4.4 * @draft ICU 4.4
*/ */
skipping to change at line 123 skipping to change at line 123
* Return a string for the UErrorCode value. * Return a string for the UErrorCode value.
* The string will be the same as the name of the error code constant * The string will be the same as the name of the error code constant
* in the UErrorCode enum. * in the UErrorCode enum.
* @draft ICU 4.4 * @draft ICU 4.4
*/ */
const char* errorName() const; const char* errorName() const;
protected: protected:
/** /**
* Internal UErrorCode, accessible to subclasses. * Internal UErrorCode, accessible to subclasses.
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
UErrorCode errorCode; UErrorCode errorCode;
/** /**
* Called by assertSuccess() if isFailure() is true. * Called by assertSuccess() if isFailure() is true.
* A subclass should override this function to deal with a failure code : * A subclass should override this function to deal with a failure code :
* Throw an exception, log an error, terminate the program, or similar. * Throw an exception, log an error, terminate the program, or similar.
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
virtual void handleFailure() const {} virtual void handleFailure() const {}
}; };
U_NAMESPACE_END U_NAMESPACE_END
#endif // __ERRORCODE_H__ #endif // __ERRORCODE_H__
 End of changes. 13 change blocks. 
13 lines changed or deleted 13 lines changed or added


 fmtable.h   fmtable.h 
/* /*
*************************************************************************** ***** *************************************************************************** *****
* Copyright (C) 1997-2006, International Business Machines * Copyright (C) 1997-2010, International Business Machines
* Corporation and others. All Rights Reserved. * Corporation and others. All Rights Reserved.
*************************************************************************** ***** *************************************************************************** *****
* *
* File FMTABLE.H * File FMTABLE.H
* *
* Modification History: * Modification History:
* *
* Date Name Description * Date Name Description
* 02/29/97 aliu Creation. * 02/29/97 aliu Creation.
*************************************************************************** ***** *************************************************************************** *****
*/ */
#ifndef FMTABLE_H #ifndef FMTABLE_H
#define FMTABLE_H #define FMTABLE_H
#include "unicode/utypes.h" #include "unicode/utypes.h"
#include "unicode/unistr.h" #include "unicode/unistr.h"
#include "unicode/stringpiece.h"
/** /**
* \file * \file
* \brief C++ API: Formattable is a thin wrapper for primitive numeric type s. * \brief C++ API: Formattable is a thin wrapper for primitive numeric type s.
*/ */
#if !UCONFIG_NO_FORMATTING #if !UCONFIG_NO_FORMATTING
U_NAMESPACE_BEGIN U_NAMESPACE_BEGIN
/** /**
skipping to change at line 106 skipping to change at line 108
/** /**
* Creates a Formattable object with a char string pointer. * Creates a Formattable object with a char string pointer.
* Assumes that the char string is null terminated. * Assumes that the char string is null terminated.
* @param strToCopy the char string. * @param strToCopy the char string.
* @stable ICU 2.0 * @stable ICU 2.0
*/ */
Formattable(const char* strToCopy); Formattable(const char* strToCopy);
#endif #endif
/** /**
* Creates a Formattable object of an appropriate numeric type from a
* a decimal number in string form. The Formattable will retain the
* full precision of the input in decimal format, even when it exceeds
* what can be represented by a double of int64_t.
*
* @param number the unformatted (not localized) string representation
* of the Decimal number.
* @param status the error code. Possible errors include U_INVALID_FO
RMAT_ERROR
* if the format of the string does not conform to that
of a
* decimal number.
* @draft ICU 4.4
*/
Formattable(const StringPiece &number, UErrorCode &status);
/**
* Creates a Formattable object with a UnicodeString object to copy fro m. * Creates a Formattable object with a UnicodeString object to copy fro m.
* @param strToCopy the UnicodeString string. * @param strToCopy the UnicodeString string.
* @stable ICU 2.0 * @stable ICU 2.0
*/ */
Formattable(const UnicodeString& strToCopy); Formattable(const UnicodeString& strToCopy);
/** /**
* Creates a Formattable object with a UnicodeString object to adopt fr om. * Creates a Formattable object with a UnicodeString object to adopt fr om.
* @param strToAdopt the UnicodeString string. * @param strToAdopt the UnicodeString string.
* @stable ICU 2.0 * @stable ICU 2.0
skipping to change at line 249 skipping to change at line 266
/** /**
* Gets the data type of this Formattable object. * Gets the data type of this Formattable object.
* @return the data type of this Formattable object. * @return the data type of this Formattable object.
* @stable ICU 2.0 * @stable ICU 2.0
*/ */
Type getType(void) const; Type getType(void) const;
/** /**
* Returns TRUE if the data type of this Formattable object * Returns TRUE if the data type of this Formattable object
* is kDouble, kLong, or kInt64. * is kDouble, kLong, kInt64 or kDecimalNumber.
* @return TRUE if this is a pure numeric object * @return TRUE if this is a pure numeric object
* @stable ICU 3.0 * @stable ICU 3.0
*/ */
UBool isNumeric() const; UBool isNumeric() const;
/** /**
* Gets the double value of this object. If this object is not of type * Gets the double value of this object. If this object is not of type
* kDouble then the result is undefined. * kDouble then the result is undefined.
* @return the double value of this object. * @return the double value of this object.
* @stable ICU 2.0 * @stable ICU 2.0
*/ */
double getDouble(void) const { return fValue.fDouble; } double getDouble(void) const { return fValue.fDouble; }
/** /**
* Gets the double value of this object. If this object is of type * Gets the double value of this object. If this object is of type
* long or int64 then a casting conversion is peformed, with * long, int64 or Decimal Number then a conversion is peformed, with
* possible loss of precision. If the type is kObject and the * possible loss of precision. If the type is kObject and the
* object is a Measure, then the result of * object is a Measure, then the result of
* getNumber().getDouble(status) is returned. If this object is * getNumber().getDouble(status) is returned. If this object is
* neither a numeric type nor a Measure, then 0 is returned and * neither a numeric type nor a Measure, then 0 is returned and
* the status is set to U_INVALID_FORMAT_ERROR. * the status is set to U_INVALID_FORMAT_ERROR.
* @param status the error code * @param status the error code
* @return the double value of this object. * @return the double value of this object.
* @stable ICU 3.0 * @stable ICU 3.0
*/ */
double getDouble(UErrorCode& status) const; double getDouble(UErrorCode& status) const;
skipping to change at line 291 skipping to change at line 308
* @stable ICU 2.0 * @stable ICU 2.0
*/ */
int32_t getLong(void) const { return (int32_t)fValue.fInt64; } int32_t getLong(void) const { return (int32_t)fValue.fInt64; }
/** /**
* Gets the long value of this object. If the magnitude is too * Gets the long value of this object. If the magnitude is too
* large to fit in a long, then the maximum or minimum long value, * large to fit in a long, then the maximum or minimum long value,
* as appropriate, is returned and the status is set to * as appropriate, is returned and the status is set to
* U_INVALID_FORMAT_ERROR. If this object is of type kInt64 and * U_INVALID_FORMAT_ERROR. If this object is of type kInt64 and
* it fits within a long, then no precision is lost. If it is of * it fits within a long, then no precision is lost. If it is of
* type kDouble, then a casting conversion is peformed, with * type kDouble or kDecimalNumber, then a conversion is peformed, with
* truncation of any fractional part. If the type is kObject and * truncation of any fractional part. If the type is kObject and
* the object is a Measure, then the result of * the object is a Measure, then the result of
* getNumber().getLong(status) is returned. If this object is * getNumber().getLong(status) is returned. If this object is
* neither a numeric type nor a Measure, then 0 is returned and * neither a numeric type nor a Measure, then 0 is returned and
* the status is set to U_INVALID_FORMAT_ERROR. * the status is set to U_INVALID_FORMAT_ERROR.
* @param status the error code * @param status the error code
* @return the long value of this object. * @return the long value of this object.
* @stable ICU 3.0 * @stable ICU 3.0
*/ */
int32_t getLong(UErrorCode& status) const; int32_t getLong(UErrorCode& status) const;
/** /**
* Gets the int64 value of this object. If this object is not of type * Gets the int64 value of this object. If this object is not of type
* kInt64 then the result is undefined. * kInt64 then the result is undefined.
* @return the int64 value of this object. * @return the int64 value of this object.
* @stable ICU 2.8 * @stable ICU 2.8
*/ */
int64_t getInt64(void) const { return fValue.fInt64; } int64_t getInt64(void) const { return fValue.fInt64; }
/** /**
* Gets the int64 value of this object. If this object is of type * Gets the int64 value of this object. If this object is of a numeric
* kDouble and the magnitude is too large to fit in an int64, then * type and the magnitude is too large to fit in an int64, then
* the maximum or minimum int64 value, as appropriate, is returned * the maximum or minimum int64 value, as appropriate, is returned
* and the status is set to U_INVALID_FORMAT_ERROR. If the * and the status is set to U_INVALID_FORMAT_ERROR. If the
* magnitude fits in an int64, then a casting conversion is * magnitude fits in an int64, then a casting conversion is
* peformed, with truncation of any fractional part. If the type * peformed, with truncation of any fractional part. If the type
* is kObject and the object is a Measure, then the result of * is kObject and the object is a Measure, then the result of
* getNumber().getDouble(status) is returned. If this object is * getNumber().getDouble(status) is returned. If this object is
* neither a numeric type nor a Measure, then 0 is returned and * neither a numeric type nor a Measure, then 0 is returned and
* the status is set to U_INVALID_FORMAT_ERROR. * the status is set to U_INVALID_FORMAT_ERROR.
* @param status the error code * @param status the error code
* @return the int64 value of this object. * @return the int64 value of this object.
skipping to change at line 444 skipping to change at line 461
/** /**
* Returns a pointer to the UObject contained within this * Returns a pointer to the UObject contained within this
* formattable, or NULL if this object does not contain a UObject. * formattable, or NULL if this object does not contain a UObject.
* @return a UObject pointer, or NULL * @return a UObject pointer, or NULL
* @stable ICU 3.0 * @stable ICU 3.0
*/ */
const UObject* getObject() const; const UObject* getObject() const;
/** /**
* Returns a numeric string representation of the number contained with
in this
* formattable, or NULL if this object does not contain numeric type.
* For values obtained by parsing, the returned decimal number retains
* the full precision and range of the original input, unconstrained by
* the limits of a double floating point or a 64 bit int.
*
* @return the unformatted string representation of a number.
* @draft ICU 4.4
*/
const StringPiece &getDecimalNumber() const;
/**
* Sets the double value of this object and changes the type to * Sets the double value of this object and changes the type to
* kDouble. * kDouble.
* @param d the new double value to be set. * @param d the new double value to be set.
* @stable ICU 2.0 * @stable ICU 2.0
*/ */
void setDouble(double d); void setDouble(double d);
/** /**
* Sets the long value of this object and changes the type to * Sets the long value of this object and changes the type to
* kLong. * kLong.
skipping to change at line 517 skipping to change at line 546
/** /**
* Sets and adopts the UObject value of this object and changes * Sets and adopts the UObject value of this object and changes
* the type to kObject. After this call, the caller must not * the type to kObject. After this call, the caller must not
* delete the given object. * delete the given object.
* @param objectToAdopt the UObject value to be adopted * @param objectToAdopt the UObject value to be adopted
* @stable ICU 3.0 * @stable ICU 3.0
*/ */
void adoptObject(UObject* objectToAdopt); void adoptObject(UObject* objectToAdopt);
/** /**
* Sets the the numeric value from a decimal number string, and changes
* the type to to a numeric type appropriate for the number.
* The syntax of the number is a "numeric string"
* as defined in the Decimal Arithmetic Specification, available at
* http://speleotrove.com/decimal
* The full precision and range of the input number will be retained,
* even when it exceeds what can be represented by a double or an int64
.
*
* @param numberString a string representation of the unformatted deci
mal number.
* @param status the error code. Set to U_INVALID_FORMAT_ERROR
if the
* incoming string is not a valid decimal number.
* @draft ICU 4.4
*/
void setDecimalNumber(const StringPiece &numberString,
UErrorCode &status);
/**
* ICU "poor man's RTTI", returns a UClassID for the actual class. * ICU "poor man's RTTI", returns a UClassID for the actual class.
* *
* @stable ICU 2.2 * @stable ICU 2.2
*/ */
virtual UClassID getDynamicClassID() const; virtual UClassID getDynamicClassID() const;
/** /**
* ICU "poor man's RTTI", returns a UClassID for this class. * ICU "poor man's RTTI", returns a UClassID for this class.
* *
* @stable ICU 2.2 * @stable ICU 2.2
 End of changes. 9 change blocks. 
6 lines changed or deleted 58 lines changed or added


 format.h   format.h 
/* /*
*************************************************************************** ***** *************************************************************************** *****
* Copyright (C) 1997-2006, International Business Machines Corporation and others. * Copyright (C) 1997-2010, International Business Machines Corporation and others.
* All Rights Reserved. * All Rights Reserved.
*************************************************************************** ***** *************************************************************************** *****
* *
* File FORMAT.H * File FORMAT.H
* *
* Modification History: * Modification History:
* *
* Date Name Description * Date Name Description
* 02/19/97 aliu Converted from java. * 02/19/97 aliu Converted from java.
* 03/17/97 clhuang Updated per C++ implementation. * 03/17/97 clhuang Updated per C++ implementation.
skipping to change at line 36 skipping to change at line 36
/** /**
* \file * \file
* \brief C++ API: Base class for all formats. * \brief C++ API: Base class for all formats.
*/ */
#if !UCONFIG_NO_FORMATTING #if !UCONFIG_NO_FORMATTING
#include "unicode/unistr.h" #include "unicode/unistr.h"
#include "unicode/fmtable.h" #include "unicode/fmtable.h"
#include "unicode/fieldpos.h" #include "unicode/fieldpos.h"
#include "unicode/fpositer.h"
#include "unicode/parsepos.h" #include "unicode/parsepos.h"
#include "unicode/parseerr.h" #include "unicode/parseerr.h"
#include "unicode/locid.h" #include "unicode/locid.h"
U_NAMESPACE_BEGIN U_NAMESPACE_BEGIN
/** /**
* Base class for all formats. This is an abstract base class which * Base class for all formats. This is an abstract base class which
* specifies the protocol for classes which convert other objects or * specifies the protocol for classes which convert other objects or
* values, such as numeric values and dates, and their string * values, such as numeric values and dates, and their string
skipping to change at line 161 skipping to change at line 162
* @param pos On input: an alignment field, if desired. * @param pos On input: an alignment field, if desired.
* On output: the offsets of the alignment field. * On output: the offsets of the alignment field.
* @param status Output param filled with success/failure status. * @param status Output param filled with success/failure status.
* @return Reference to 'appendTo' parameter. * @return Reference to 'appendTo' parameter.
* @stable ICU 2.0 * @stable ICU 2.0
*/ */
virtual UnicodeString& format(const Formattable& obj, virtual UnicodeString& format(const Formattable& obj,
UnicodeString& appendTo, UnicodeString& appendTo,
FieldPosition& pos, FieldPosition& pos,
UErrorCode& status) const = 0; UErrorCode& status) const = 0;
/**
* Format an object to produce a string. Subclasses should override th
is
* method. This method allows polymorphic formatting of Formattable obj
ects.
* If a subclass of Format receives a Formattable object type it doesn'
t
* handle (e.g., if a numeric Formattable is passed to a DateFormat obj
ect)
* then it returns a failing UErrorCode.
*
* @param obj The object to format.
* @param appendTo Output parameter to receive result.
* Result is appended to existing contents.
* @param posIter On return, can be used to iterate over positions
* of fields generated by this format call.
* @param status Output param filled with success/failure status.
* @return Reference to 'appendTo' parameter.
* @draft ICU 4.4
*/
virtual UnicodeString& format(const Formattable& obj,
UnicodeString& appendTo,
FieldPositionIterator& posIter,
UErrorCode& status) const;
/** /**
* Parse a string to produce an object. This is a pure virtual * Parse a string to produce an object. This is a pure virtual
* method which subclasses must implement. This method allows * method which subclasses must implement. This method allows
* polymorphic parsing of strings into Formattable objects. * polymorphic parsing of strings into Formattable objects.
* <P> * <P>
* Before calling, set parse_pos.index to the offset you want to * Before calling, set parse_pos.index to the offset you want to
* start parsing at in the source. After calling, parse_pos.index * start parsing at in the source. After calling, parse_pos.index
* is the end of the text you parsed. If error occurs, index is * is the end of the text you parsed. If error occurs, index is
* unchanged. * unchanged.
 End of changes. 3 change blocks. 
1 lines changed or deleted 26 lines changed or added


 icudataver.h   icudataver.h 
/* /*
*************************************************************************** *** *************************************************************************** ***
* *
* Copyright (C) 2009, International Business Machines * Copyright (C) 2009-2010, International Business Machines
* Corporation and others. All Rights Reserved. * Corporation and others. All Rights Reserved.
* *
*************************************************************************** *** *************************************************************************** ***
*/ */
#ifndef __ICU_DATA_VER_H__ #ifndef __ICU_DATA_VER_H__
#define __ICU_DATA_VER_H__ #define __ICU_DATA_VER_H__
#include "unicode/utypes.h" #include "unicode/utypes.h"
/**
* @internal ICU 4.4
*/
#define U_ICU_VERSION_BUNDLE "icuver" #define U_ICU_VERSION_BUNDLE "icuver"
/**
* @internal ICU 4.4
*/
#define U_ICU_STD_BUNDLE "icustd" #define U_ICU_STD_BUNDLE "icustd"
/**
* @internal ICU 4.4
*/
#define U_ICU_DATA_KEY "DataVersion" #define U_ICU_DATA_KEY "DataVersion"
/** /**
* This function loads up icuver and compares the data version to the wired -in U_ICU_DATA_VERSION. * This function loads up icuver and compares the data version to the wired -in U_ICU_DATA_VERSION.
* If icuver shows something less than U_ICU_DATA_VERSION it returns TRUE, else FALSE. The version * If icuver shows something less than U_ICU_DATA_VERSION it returns TRUE, else FALSE. The version
* found will be returned in the first fillin parameter (if non-null), and *isModified will be set * found will be returned in the first fillin parameter (if non-null), and *isModified will be set
* to TRUE if "icustd" is NOT found. Thus, if the data has been repackaged or modified, "icustd" * to TRUE if "icustd" is NOT found. Thus, if the data has been repackaged or modified, "icustd"
* (standard ICU) will be missing, and the function will alert the caller t hat the data is not standard. * (standard ICU) will be missing, and the function will alert the caller t hat the data is not standard.
* *
* @param dataVersionFillin icuver data version information to be filled in if not-null * @param dataVersionFillin icuver data version information to be filled in if not-null
* @param isModifiedFillin if the data is not standard if not-null * @param isModifiedFillin if the data is not standard if not-null
* @param status stores the error code from the calls to resource bundle * @param status stores the error code from the calls to resource bundle
* *
* @return TRUE if U_ICU_DATA_VERSION is newer than icuver, else FALSE * @return TRUE if U_ICU_DATA_VERSION is newer than icuver, else FALSE
* *
* @draft ICU 4.4 * @internal ICU 4.4
*/ */
U_CAPI UBool U_EXPORT2 u_isDataOlder(UVersionInfo dataVersionFillin, UBool *isModifiedFillin, UErrorCode *status); U_INTERNAL UBool U_EXPORT2 u_isDataOlder(UVersionInfo dataVersionFillin, UB ool *isModifiedFillin, UErrorCode *status);
/** /**
* Retrieves the data version from icuver and stores it in dataVersionFilli n. * Retrieves the data version from icuver and stores it in dataVersionFilli n.
* *
* @param dataVersionFillin icuver data version information to be filled in if not-null * @param dataVersionFillin icuver data version information to be filled in if not-null
* @param status stores the error code from the calls to resource bundle * @param status stores the error code from the calls to resource bundle
* *
* @draft ICU 4.4 * @internal ICU 4.4
*/ */
U_CAPI void U_EXPORT2 u_getDataVersion(UVersionInfo dataVersionFillin, UErr orCode *status); U_INTERNAL void U_EXPORT2 u_getDataVersion(UVersionInfo dataVersionFillin, UErrorCode *status);
#endif #endif
 End of changes. 8 change blocks. 
5 lines changed or deleted 15 lines changed or added


 localpointer.h   localpointer.h 
skipping to change at line 23 skipping to change at line 23
* created on: 2009nov13 * created on: 2009nov13
* created by: Markus W. Scherer * created by: Markus W. Scherer
*/ */
#ifndef __LOCALPOINTER_H__ #ifndef __LOCALPOINTER_H__
#define __LOCALPOINTER_H__ #define __LOCALPOINTER_H__
/** /**
* \file * \file
* \brief C++ API: "Smart pointers" for use with and in ICU4C C++ code. * \brief C++ API: "Smart pointers" for use with and in ICU4C C++ code.
*
* These classes are inspired by
* - std::auto_ptr
* - boost::scoped_ptr & boost::scoped_array
* - Taligent Safe Pointers (TOnlyPointerTo)
*
* but none of those provide for all of the goals for ICU smart pointers:
* - Smart pointer owns the object and releases it when it goes out of scop
e.
* - No transfer of ownership via copy/assignment to reduce misuse. Simpler
& more robust.
* - ICU-compatible: No exceptions.
* - Need to be able to orphan/release the pointer and its ownership.
* - Need variants for normal C++ object pointers, C++ arrays, and ICU C se
rvice objects.
*
* For details see http://site.icu-project.org/design/cpp/scoped_ptr
*/ */
#include "unicode/utypes.h" #include "unicode/utypes.h"
#ifdef XP_CPLUSPLUS #if U_SHOW_CPLUSPLUS_API
U_NAMESPACE_BEGIN U_NAMESPACE_BEGIN
/** /**
* "Smart pointer" base class; do not use directly: use LocalPointer etc. * "Smart pointer" base class; do not use directly: use LocalPointer etc.
* *
* Base class for smart pointer classes that do not throw exceptions. * Base class for smart pointer classes that do not throw exceptions.
* *
* Do not use this base class directly, since it does not delete its pointe r. * Do not use this base class directly, since it does not delete its pointe r.
* A subclass must implement methods that delete the pointer: * A subclass must implement methods that delete the pointer:
skipping to change at line 153 skipping to change at line 167
static void * U_EXPORT2 operator new[](size_t size); static void * U_EXPORT2 operator new[](size_t size);
#if U_HAVE_PLACEMENT_NEW #if U_HAVE_PLACEMENT_NEW
static void * U_EXPORT2 operator new(size_t, void *ptr); static void * U_EXPORT2 operator new(size_t, void *ptr);
#endif #endif
}; };
/** /**
* "Smart pointer" class, deletes objects via the standard C++ delete opera tor. * "Smart pointer" class, deletes objects via the standard C++ delete opera tor.
* For most methods see the LocalPointerBase base class. * For most methods see the LocalPointerBase base class.
* *
* Usage example:
* \code
* LocalPointer<UnicodeString> s(new UnicodeString((UChar32)0x50005));
* int32_t length=s->length(); // 2
* UChar lead=s->charAt(0); // 0xd900
* if(some condition) { return; } // no need to explicitly delete the poin
ter
* s.adoptInstead(new UnicodeString((UChar)0xfffc));
* length=s->length(); // 1
* // no need to explicitly delete the pointer
* \endcode
*
* @see LocalPointerBase * @see LocalPointerBase
* @draft ICU 4.4 * @draft ICU 4.4
*/ */
template<typename T> template<typename T>
class LocalPointer : public LocalPointerBase<T> { class LocalPointer : public LocalPointerBase<T> {
public: public:
/** /**
* Constructor takes ownership. * Constructor takes ownership.
* @param p simple pointer to an object that is adopted * @param p simple pointer to an object that is adopted
* @draft ICU 4.4 * @draft ICU 4.4
skipping to change at line 189 skipping to change at line 214
delete LocalPointerBase<T>::ptr; delete LocalPointerBase<T>::ptr;
LocalPointerBase<T>::ptr=p; LocalPointerBase<T>::ptr=p;
} }
}; };
/** /**
* "Smart pointer" class, deletes objects via the C++ array delete[] operat or. * "Smart pointer" class, deletes objects via the C++ array delete[] operat or.
* For most methods see the LocalPointerBase base class. * For most methods see the LocalPointerBase base class.
* Adds operator[] for array item access. * Adds operator[] for array item access.
* *
* Usage example:
* \code
* LocalArray<UnicodeString> a(new UnicodeString[2]);
* a[0].append((UChar)0x61);
* if(some condition) { return; } // no need to explicitly delete the arra
y
* a.adoptInstead(new UnicodeString[4]);
* a[3].append((UChar)0x62).append((UChar)0x63).reverse();
* // no need to explicitly delete the array
* \endcode
*
* @see LocalPointerBase * @see LocalPointerBase
* @draft ICU 4.4 * @draft ICU 4.4
*/ */
template<typename T> template<typename T>
class LocalArray : public LocalPointerBase<T> { class LocalArray : public LocalPointerBase<T> {
public: public:
/** /**
* Constructor takes ownership. * Constructor takes ownership.
* @param p simple pointer to an array of T objects that is adopted * @param p simple pointer to an array of T objects that is adopted
* @draft ICU 4.4 * @draft ICU 4.4
skipping to change at line 238 skipping to change at line 273
/** /**
* \def U_DEFINE_LOCAL_OPEN_POINTER * \def U_DEFINE_LOCAL_OPEN_POINTER
* "Smart pointer" definition macro, deletes objects via the closeFunction. * "Smart pointer" definition macro, deletes objects via the closeFunction.
* Defines a subclass of LocalPointerBase which works just * Defines a subclass of LocalPointerBase which works just
* like LocalPointer<Type> except that this subclass will use the closeFunc tion * like LocalPointer<Type> except that this subclass will use the closeFunc tion
* rather than the C++ delete operator. * rather than the C++ delete operator.
* *
* Requirement: The closeFunction must tolerate a NULL pointer. * Requirement: The closeFunction must tolerate a NULL pointer.
* (We could add a NULL check here but it is normally redundant.) * (We could add a NULL check here but it is normally redundant.)
* *
* Usage example:
* \code
* LocalUCaseMapPointer csm(ucasemap_open(localeID, options, &errorCode));
* utf8OutLength=ucasemap_utf8ToLower(csm.getAlias(),
* utf8Out, (int32_t)sizeof(utf8Out),
* utf8In, utf8InLength, &errorCode);
* if(U_FAILURE(errorCode)) { return; } // no need to explicitly delete th
e UCaseMap
* \endcode
*
* @see LocalPointerBase * @see LocalPointerBase
* @see LocalPointer * @see LocalPointer
* @draft ICU 4.4 * @draft ICU 4.4
*/ */
#define U_DEFINE_LOCAL_OPEN_POINTER(LocalPointerClassName, Type, closeFunct ion) \ #define U_DEFINE_LOCAL_OPEN_POINTER(LocalPointerClassName, Type, closeFunct ion) \
class LocalPointerClassName : public LocalPointerBase<Type> { \ class LocalPointerClassName : public LocalPointerBase<Type> { \
public: \ public: \
explicit LocalPointerClassName(Type *p=NULL) : LocalPointerBase<Typ e>(p) {} \ explicit LocalPointerClassName(Type *p=NULL) : LocalPointerBase<Typ e>(p) {} \
~LocalPointerClassName() { closeFunction(ptr); } \ ~LocalPointerClassName() { closeFunction(ptr); } \
void adoptInstead(Type *p) { \ void adoptInstead(Type *p) { \
closeFunction(ptr); \ closeFunction(ptr); \
ptr=p; \ ptr=p; \
} \ } \
} }
U_NAMESPACE_END U_NAMESPACE_END
#endif /* XP_CPLUSPLUS */ #endif /* U_SHOW_CPLUSPLUS_API */
#endif /* __LOCALPOINTER_H__ */ #endif /* __LOCALPOINTER_H__ */
 End of changes. 6 change blocks. 
2 lines changed or deleted 52 lines changed or added


 locid.h   locid.h 
/* /*
*************************************************************************** *** *************************************************************************** ***
* *
* Copyright (C) 1996-2009, International Business Machines * Copyright (C) 1996-2010, International Business Machines
* Corporation and others. All Rights Reserved. * Corporation and others. All Rights Reserved.
* *
*************************************************************************** *** *************************************************************************** ***
* *
* File locid.h * File locid.h
* *
* Created by: Helena Shih * Created by: Helena Shih
* *
* Modification History: * Modification History:
* *
skipping to change at line 183 skipping to change at line 183
* UnicodeString& displayName) * UnicodeString& displayName)
* </pre> * </pre>
* \htmlonly</blockquote>\endhtmlonly * \htmlonly</blockquote>\endhtmlonly
* *
* @stable ICU 2.0 * @stable ICU 2.0
* @see ResourceBundle * @see ResourceBundle
*/ */
U_NAMESPACE_BEGIN U_NAMESPACE_BEGIN
class U_COMMON_API Locale : public UObject { class U_COMMON_API Locale : public UObject {
public: public:
/** Useful constant for the Root locale. @draft ICU 4.4 */
static const Locale &U_EXPORT2 getRoot(void);
/** Useful constant for this language. @stable ICU 2.0 */ /** Useful constant for this language. @stable ICU 2.0 */
static const Locale &U_EXPORT2 getEnglish(void); static const Locale &U_EXPORT2 getEnglish(void);
/** Useful constant for this language. @stable ICU 2.0 */ /** Useful constant for this language. @stable ICU 2.0 */
static const Locale &U_EXPORT2 getFrench(void); static const Locale &U_EXPORT2 getFrench(void);
/** Useful constant for this language. @stable ICU 2.0 */ /** Useful constant for this language. @stable ICU 2.0 */
static const Locale &U_EXPORT2 getGerman(void); static const Locale &U_EXPORT2 getGerman(void);
/** Useful constant for this language. @stable ICU 2.0 */ /** Useful constant for this language. @stable ICU 2.0 */
static const Locale &U_EXPORT2 getItalian(void); static const Locale &U_EXPORT2 getItalian(void);
/** Useful constant for this language. @stable ICU 2.0 */ /** Useful constant for this language. @stable ICU 2.0 */
static const Locale &U_EXPORT2 getJapanese(void); static const Locale &U_EXPORT2 getJapanese(void);
skipping to change at line 425 skipping to change at line 427
* but without keywords. * but without keywords.
* @return A pointer to "name". * @return A pointer to "name".
* @see getName * @see getName
* @stable ICU 2.8 * @stable ICU 2.8
*/ */
const char * getBaseName() const; const char * getBaseName() const;
/** /**
* Gets the list of keywords for the specified locale. * Gets the list of keywords for the specified locale.
* *
* @return pointer to StringEnumeration class. Client must dispose of i * @param status the status code
t by calling delete. * @return pointer to StringEnumeration class, or NULL if there are no
* @param status Returns any error information while performing this op keywords.
eration. * Client must dispose of it by calling delete.
* @stable ICU 2.8 * @stable ICU 2.8
*/ */
StringEnumeration * createKeywords(UErrorCode &status) const; StringEnumeration * createKeywords(UErrorCode &status) const;
/** /**
* Get the value for a keyword. * Get the value for a keyword.
* *
* @param keywordName name of the keyword for which we want the value. Case insensitive. * @param keywordName name of the keyword for which we want the value. Case insensitive.
* @param status Returns any error information while performing this op eration.
* @param buffer The buffer to receive the keyword value. * @param buffer The buffer to receive the keyword value.
* @param bufferCapacity The capacity of receiving buffer * @param bufferCapacity The capacity of receiving buffer
* @return the length of keyword value * @param status Returns any error information while performing this op
eration.
* @return the length of the keyword value
* *
* @stable ICU 2.8 * @stable ICU 2.8
*/ */
int32_t getKeywordValue(const char* keywordName, char *buffer, int32_t bufferCapacity, UErrorCode &status) const; int32_t getKeywordValue(const char* keywordName, char *buffer, int32_t bufferCapacity, UErrorCode &status) const;
/** /**
* Set the value for a keyword.
*
* @param keywordName name of the keyword to be set. Case insensitive.
* @param keywordValue value of the keyword to be set. If 0-length or
* NULL, will result in the keyword being removed. No error is given i
f
* that keyword does not exist.
* @param status Returns any error information while performing this op
eration.
*
* @internal
*/
void setKeywordValue(const char* keywordName, const char* keywordValue,
UErrorCode &status);
/**
* returns the locale's three-letter language code, as specified * returns the locale's three-letter language code, as specified
* in ISO draft standard ISO-639-2. * in ISO draft standard ISO-639-2.
* @return An alias to the code, or NULL * @return An alias to the code, or NULL
* @stable ICU 2.0 * @stable ICU 2.0
*/ */
const char * getISO3Language() const; const char * getISO3Language() const;
/** /**
* Fills in "name" with the locale's three-letter ISO-3166 country code . * Fills in "name" with the locale's three-letter ISO-3166 country code .
* @return An alias to the code, or NULL * @return An alias to the code, or NULL
skipping to change at line 745 skipping to change at line 761
inline const char * inline const char *
Locale::getScript() const Locale::getScript() const
{ {
return script; return script;
} }
inline const char * inline const char *
Locale::getVariant() const Locale::getVariant() const
{ {
return &fullName[variantBegin]; getBaseName(); // lazy init
return &baseName[variantBegin];
} }
inline const char * inline const char *
Locale::getName() const Locale::getName() const
{ {
return fullName; return fullName;
} }
inline UBool inline UBool
Locale::isBogus(void) const { Locale::isBogus(void) const {
 End of changes. 7 change blocks. 
8 lines changed or deleted 28 lines changed or added


 msgfmt.h   msgfmt.h 
/* /*
* Copyright (C) 2007-2009, International Business Machines Corporation and * Copyright (C) 2007-2010, International Business Machines Corporation and
others. All Rights Reserved. * others. All Rights Reserved.
*************************************************************************** ***** *************************************************************************** *****
* *
* File MSGFMT.H * File MSGFMT.H
* *
* Modification History: * Modification History:
* *
* Date Name Description * Date Name Description
* 02/19/97 aliu Converted from java. * 02/19/97 aliu Converted from java.
* 03/20/97 helena Finished first cut of implementation. * 03/20/97 helena Finished first cut of implementation.
* 07/22/98 stephen Removed operator!= (defined in Format) * 07/22/98 stephen Removed operator!= (defined in Format)
* 08/19/2002 srl Removing Javaisms * 08/19/2002 srl Removing Javaisms
*************************************************************************** ***************************************************************************
***** ****/
*/
#ifndef MSGFMT_H #ifndef MSGFMT_H
#define MSGFMT_H #define MSGFMT_H
#include "unicode/utypes.h" #include "unicode/utypes.h"
/** /**
* \file * \file
* \brief C++ API: Formats messages in a language-neutral way. * \brief C++ API: Formats messages in a language-neutral way.
*/ */
skipping to change at line 41 skipping to change at line 41
#include "unicode/parseerr.h" #include "unicode/parseerr.h"
#include "unicode/uchar.h" #include "unicode/uchar.h"
U_NAMESPACE_BEGIN U_NAMESPACE_BEGIN
class NumberFormat; class NumberFormat;
class DateFormat; class DateFormat;
/** /**
* *
* A MessageFormat produces concatenated messages in a * MessageFormat produces concatenated messages in a language-neutral
* language-neutral way. It should be used for all string * way. Use this whenever concatenating strings that are displayed to
* concatenations that are visible to end users. * end users.
* <P> *
* A MessageFormat contains an array of <EM>subformats</EM> arranged * <P>A MessageFormat contains an array of <EM>subformats</EM> arranged
* within a <EM>template string</EM>. Together, the subformats and * within a <EM>template string</EM>. Together, the subformats and
* template string determine how the MessageFormat will operate during * template string determine how the MessageFormat will operate during
* formatting and parsing. * formatting and parsing.
* <P> *
* Typically, both the subformats and the template string are * <P>Typically, both the subformats and the template string are
* specified at once in a <EM>pattern</EM>. By using different * specified at once in a <EM>pattern</EM>. By using different
* patterns for different locales, messages may be localized. * patterns for different locales, messages may be localized.
* <P> *
* During formatting, the MessageFormat takes an array of arguments * <P>When formatting, MessageFormat takes an array of arguments
* and produces a user-readable string. Each argument is a * and produces a user-readable string. Each argument is a
* Formattable object; they may be passed in in an array, or as a * Formattable object; they may be passed in in an array, or as a
* single Formattable object which itself contains an array. Each * single Formattable object which itself contains an array. Each
* argument is matched up with its corresponding subformat, which then * argument is matched up with its corresponding subformat, which then
* formats it into a string. The resultant strings are then assembled * formats it into a string. The resulting strings are then assembled
* within the string template of the MessageFormat to produce the * within the string template of the MessageFormat to produce the
* final output string. * final output string.
* <p> *
* <strong>Note:</strong> * <p><strong>Note:</strong>
* In ICU 4.0 MessageFormat supports named arguments. If a named argument * In ICU 4.0 MessageFormat supports named arguments. If a named argument
* is used, all arguments must be named. Names start with a character in * is used, all arguments must be named. Names start with a character in
* <code>UCHAR_ID_START</code> and continue with characters in * <code>UCHAR_ID_START</code> and continue with characters in
* <code>UCHARID_CONTINUE</code>, in particular they do not start with a di git. * <code>UCHARID_CONTINUE</code>, in particular they do not start with a di git.
* If named arguments are used, {@link #usesNamedArguments()} will return t rue. * If named arguments are used, {@link #usesNamedArguments()} will return t rue.
* <p> *
* The other new methods supporting named arguments are * <p>The other new methods supporting named arguments are
* {@link #getFormatNames(UErrorCode& status)}, * {@link #getFormatNames(UErrorCode& status)},
* {@link #getFormat(const UnicodeString& formatName, UErrorCode& status)} * {@link #getFormat(const UnicodeString& formatName, UErrorCode& status)}
* {@link #setFormat(const UnicodeString& formatName, const Format& format, UErrorCode& status)}, * {@link #setFormat(const UnicodeString& formatName, const Format& format, UErrorCode& status)},
* {@link #adoptFormat(const UnicodeString& formatName, Format* formatToAdo pt, UErrorCode& status)}, * {@link #adoptFormat(const UnicodeString& formatName, Format* formatToAdo pt, UErrorCode& status)},
* {@link #format(const Formattable* arguments, const UnicodeString *argume * {@link #format(const UnicodeString* argumentNames, const Formattable* ar
ntNames, int32_t cnt, UnicodeString& appendTo, FieldPosition& status, int32 guments,
_t recursionProtection, UErrorCode& success)}, * int32_t count, UnicodeString& appendTo,UErrorCode& status)}.
* {@link #format(const UnicodeString* argumentNames, const Formattable* ar
guments, int32_t count, UnicodeString& appendTo,UErrorCode& status)}.
* These methods are all compatible with patterns that do not used named ar guments-- * These methods are all compatible with patterns that do not used named ar guments--
* in these cases the keys in the input or output use <code>UnicodeString</ code>s * in these cases the keys in the input or output use <code>UnicodeString</ code>s
* that name the argument indices, e.g. "0", "1", "2"... etc. * that name the argument indices, e.g. "0", "1", "2"... etc.
* <p> *
* When named arguments are used, certain methods on MessageFormat that tak * <p>If this format uses named arguments, certain methods that take or
e or
* return arrays do not perform any action, since it is not possible to * return arrays do not perform any action, since it is not possible to
* identify positions in an array using a name. UErrorCode is set to * identify positions in an array using a name. Of these methods,
* U_ARGUMENT_TYPE_MISMATCH if there is a status/success field in the metho * UErrorCode is set to U_ILLEGAL_ARGUMENT_ERROR by format, and to
d. * U_ARGUMENT_TYPE_MISMATCH by parse.
* These methods are * These methods are
* {@link #adoptFormats(Format** formatsToAdopt, int32_t count)}, * {@link #adoptFormats(Format** formatsToAdopt, int32_t count)},
* {@link #setFormats(const Format** newFormats,int32_t count)}, * {@link #setFormats(const Format** newFormats,int32_t count)},
* {@link #adoptFormat(int32_t n, Format *newFormat)}, * {@link #adoptFormat(int32_t n, Format *newFormat)},
* {@link #getFormats(int32_t& count)}, * {@link #setFormat(int32_t n, Format& newFormat)},
* {@link #format(const Formattable* source,int32_t cnt,UnicodeString& appe * {@link #format(const Formattable* source, int32_t count, UnicodeString&
ndTo, FieldPosition& ignore, UErrorCode& success)}, appendTo, FieldPosition& ignore, UErrorCode& success)},
* {@link #format(const UnicodeString& pattern,const Formattable* arguments ,int32_t cnt,UnicodeString& appendTo,UErrorCode& success)}, * {@link #format(const UnicodeString& pattern,const Formattable* arguments ,int32_t cnt,UnicodeString& appendTo,UErrorCode& success)},
* {@link #format(const Formattable& source, UnicodeString& appendTo,FieldP osition& ignore, UErrorCode& success)}, * {@link #format(const Formattable& source, UnicodeString& appendTo, Field Position& ignore, UErrorCode& success)},
* {@link #format(const Formattable* arguments, int32_t cnt, UnicodeString& appendTo, FieldPosition& status, int32_t recursionProtection,UErrorCode& s uccess)}, * {@link #format(const Formattable* arguments, int32_t cnt, UnicodeString& appendTo, FieldPosition& status, int32_t recursionProtection,UErrorCode& s uccess)},
* {@link #parse(const UnicodeString& source, ParsePosition& pos,int32_t& c ount)}, * {@link #parse(const UnicodeString& source, ParsePosition& pos, int32_t& count)},
* {@link #parse(const UnicodeString& source, int32_t& cnt, UErrorCode& sta tus)} * {@link #parse(const UnicodeString& source, int32_t& cnt, UErrorCode& sta tus)}
* <p>
* *
* <P> * <P>
* During parsing, an input string is matched against the string * During parsing, an input string is matched against the string
* template of the MessageFormat to produce an array of Formattable * template of the MessageFormat to produce an array of Formattable
* objects. Plain text of the template string is matched directly * objects. Plain text of the template string is matched directly
* against intput text. At each position in the template string where * against input text. At each position in the template string where
* a subformat is located, the subformat is called to parse the * a subformat is located, the subformat is called to parse the
* corresponding segment of input text to produce an output argument. * corresponding segment of input text to produce an output argument.
* In this way, an array of arguments is created which together * In this way, an array of arguments is created which together
* constitute the parse result. * constitute the parse result.
* <P> * <P>
* Parsing may fail or produce unexpected results in a number of * Parsing may fail or produce unexpected results in a number of
* circumstances. * circumstances.
* <UL> * <UL>
* <LI>If one of the arguments does not occur in the pattern, it * <LI>If one of the arguments does not occur in the pattern, it
* will be returned as a default Formattable. * will be returned as a default Formattable.
* <LI>If the format of an argument is loses information, such as with * <LI>If the format of an argument loses information, such as with
* a choice format where a large number formats to "many", then the * a choice format where a large number formats to "many", then the
* parse may not correspond to the originally formatted argument. * parse may not correspond to the originally formatted argument.
* <LI>MessageFormat does not handle ChoiceFormat recursion during * <LI>MessageFormat does not handle ChoiceFormat recursion during
* parsing; such parses will fail. * parsing; such parses will fail.
* <LI>Parsing will not always find a match (or the correct match) if * <LI>Parsing will not always find a match (or the correct match) if
* some part of the parse is ambiguous. For example, if the pattern * some part of the parse is ambiguous. For example, if the pattern
* "{1},{2}" is used with the string arguments {"a,b", "c"}, it will * "{1},{2}" is used with the string arguments {"a,b", "c"}, it will
* format as "a,b,c". When the result is parsed, it will return {"a", * format as "a,b,c". When the result is parsed, it will return {"a",
* "b,c"}. * "b,c"}.
* <LI>If a single argument is formatted more than once in the string, * <LI>If a single argument is formatted more than once in the string,
skipping to change at line 181 skipping to change at line 181
* \endcode * \endcode
* </pre> * </pre>
* *
* The pattern is of the following form. Legend: * The pattern is of the following form. Legend:
* <pre> * <pre>
* \code * \code
* {optional item} * {optional item}
* (group that may be repeated)* * (group that may be repeated)*
* \endcode * \endcode
* </pre> * </pre>
* Do not confuse optional items with items inside quotes braces, such * Do not confuse optional items with items inside quoted braces, such
* as this: "{". Quoted braces are literals. * as this: "{". Quoted braces are literals.
* <pre> * <pre>
* \code * \code
* messageFormatPattern := string ( "{" messageFormatElement "}" stri ng )* * messageFormatPattern := string ( "{" messageFormatElement "}" stri ng )*
* *
* messageFormatElement := argumentIndex | argumentName { "," element Format } * messageFormatElement := argumentIndex | argumentName { "," element Format }
* *
* elementFormat := "time" { "," datetimeStyle } * elementFormat := "time" { "," datetimeStyle }
* | "date" { "," datetimeStyle } * | "date" { "," datetimeStyle }
* | "number" { "," numberStyle } * | "number" { "," numberStyle }
* | "choice" "," choiceStyle * | "choice" "," choiceStyle
* | "spellout" { "," spelloutStyle }
* | "ordinal" { "," spelloutStyle }
* | "duration" { "," spelloutStyle }
* | "plural" "," pluralStyle
* | "select" "," selectStyle
* *
* datetimeStyle := "short" * datetimeStyle := "short"
* | "medium" * | "medium"
* | "long" * | "long"
* | "full" * | "full"
* | dateFormatPattern * | dateFormatPattern
* *
* numberStyle := "currency" * numberStyle := "currency"
* | "percent" * | "percent"
* | "integer" * | "integer"
* | numberFormatPattern * | numberFormatPattern
* *
* choiceStyle := choiceFormatPattern * choiceStyle := choiceFormatPattern
* *
* pluralStyle := pluralFormatPattern * pluralStyle := pluralFormatPattern
*
* selectStyle := selectFormatPattern
*
* spelloutStyle := ruleSetName
* \endcode * \endcode
* </pre> * </pre>
* If there is no elementFormat, then the argument must be a string, * If there is no elementFormat, then the argument must be a string,
* which is substituted. If there is no dateTimeStyle or numberStyle, * which is substituted. If there is no dateTimeStyle or numberStyle,
* then the default format is used (e.g. NumberFormat::createInstance(), * then the default format is used (e.g. NumberFormat::createInstance(),
* DateFormat::createTimeInstance(DateFormat::kDefault, ...) or DateFormat: * DateFormat::createTimeInstance(DateFormat::kDefault, ...) or
:createDateInstance(DateFormat::kDefault, ...). For * DateFormat::createDateInstance(DateFormat::kDefault, ...). For
* a ChoiceFormat, the pattern must always be specified, since there * a RuleBasedNumberFormat, if there is no ruleSetName, the default
* is no default. * rule set is used. For a ChoiceFormat or PluralFormat or SelectFormat, th
e pattern
* must always be specified, since there is no default.
* <P> * <P>
* In strings, single quotes can be used to quote syntax characters. * In strings, single quotes can be used to quote syntax characters.
* A literal single quote is represented by '', both within and outside * A literal single quote is represented by '', both within and outside
* of single-quoted segments. Inside a * of single-quoted segments. Inside a
* messageFormatElement, quotes are <EM>not</EM> removed. For example, * messageFormatElement, quotes are <EM>not</EM> removed. For example,
* {1,number,$'#',##} will produce a number format with the pound-sign * {1,number,$'#',##} will produce a number format with the pound-sign
* quoted, with a result such as: "$#31,45". * quoted, with a result such as: "$#31,45".
* <P> * <P>
* If a pattern is used, then unquoted braces in the pattern, if any, * If a pattern is used, then unquoted braces in the pattern, if any,
* must match: that is, "ab {0} de" and "ab '}' de" are ok, but "ab * must match: that is, "ab {0} de" and "ab '}' de" are ok, but "ab
skipping to change at line 248 skipping to change at line 259
* human-readable text, and to use the ASCII apostrophe (U+0027 ' ) * human-readable text, and to use the ASCII apostrophe (U+0027 ' )
* only in program syntax, like quoting in MessageFormat. * only in program syntax, like quoting in MessageFormat.
* See the annotations for U+0027 Apostrophe in The Unicode Standard.</p> * See the annotations for U+0027 Apostrophe in The Unicode Standard.</p>
* </dl> * </dl>
* <P> * <P>
* The argumentIndex is a non-negative integer, which corresponds to the * The argumentIndex is a non-negative integer, which corresponds to the
* index of the arguments presented in an array to be formatted. The * index of the arguments presented in an array to be formatted. The
* first argument has argumentIndex 0. * first argument has argumentIndex 0.
* <P> * <P>
* It is acceptable to have unused arguments in the array. With missing * It is acceptable to have unused arguments in the array. With missing
* arguments or arguments that are not of the right class for the * arguments, or arguments that are not of the right class for the
* specified format, a failing UErrorCode result is set. * specified format, a failing UErrorCode result is set.
* <P> * <P>
* For more sophisticated patterns, you can use a ChoiceFormat to get * For more sophisticated patterns, you can use a ChoiceFormat to get
* output: * output:
* <pre> * <pre>
* \code * \code
* UErrorCode success = U_ZERO_ERROR; * UErrorCode success = U_ZERO_ERROR;
* MessageFormat* form("The disk \"{1}\" contains {0}.", success); * MessageFormat* form("The disk \"{1}\" contains {0}.", success);
* double filelimits[] = {0,1,2}; * double filelimits[] = {0,1,2};
* UnicodeString filepart[] = {"no files","one file","{0,number} files" }; * UnicodeString filepart[] = {"no files","one file","{0,number} files" };
skipping to change at line 452 skipping to change at line 463
/** /**
* Sets subformats. * Sets subformats.
* See the class description about format numbering. * See the class description about format numbering.
* The caller should not delete the Format objects after this call. * The caller should not delete the Format objects after this call.
* <EM>The array formatsToAdopt is not itself adopted.</EM> Its * <EM>The array formatsToAdopt is not itself adopted.</EM> Its
* ownership is retained by the caller. If the call fails because * ownership is retained by the caller. If the call fails because
* memory cannot be allocated, then the formats will be deleted * memory cannot be allocated, then the formats will be deleted
* by this method, and this object will remain unchanged. * by this method, and this object will remain unchanged.
* *
* <p>If this format uses named arguments, the new formats are discarde
d
* and this format remains unchanged.
*
* @stable ICU 2.0 * @stable ICU 2.0
* @param formatsToAdopt the format to be adopted. * @param formatsToAdopt the format to be adopted.
* @param count the size of the array. * @param count the size of the array.
*/ */
virtual void adoptFormats(Format** formatsToAdopt, int32_t count); virtual void adoptFormats(Format** formatsToAdopt, int32_t count);
/** /**
* Sets subformats. * Sets subformats.
* See the class description about format numbering. * See the class description about format numbering.
* Each item in the array is cloned into the internal array. * Each item in the array is cloned into the internal array.
* If the call fails because memory cannot be allocated, then this * If the call fails because memory cannot be allocated, then this
* object will remain unchanged. * object will remain unchanged.
* *
* <p>If this format uses named arguments, the new formats are discarde
d
* and this format remains unchanged.
*
* @stable ICU 2.0 * @stable ICU 2.0
* @param newFormats the new format to be set. * @param newFormats the new format to be set.
* @param cnt the size of the array. * @param cnt the size of the array.
*/ */
virtual void setFormats(const Format** newFormats, int32_t cnt); virtual void setFormats(const Format** newFormats, int32_t cnt);
/** /**
* Sets one subformat. * Sets one subformat.
* See the class description about format numbering. * See the class description about format numbering.
* The caller should not delete the Format object after this call. * The caller should not delete the Format object after this call.
* If the number is over the number of formats already set, * If the number is over the number of formats already set,
* the item will be deleted and ignored. * the item will be deleted and ignored.
*
* <p>If this format uses named arguments, the new format is discarded
* and this format remains unchanged.
*
* @stable ICU 2.0 * @stable ICU 2.0
* @param formatNumber index of the subformat. * @param formatNumber index of the subformat.
* @param formatToAdopt the format to be adopted. * @param formatToAdopt the format to be adopted.
*/ */
virtual void adoptFormat(int32_t formatNumber, Format* formatToAdopt); virtual void adoptFormat(int32_t formatNumber, Format* formatToAdopt);
/** /**
* Sets one subformat. * Sets one subformat.
* See the class description about format numbering. * See the class description about format numbering.
* If the number is over the number of formats already set, * If the number is over the number of formats already set,
skipping to change at line 554 skipping to change at line 575
* @param formatToAdopt Format to be adopted. * @param formatToAdopt Format to be adopted.
* @param status output param set to success/failure code. * @param status output param set to success/failure code.
* @stable ICU 4.0 * @stable ICU 4.0
*/ */
virtual void adoptFormat(const UnicodeString& formatName, Format* forma tToAdopt, UErrorCode& status); virtual void adoptFormat(const UnicodeString& formatName, Format* forma tToAdopt, UErrorCode& status);
/** /**
* Gets an array of subformats of this object. The returned array * Gets an array of subformats of this object. The returned array
* should not be deleted by the caller, nor should the pointers * should not be deleted by the caller, nor should the pointers
* within the array. The array and its contents remain valid only * within the array. The array and its contents remain valid only
* until the next call to any method of this class is made with * until the next call to this format. See the class description
* this object. See the class description about format numbering. * about format numbering.
*
* @param count output parameter to receive the size of the array * @param count output parameter to receive the size of the array
* @return an array of count Format* objects, or NULL if out of * @return an array of count Format* objects, or NULL if out of
* memory. Any or all of the array elements may be NULL. * memory. Any or all of the array elements may be NULL.
* @stable ICU 2.0 * @stable ICU 2.0
*/ */
virtual const Format** getFormats(int32_t& count) const; virtual const Format** getFormats(int32_t& count) const;
/** /**
* Formats the given array of arguments into a user-readable string. * Formats the given array of arguments into a user-readable string.
* Does not take ownership of the Formattable* array or its contents. * Does not take ownership of the Formattable* array or its contents.
* *
* <p>If this format uses named arguments, appendTo is unchanged and
* status is set to U_ILLEGAL_ARGUMENT_ERROR.
*
* @param source An array of objects to be formatted. * @param source An array of objects to be formatted.
* @param count The number of elements of 'source'. * @param count The number of elements of 'source'.
* @param appendTo Output parameter to receive result. * @param appendTo Output parameter to receive result.
* Result is appended to existing contents. * Result is appended to existing contents.
* @param ignore Not used; inherited from base class API. * @param ignore Not used; inherited from base class API.
* @param status Input/output error code. If the * @param status Input/output error code. If the
* pattern cannot be parsed, set to failure code. * pattern cannot be parsed, set to failure code.
* @return Reference to 'appendTo' parameter. * @return Reference to 'appendTo' parameter.
* @stable ICU 2.0 * @stable ICU 2.0
*/ */
UnicodeString& format( const Formattable* source, UnicodeString& format(const Formattable* source,
int32_t count, int32_t count,
UnicodeString& appendTo, UnicodeString& appendTo,
FieldPosition& ignore, FieldPosition& ignore,
UErrorCode& status) const; UErrorCode& status) const;
/** /**
* Formats the given array of arguments into a user-readable string * Formats the given array of arguments into a user-readable string
* using the given pattern. * using the given pattern.
* *
* <p>If this format uses named arguments, appendTo is unchanged and
* status is set to U_ILLEGAL_ARGUMENT_ERROR.
*
* @param pattern The pattern. * @param pattern The pattern.
* @param arguments An array of objects to be formatted. * @param arguments An array of objects to be formatted.
* @param count The number of elements of 'source'. * @param count The number of elements of 'source'.
* @param appendTo Output parameter to receive result. * @param appendTo Output parameter to receive result.
* Result is appended to existing contents. * Result is appended to existing contents.
* @param status Input/output error code. If the * @param status Input/output error code. If the
* pattern cannot be parsed, set to failure code. * pattern cannot be parsed, set to failure code.
* @return Reference to 'appendTo' parameter. * @return Reference to 'appendTo' parameter.
* @stable ICU 2.0 * @stable ICU 2.0
*/ */
skipping to change at line 609 skipping to change at line 637
int32_t count, int32_t count,
UnicodeString& appendTo, UnicodeString& appendTo,
UErrorCode& status); UErrorCode& status);
/** /**
* Formats the given array of arguments into a user-readable * Formats the given array of arguments into a user-readable
* string. The array must be stored within a single Formattable * string. The array must be stored within a single Formattable
* object of type kArray. If the Formattable object type is not of * object of type kArray. If the Formattable object type is not of
* type kArray, then returns a failing UErrorCode. * type kArray, then returns a failing UErrorCode.
* *
* <p>If this format uses named arguments, appendTo is unchanged and
* status is set to U_ILLEGAL_ARGUMENT_ERROR.
*
* @param obj A Formattable of type kArray containing * @param obj A Formattable of type kArray containing
* arguments to be formatted. * arguments to be formatted.
* @param appendTo Output parameter to receive result. * @param appendTo Output parameter to receive result.
* Result is appended to existing contents. * Result is appended to existing contents.
* @param pos On input: an alignment field, if desired. * @param pos On input: an alignment field, if desired.
* On output: the offsets of the alignment field. * On output: the offsets of the alignment field.
* @param status Input/output error code. If the * @param status Input/output error code. If the
* pattern cannot be parsed, set to failure code. * pattern cannot be parsed, set to failure code.
* @return Reference to 'appendTo' parameter. * @return Reference to 'appendTo' parameter.
* @stable ICU 2.0 * @stable ICU 2.0
skipping to change at line 679 skipping to change at line 710
* @param source String to be parsed. * @param source String to be parsed.
* @param pos On input, starting position for parse. On output, * @param pos On input, starting position for parse. On output,
* final position after parse. Unchanged if parse * final position after parse. Unchanged if parse
* fails. * fails.
* @param count Output parameter to receive the number of arguments * @param count Output parameter to receive the number of arguments
* parsed. * parsed.
* @return an array of parsed arguments. The caller owns both * @return an array of parsed arguments. The caller owns both
* the array and its contents. * the array and its contents.
* @stable ICU 2.0 * @stable ICU 2.0
*/ */
virtual Formattable* parse( const UnicodeString& source, virtual Formattable* parse(const UnicodeString& source,
ParsePosition& pos, ParsePosition& pos,
int32_t& count) const; int32_t& count) const;
/** /**
* Parses the given string into an array of output arguments. * Parses the given string into an array of output arguments.
* *
* <p>If this format uses named arguments, status is set to
* U_ARGUMENT_TYPE_MISMATCH.
*
* @param source String to be parsed. * @param source String to be parsed.
* @param count Output param to receive size of returned array. * @param count Output param to receive size of returned array.
* @param status Input/output error code. If the * @param status Input/output error code. If the
* pattern cannot be parsed, set to failure code. * pattern cannot be parsed, set to failure code.
* If the MessageFormat is named argument, the status
is
* set to U_ARGUMENT_TYPE_MISMATCH.
* @return an array of parsed arguments. The caller owns both * @return an array of parsed arguments. The caller owns both
* the array and its contents. Return NULL if status is not U_ZERO_ERRO R. * the array and its contents. Returns NULL if status is not U_ZERO_ERR OR.
* *
* @stable ICU 2.0 * @stable ICU 2.0
*/ */
virtual Formattable* parse( const UnicodeString& source, virtual Formattable* parse(const UnicodeString& source,
int32_t& count, int32_t& count,
UErrorCode& status) const; UErrorCode& status) const;
/** /**
* Parses the given string into an array of output arguments * Parses the given string into an array of output arguments
* stored within a single Formattable of type kArray. * stored within a single Formattable of type kArray.
* *
* @param source The string to be parsed into an object. * @param source The string to be parsed into an object.
* @param result Formattable to be set to the parse result. * @param result Formattable to be set to the parse result.
* If parse fails, return contents are undefined. * If parse fails, return contents are undefined.
* @param pos On input, starting position for parse. On output, * @param pos On input, starting position for parse. On output,
* final position after parse. Unchanged if parse * final position after parse. Unchanged if parse
 End of changes. 35 change blocks. 
62 lines changed or deleted 90 lines changed or added


 normlzr.h   normlzr.h 
/* /*
******************************************************************** ********************************************************************
* COPYRIGHT: * COPYRIGHT:
* Copyright (c) 1996-2006, International Business Machines Corporation and * Copyright (c) 1996-2010, International Business Machines Corporation and
* others. All Rights Reserved. * others. All Rights Reserved.
******************************************************************** ********************************************************************
*/ */
#ifndef NORMLZR_H #ifndef NORMLZR_H
#define NORMLZR_H #define NORMLZR_H
#include "unicode/utypes.h" #include "unicode/utypes.h"
/** /**
* \file * \file
* \brief C++ API: Unicode Normalization * \brief C++ API: Unicode Normalization
*/ */
#if !UCONFIG_NO_NORMALIZATION #if !UCONFIG_NO_NORMALIZATION
#include "unicode/uobject.h"
#include "unicode/unistr.h"
#include "unicode/chariter.h" #include "unicode/chariter.h"
#include "unicode/normalizer2.h"
#include "unicode/unistr.h"
#include "unicode/unorm.h" #include "unicode/unorm.h"
#include "unicode/uobject.h"
struct UCharIterator;
typedef struct UCharIterator UCharIterator; /**< C typedef for struct UChar
Iterator. @stable ICU 2.1 */
U_NAMESPACE_BEGIN U_NAMESPACE_BEGIN
/** /**
* The Normalizer class supports the standard normalization forms described in * The Normalizer class supports the standard normalization forms described in
* <a href="http://www.unicode.org/unicode/reports/tr15/" target="unicode"> * <a href="http://www.unicode.org/unicode/reports/tr15/" target="unicode">
* Unicode Standard Annex #15: Unicode Normalization Forms</a>. * Unicode Standard Annex #15: Unicode Normalization Forms</a>.
* *
* Note: This API has been replaced by the Normalizer2 class and is only av
ailable
* for backward compatibility. This class simply delegates to the Normalize
r2 class.
* There is one exception: The new API does not provide a replacement for N
ormalizer::compare().
*
* The Normalizer class consists of two parts: * The Normalizer class consists of two parts:
* - static functions that normalize strings or test if strings are normali zed * - static functions that normalize strings or test if strings are normali zed
* - a Normalizer object is an iterator that takes any kind of text and * - a Normalizer object is an iterator that takes any kind of text and
* provides iteration over its normalized form * provides iteration over its normalized form
* *
* The Normalizer class is not suitable for subclassing. * The Normalizer class is not suitable for subclassing.
* *
* The static functions are basically wrappers around the C implementation,
* using UnicodeString instead of UChar*.
* For basic information about normalization forms and details about the C API * For basic information about normalization forms and details about the C API
* please see the documentation in unorm.h. * please see the documentation in unorm.h.
* *
* The iterator API with the Normalizer constructors and the non-static fun ctions * The iterator API with the Normalizer constructors and the non-static fun ctions
* uses a CharacterIterator as input. It is possible to pass a string which * use a CharacterIterator as input. It is possible to pass a string which
* is then internally wrapped in a CharacterIterator. * is then internally wrapped in a CharacterIterator.
* The input text is not normalized all at once, but incrementally where ne eded * The input text is not normalized all at once, but incrementally where ne eded
* (providing efficient random access). * (providing efficient random access).
* This allows to pass in a large text but spend only a small amount of tim e * This allows to pass in a large text but spend only a small amount of tim e
* normalizing a small part of that text. * normalizing a small part of that text.
* However, if the entire text is normalized, then the iterator will be * However, if the entire text is normalized, then the iterator will be
* slower than normalizing the entire text at once and iterating over the r esult. * slower than normalizing the entire text at once and iterating over the r esult.
* A possible use of the Normalizer iterator is also to report an index int o the * A possible use of the Normalizer iterator is also to report an index int o the
* original text that is close to where the normalized characters come from . * original text that is close to where the normalized characters come from .
* *
skipping to change at line 288 skipping to change at line 288
* *
* @param source string for determining if it is in a normalized fo rmat * @param source string for determining if it is in a normalized fo rmat
* @param mode normalization format * @param mode normalization format
* @param options the optional features to be enabled (0 for no opti ons) * @param options the optional features to be enabled (0 for no opti ons)
* @param status A reference to a UErrorCode to receive any errors * @param status A reference to a UErrorCode to receive any errors
* @return UNORM_YES, UNORM_NO or UNORM_MAYBE * @return UNORM_YES, UNORM_NO or UNORM_MAYBE
* *
* @see isNormalized * @see isNormalized
* @stable ICU 2.6 * @stable ICU 2.6
*/ */
static inline UNormalizationCheckResult static UNormalizationCheckResult
quickCheck(const UnicodeString &source, UNormalizationMode mode, int32_t options, UErrorCode &status); quickCheck(const UnicodeString &source, UNormalizationMode mode, int32_t options, UErrorCode &status);
/** /**
* Test if a string is in a given normalization form. * Test if a string is in a given normalization form.
* This is semantically equivalent to source.equals(normalize(source, mod e)) . * This is semantically equivalent to source.equals(normalize(source, mod e)) .
* *
* Unlike unorm_quickCheck(), this function returns a definitive result, * Unlike unorm_quickCheck(), this function returns a definitive result,
* never a "maybe". * never a "maybe".
* For NFD, NFKD, and FCD, both functions work exactly the same. * For NFD, NFKD, and FCD, both functions work exactly the same.
* For NFC and NFKC where quickCheck may return "maybe", this function wi ll * For NFC and NFKC where quickCheck may return "maybe", this function wi ll
skipping to change at line 329 skipping to change at line 329
* @param mode Which normalization form to test for. * @param mode Which normalization form to test for.
* @param options the optional features to be enabled (0 for no opti ons) * @param options the optional features to be enabled (0 for no opti ons)
* @param errorCode ICU error code in/out parameter. * @param errorCode ICU error code in/out parameter.
* Must fulfill U_SUCCESS before the function call. * Must fulfill U_SUCCESS before the function call.
* @return Boolean value indicating whether the source string is in the * @return Boolean value indicating whether the source string is in the
* "mode" normalization form. * "mode" normalization form.
* *
* @see quickCheck * @see quickCheck
* @stable ICU 2.6 * @stable ICU 2.6
*/ */
static inline UBool static UBool
isNormalized(const UnicodeString &src, UNormalizationMode mode, int32_t o ptions, UErrorCode &errorCode); isNormalized(const UnicodeString &src, UNormalizationMode mode, int32_t o ptions, UErrorCode &errorCode);
/** /**
* Concatenate normalized strings, making sure that the result is normali zed as well. * Concatenate normalized strings, making sure that the result is normali zed as well.
* *
* If both the left and the right strings are in * If both the left and the right strings are in
* the normalization form according to "mode/options", * the normalization form according to "mode/options",
* then the result will be * then the result will be
* *
* \code * \code
skipping to change at line 727 skipping to change at line 727
//----------------------------------------------------------------------- -- //----------------------------------------------------------------------- --
Normalizer(); // default constructor not implemented Normalizer(); // default constructor not implemented
Normalizer &operator=(const Normalizer &that); // assignment operator not implemented Normalizer &operator=(const Normalizer &that); // assignment operator not implemented
// Private utility methods for iteration // Private utility methods for iteration
// For documentation, see the source code // For documentation, see the source code
UBool nextNormalize(); UBool nextNormalize();
UBool previousNormalize(); UBool previousNormalize();
void init(CharacterIterator *iter); void init();
void clearBuffer(void); void clearBuffer(void);
//----------------------------------------------------------------------- -- //----------------------------------------------------------------------- --
// Private data // Private data
//----------------------------------------------------------------------- -- //----------------------------------------------------------------------- --
FilteredNormalizer2*fFilteredNorm2; // owned if not NULL
const Normalizer2 *fNorm2; // not owned; may be equal to fFilteredNorm2
UNormalizationMode fUMode; UNormalizationMode fUMode;
int32_t fOptions; int32_t fOptions;
// The input text and our position in it // The input text and our position in it
UCharIterator *text; CharacterIterator *text;
// The normalization buffer is the result of normalization // The normalization buffer is the result of normalization
// of the source in [currentIndex..nextIndex[ . // of the source in [currentIndex..nextIndex[ .
int32_t currentIndex, nextIndex; int32_t currentIndex, nextIndex;
// A buffer for holding intermediate results // A buffer for holding intermediate results
UnicodeString buffer; UnicodeString buffer;
int32_t bufferPos; int32_t bufferPos;
}; };
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
// Inline implementations // Inline implementations
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
inline UBool inline UBool
Normalizer::operator!= (const Normalizer& other) const Normalizer::operator!= (const Normalizer& other) const
{ return ! operator==(other); } { return ! operator==(other); }
skipping to change at line 762 skipping to change at line 763
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
inline UBool inline UBool
Normalizer::operator!= (const Normalizer& other) const Normalizer::operator!= (const Normalizer& other) const
{ return ! operator==(other); } { return ! operator==(other); }
inline UNormalizationCheckResult inline UNormalizationCheckResult
Normalizer::quickCheck(const UnicodeString& source, Normalizer::quickCheck(const UnicodeString& source,
UNormalizationMode mode, UNormalizationMode mode,
UErrorCode &status) { UErrorCode &status) {
if(U_FAILURE(status)) { return quickCheck(source, mode, 0, status);
return UNORM_MAYBE;
}
return unorm_quickCheck(source.getBuffer(), source.length(),
mode, &status);
}
inline UNormalizationCheckResult
Normalizer::quickCheck(const UnicodeString& source,
UNormalizationMode mode, int32_t options,
UErrorCode &status) {
if(U_FAILURE(status)) {
return UNORM_MAYBE;
}
return unorm_quickCheckWithOptions(source.getBuffer(), source.length(),
mode, options, &status);
} }
inline UBool inline UBool
Normalizer::isNormalized(const UnicodeString& source, Normalizer::isNormalized(const UnicodeString& source,
UNormalizationMode mode, UNormalizationMode mode,
UErrorCode &status) { UErrorCode &status) {
if(U_FAILURE(status)) { return isNormalized(source, mode, 0, status);
return FALSE;
}
return unorm_isNormalized(source.getBuffer(), source.length(),
mode, &status);
}
inline UBool
Normalizer::isNormalized(const UnicodeString& source,
UNormalizationMode mode, int32_t options,
UErrorCode &status) {
if(U_FAILURE(status)) {
return FALSE;
}
return unorm_isNormalizedWithOptions(source.getBuffer(), source.length(
),
mode, options, &status);
} }
inline int32_t inline int32_t
Normalizer::compare(const UnicodeString &s1, const UnicodeString &s2, Normalizer::compare(const UnicodeString &s1, const UnicodeString &s2,
uint32_t options, uint32_t options,
UErrorCode &errorCode) { UErrorCode &errorCode) {
// all argument checking is done in unorm_compare // all argument checking is done in unorm_compare
return unorm_compare(s1.getBuffer(), s1.length(), return unorm_compare(s1.getBuffer(), s1.length(),
s2.getBuffer(), s2.length(), s2.getBuffer(), s2.length(),
options, options,
 End of changes. 15 change blocks. 
52 lines changed or deleted 20 lines changed or added


 numfmt.h   numfmt.h 
/* /*
*************************************************************************** ***** *************************************************************************** *****
* Copyright (C) 1997-2009, International Business Machines Corporation and others. * Copyright (C) 1997-2010, International Business Machines Corporation and others.
* All Rights Reserved. * All Rights Reserved.
*************************************************************************** ***** *************************************************************************** *****
* *
* File NUMFMT.H * File NUMFMT.H
* *
* Modification History: * Modification History:
* *
* Date Name Description * Date Name Description
* 02/19/97 aliu Converted from java. * 02/19/97 aliu Converted from java.
* 03/18/97 clhuang Updated per C++ implementation. * 03/18/97 clhuang Updated per C++ implementation.
skipping to change at line 37 skipping to change at line 37
* \file * \file
* \brief C++ API: Abstract base class for all number formats. * \brief C++ API: Abstract base class for all number formats.
*/ */
#if !UCONFIG_NO_FORMATTING #if !UCONFIG_NO_FORMATTING
#include "unicode/unistr.h" #include "unicode/unistr.h"
#include "unicode/format.h" #include "unicode/format.h"
#include "unicode/unum.h" // UNumberFormatStyle #include "unicode/unum.h" // UNumberFormatStyle
#include "unicode/locid.h" #include "unicode/locid.h"
#include "unicode/stringpiece.h"
U_NAMESPACE_BEGIN U_NAMESPACE_BEGIN
#if !UCONFIG_NO_SERVICE #if !UCONFIG_NO_SERVICE
class NumberFormatFactory; class NumberFormatFactory;
class StringEnumeration; class StringEnumeration;
#endif #endif
/** /**
* *
skipping to change at line 192 skipping to change at line 193
kIsoCurrencyStyle, kIsoCurrencyStyle,
kPluralCurrencyStyle, kPluralCurrencyStyle,
kStyleCount // ALWAYS LAST ENUM: number of styles kStyleCount // ALWAYS LAST ENUM: number of styles
}; };
/** /**
* Alignment Field constants used to construct a FieldPosition object. * Alignment Field constants used to construct a FieldPosition object.
* Signifies that the position of the integer part or fraction part of * Signifies that the position of the integer part or fraction part of
* a formatted number should be returned. * a formatted number should be returned.
* *
* Note: as of ICU 4.4, the values in this enum have been extended to
* support identification of all number format fields, not just those
* pertaining to alignment.
*
* @see FieldPosition * @see FieldPosition
* @stable ICU 2.0 * @stable ICU 2.0
*/ */
enum EAlignmentFields { enum EAlignmentFields {
kIntegerField, kIntegerField,
kFractionField, kFractionField,
kDecimalSeparatorField,
kExponentSymbolField,
kExponentSignField,
kExponentField,
kGroupingSeparatorField,
kCurrencyField,
kPercentField,
kPermillField,
kSignField,
/** /**
* These constants are provided for backwards compatibility only. * These constants are provided for backwards compatibility only.
* Please use the C++ style constants defined above. * Please use the C++ style constants defined above.
* @stable ICU 2.0 * @stable ICU 2.0
*/ */
INTEGER_FIELD = kIntegerField, INTEGER_FIELD = kIntegerField,
FRACTION_FIELD = kFractionField FRACTION_FIELD = kFractionField
}; };
skipping to change at line 243 skipping to change at line 257
* @param status Output param filled with success/failure status. * @param status Output param filled with success/failure status.
* @return Reference to 'appendTo' parameter. * @return Reference to 'appendTo' parameter.
* @stable ICU 2.0 * @stable ICU 2.0
*/ */
virtual UnicodeString& format(const Formattable& obj, virtual UnicodeString& format(const Formattable& obj,
UnicodeString& appendTo, UnicodeString& appendTo,
FieldPosition& pos, FieldPosition& pos,
UErrorCode& status) const; UErrorCode& status) const;
/** /**
* Format an object to produce a string. This method handles
* Formattable objects with numeric types. If the Formattable
* object type is not a numeric type, then it returns a failing
* UErrorCode.
*
* @param obj The object to format.
* @param appendTo Output parameter to receive result.
* Result is appended to existing contents.
* @param posIter On return, can be used to iterate over positions
* of fields generated by this format call.
* @param status Output param filled with success/failure status.
* @return Reference to 'appendTo' parameter.
* @draft 4.4
*/
virtual UnicodeString& format(const Formattable& obj,
UnicodeString& appendTo,
FieldPositionIterator& posIter,
UErrorCode& status) const;
/**
* Parse a string to produce an object. This methods handles * Parse a string to produce an object. This methods handles
* parsing of numeric strings into Formattable objects with numeric * parsing of numeric strings into Formattable objects with numeric
* types. * types.
* <P> * <P>
* Before calling, set parse_pos.index to the offset you want to * Before calling, set parse_pos.index to the offset you want to
* start parsing at in the source. After calling, parse_pos.index * start parsing at in the source. After calling, parse_pos.index
* indicates the position after the successfully parsed text. If * indicates the position after the successfully parsed text. If
* an error occurs, parse_pos.index is unchanged. * an error occurs, parse_pos.index is unchanged.
* <P> * <P>
* When parsing, leading whitespace is discarded (with successful * When parsing, leading whitespace is discarded (with successful
skipping to change at line 329 skipping to change at line 363
* Result is appended to existing contents. * Result is appended to existing contents.
* @param pos On input: an alignment field, if desired. * @param pos On input: an alignment field, if desired.
* On output: the offsets of the alignment field. * On output: the offsets of the alignment field.
* @return Reference to 'appendTo' parameter. * @return Reference to 'appendTo' parameter.
* @stable ICU 2.0 * @stable ICU 2.0
*/ */
virtual UnicodeString& format(double number, virtual UnicodeString& format(double number,
UnicodeString& appendTo, UnicodeString& appendTo,
FieldPosition& pos) const = 0; FieldPosition& pos) const = 0;
/** /**
* Format a double number. Subclasses must implement
* this method.
*
* @param number The value to be formatted.
* @param appendTo Output parameter to receive result.
* Result is appended to existing contents.
* @param posIter On return, can be used to iterate over positions
* of fields generated by this format call.
* @param status Output param filled with success/failure status.
* @return Reference to 'appendTo' parameter.
* @draft 4.4
*/
virtual UnicodeString& format(double number,
UnicodeString& appendTo,
FieldPositionIterator& posIter,
UErrorCode& status) const;
/**
* Format a long number. Concrete subclasses must implement * Format a long number. Concrete subclasses must implement
* these pure virtual methods. * these pure virtual methods.
* *
* @param number The value to be formatted. * @param number The value to be formatted.
* @param appendTo Output parameter to receive result. * @param appendTo Output parameter to receive result.
* Result is appended to existing contents. * Result is appended to existing contents.
* @param pos On input: an alignment field, if desired. * @param pos On input: an alignment field, if desired.
* On output: the offsets of the alignment field. * On output: the offsets of the alignment field.
* @return Reference to 'appendTo' parameter. * @return Reference to 'appendTo' parameter.
* @stable ICU 2.0 * @stable ICU 2.0
*/ */
virtual UnicodeString& format(int32_t number, virtual UnicodeString& format(int32_t number,
UnicodeString& appendTo, UnicodeString& appendTo,
FieldPosition& pos) const = 0; FieldPosition& pos) const = 0;
/** /**
* Format an int32 number. Subclasses must implement
* this method.
*
* @param number The value to be formatted.
* @param appendTo Output parameter to receive result.
* Result is appended to existing contents.
* @param posIter On return, can be used to iterate over positions
* of fields generated by this format call.
* @param status Output param filled with success/failure status.
* @return Reference to 'appendTo' parameter.
* @draft 4.4
*/
virtual UnicodeString& format(int32_t number,
UnicodeString& appendTo,
FieldPositionIterator& posIter,
UErrorCode& status) const;
/**
* Format an int64 number. (Not abstract to retain compatibility * Format an int64 number. (Not abstract to retain compatibility
* with earlier releases, however subclasses should override this * with earlier releases, however subclasses should override this
* method as it just delegates to format(int32_t number...); * method as it just delegates to format(int32_t number...);
* *
* @param number The value to be formatted. * @param number The value to be formatted.
* @param appendTo Output parameter to receive result. * @param appendTo Output parameter to receive result.
* Result is appended to existing contents. * Result is appended to existing contents.
* @param pos On input: an alignment field, if desired. * @param pos On input: an alignment field, if desired.
* On output: the offsets of the alignment field. * On output: the offsets of the alignment field.
* @return Reference to 'appendTo' parameter. * @return Reference to 'appendTo' parameter.
* @stable ICU 2.8 * @stable ICU 2.8
*/ */
virtual UnicodeString& format(int64_t number, virtual UnicodeString& format(int64_t number,
UnicodeString& appendTo, UnicodeString& appendTo,
FieldPosition& pos) const; FieldPosition& pos) const;
/** /**
* Format an int64 number. Subclasses must implement
* this method.
*
* @param number The value to be formatted.
* @param appendTo Output parameter to receive result.
* Result is appended to existing contents.
* @param posIter On return, can be used to iterate over positions
* of fields generated by this format call.
* @param status Output param filled with success/failure status.
* @return Reference to 'appendTo' parameter.
* @draft 4.4
*/
virtual UnicodeString& format(int64_t number,
UnicodeString& appendTo,
FieldPositionIterator& posIter,
UErrorCode& status) const;
/**
* Format a decimal number. Subclasses must implement
* this method. The syntax of the unformatted number is a "numeric str
ing"
* as defined in the Decimal Arithmetic Specification, available at
* http://speleotrove.com/decimal
*
* @param number The unformatted number, as a string, to be formatte
d.
* @param appendTo Output parameter to receive result.
* Result is appended to existing contents.
* @param posIter On return, can be used to iterate over positions
* of fields generated by this format call.
* @param status Output param filled with success/failure status.
* @return Reference to 'appendTo' parameter.
* @draft 4.4
*/
virtual UnicodeString& format(const StringPiece &number,
UnicodeString& appendTo,
FieldPositionIterator& posIter,
UErrorCode& status) const;
// TODO: do we also want a format of a decimal number that takes a
// FieldPosition parameter?
/**
* Redeclared Format method. * Redeclared Format method.
* @param obj The object to be formatted. * @param obj The object to be formatted.
* @param appendTo Output parameter to receive result. * @param appendTo Output parameter to receive result.
* Result is appended to existing contents. * Result is appended to existing contents.
* @param status Output parameter set to a failure error code * @param status Output parameter set to a failure error code
* when a failure occurs. * when a failure occurs.
* @return Reference to 'appendTo' parameter. * @return Reference to 'appendTo' parameter.
* @stable ICU 2.0 * @stable ICU 2.0
*/ */
UnicodeString& format(const Formattable& obj, UnicodeString& format(const Formattable& obj,
 End of changes. 8 change blocks. 
1 lines changed or deleted 112 lines changed or added


 numsys.h   numsys.h 
/* /*
*************************************************************************** **** *************************************************************************** ****
* Copyright (C) 2009, International Business Machines Corporation and * Copyright (C) 2010, International Business Machines Corporation and
* others. All Rights Reserved. * others. All Rights Reserved.
*************************************************************************** **** *************************************************************************** ****
* *
* *
* File NUMSYS.H * File NUMSYS.H
* *
* Modification History:* * Modification History:*
* Date Name Description * Date Name Description
* *
*************************************************************************** ***** *************************************************************************** *****
skipping to change at line 54 skipping to change at line 54
* Alternate numbering systems can be specified to a locale by using the * Alternate numbering systems can be specified to a locale by using the
* numbers locale keyword. * numbers locale keyword.
*/ */
class U_I18N_API NumberingSystem : public UObject { class U_I18N_API NumberingSystem : public UObject {
public: public:
/** /**
* Default Constructor. * Default Constructor.
* *
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
NumberingSystem(); NumberingSystem();
/** /**
* Copy constructor. * Copy constructor.
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
NumberingSystem(const NumberingSystem& other); NumberingSystem(const NumberingSystem& other);
/** /**
* Destructor. * Destructor.
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
virtual ~NumberingSystem(); virtual ~NumberingSystem();
/** /**
* Create the default numbering system associated with the specified lo cale. * Create the default numbering system associated with the specified lo cale.
* @param inLocale The given locale. * @param inLocale The given locale.
* @param status ICU status * @param status ICU status
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
static NumberingSystem* U_EXPORT2 createInstance(const Locale & inLocal e, UErrorCode& status); static NumberingSystem* U_EXPORT2 createInstance(const Locale & inLocal e, UErrorCode& status);
/** /**
* Create the default numbering system associated with the default loca le. * Create the default numbering system associated with the default loca le.
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
static NumberingSystem* U_EXPORT2 createInstance(UErrorCode& status); static NumberingSystem* U_EXPORT2 createInstance(UErrorCode& status);
/** /**
* Create a numbering system using the specified radix, type, and descr iption. * Create a numbering system using the specified radix, type, and descr iption.
* @param radix The radix (base) for this numbering system. * @param radix The radix (base) for this numbering system.
* @param isAlgorithmic TRUE if the numbering system is algorithmic rat her than numeric. * @param isAlgorithmic TRUE if the numbering system is algorithmic rat her than numeric.
* @param description The string representing the set of digits used in a numeric system, or the name of the RBNF * @param description The string representing the set of digits used in a numeric system, or the name of the RBNF
* ruleset to be used in an algorithmic system. * ruleset to be used in an algorithmic system.
* @param status ICU status * @param status ICU status
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
static NumberingSystem* U_EXPORT2 createInstance(int32_t radix, UBool i sAlgorithmic, const UnicodeString& description, UErrorCode& status ); static NumberingSystem* U_EXPORT2 createInstance(int32_t radix, UBool i sAlgorithmic, const UnicodeString& description, UErrorCode& status );
/** /**
* Return a StringEnumeration over all the names of numbering systems k nown to ICU. * Return a StringEnumeration over all the names of numbering systems k nown to ICU.
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
static StringEnumeration * U_EXPORT2 getAvailableNames(UErrorCode& sta tus); static StringEnumeration * U_EXPORT2 getAvailableNames(UErrorCode& sta tus);
/** /**
* Create a numbering system from one of the predefined numbering syste ms known to ICU. * Create a numbering system from one of the predefined numbering syste ms known to ICU.
* @param name The name of the numbering system. * @param name The name of the numbering system.
* @param status ICU status * @param status ICU status
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
static NumberingSystem* U_EXPORT2 createInstanceByName(const char* name , UErrorCode& status); static NumberingSystem* U_EXPORT2 createInstanceByName(const char* name , UErrorCode& status);
/** /**
* Returns the radix of this numbering system. * Returns the radix of this numbering system.
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
int32_t getRadix(); int32_t getRadix();
/** /**
* Returns the description string of this numbering system, which is ei ther * Returns the description string of this numbering system, which is ei ther
* the string of digits in the case of simple systems, or the ruleset n ame * the string of digits in the case of simple systems, or the ruleset n ame
* in the case of algorithmic systems. * in the case of algorithmic systems.
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
virtual UnicodeString getDescription(); virtual UnicodeString getDescription();
/** /**
* Returns TRUE if the given numbering system is algorithmic * Returns TRUE if the given numbering system is algorithmic
* *
* @return TRUE if the numbering system is algorithmic. * @return TRUE if the numbering system is algorithmic.
* Otherwise, return FALSE. * Otherwise, return FALSE.
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
UBool isAlgorithmic() const; UBool isAlgorithmic() const;
/** /**
* ICU "poor man's RTTI", returns a UClassID for this class. * ICU "poor man's RTTI", returns a UClassID for this class.
* *
* @draft ICU 4.2 * @stable ICU 4.4
* *
*/ */
static UClassID U_EXPORT2 getStaticClassID(void); static UClassID U_EXPORT2 getStaticClassID(void);
/** /**
* ICU "poor man's RTTI", returns a UClassID for the actual class. * ICU "poor man's RTTI", returns a UClassID for the actual class.
* *
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
virtual UClassID getDynamicClassID() const; virtual UClassID getDynamicClassID() const;
private: private:
UnicodeString desc; UnicodeString desc;
int32_t radix; int32_t radix;
UBool algorithmic; UBool algorithmic;
void setRadix(int32_t radix); void setRadix(int32_t radix);
 End of changes. 14 change blocks. 
14 lines changed or deleted 14 lines changed or added


 platform.h   platform.h 
/* /*
*************************************************************************** *** *************************************************************************** ***
* *
* Copyright (C) 1997-2009, International Business Machines * Copyright (C) 1997-2010, International Business Machines
* Corporation and others. All Rights Reserved. * Corporation and others. All Rights Reserved.
* *
*************************************************************************** *** *************************************************************************** ***
* *
* Note: autoconf creates platform.h from platform.h.in at configure time. * Note: autoconf creates platform.h from platform.h.in at configure time.
* *
*************************************************************************** *** *************************************************************************** ***
* *
* FILE NAME : platform.h * FILE NAME : platform.h
* *
skipping to change at line 36 skipping to change at line 36
/** /**
* \file * \file
* \brief Basic types for the platform * \brief Basic types for the platform
*/ */
/* This file should be included before uvernum.h. */ /* This file should be included before uvernum.h. */
#if defined(UVERNUM_H) #if defined(UVERNUM_H)
# error Do not include unicode/uvernum.h before #including unicode/platform .h. Instead of unicode/uvernum.h, #include unicode/uversion.h # error Do not include unicode/uvernum.h before #including unicode/platform .h. Instead of unicode/uvernum.h, #include unicode/uversion.h
#endif #endif
/* Determine wheter to enable auto cleanup of libraries. */ /** Determine wheter to enable auto cleanup of libraries. */
#ifndef UCLN_NO_AUTO_CLEANUP #ifndef UCLN_NO_AUTO_CLEANUP
#define UCLN_NO_AUTO_CLEANUP 1 #define UCLN_NO_AUTO_CLEANUP 1
#endif #endif
/* Need platform.h when using CYGWINMSVC to get definitions above. Ignore e verything else. */ /* Need platform.h when using CYGWINMSVC to get definitions above. Ignore e verything else. */
#ifndef CYGWINMSVC #ifndef CYGWINMSVC
/* Define the platform we're on. */ /** Define the platform we're on. */
#ifndef U_LINUX #ifndef U_LINUX
#define U_LINUX #define U_LINUX
#endif #endif
/** /**
* \def U_HAVE_DIRENT_H * \def U_HAVE_DIRENT_H
* Define whether dirent.h is available */ * Define whether dirent.h is available */
#ifndef U_HAVE_DIRENT_H #ifndef U_HAVE_DIRENT_H
#define U_HAVE_DIRENT_H 1 #define U_HAVE_DIRENT_H 1
#endif #endif
skipping to change at line 182 skipping to change at line 182
/* Determine whether to override placement new and delete for STL. */ /* Determine whether to override placement new and delete for STL. */
#ifndef U_HAVE_PLACEMENT_NEW #ifndef U_HAVE_PLACEMENT_NEW
#define U_HAVE_PLACEMENT_NEW 1 #define U_HAVE_PLACEMENT_NEW 1
#endif #endif
/* Determine whether to enable tracing. */ /* Determine whether to enable tracing. */
#ifndef U_ENABLE_TRACING #ifndef U_ENABLE_TRACING
#define U_ENABLE_TRACING 0 #define U_ENABLE_TRACING 0
#endif #endif
/* dynamic loading */
#ifndef U_ENABLE_DYLOAD
#define U_ENABLE_DYLOAD 1
#endif
#ifndef U_CHECK_DYLOAD
#define U_CHECK_DYLOAD 1
#endif
/* Do we allow ICU users to use the draft APIs by default? */ /* Do we allow ICU users to use the draft APIs by default? */
#ifndef U_DEFAULT_SHOW_DRAFT #ifndef U_DEFAULT_SHOW_DRAFT
#define U_DEFAULT_SHOW_DRAFT 1 #define U_DEFAULT_SHOW_DRAFT 1
#endif #endif
/** @} */ /** @} */
/*========================================================================= ==*/ /*========================================================================= ==*/
/** @{ Character data types */ /** @{ Character data types */
/*========================================================================= ==*/ /*========================================================================= ==*/
 End of changes. 4 change blocks. 
3 lines changed or deleted 12 lines changed or added


 pwin32.h   pwin32.h 
/* /*
************************************************************************** **** ************************************************************************** ****
* *
* Copyright (C) 1997-2009, International Business Machines * Copyright (C) 1997-2010, International Business Machines
* Corporation and others. All Rights Reserved. * Corporation and others. All Rights Reserved.
* *
************************************************************************** **** ************************************************************************** ****
* *
* FILE NAME : platform.h * FILE NAME : platform.h
* *
* Date Name Description * Date Name Description
* 05/13/98 nos Creation (content moved here from ptypes.h). * 05/13/98 nos Creation (content moved here from ptypes.h).
* 03/02/99 stephen Added AS400 support. * 03/02/99 stephen Added AS400 support.
* 03/30/99 stephen Added Linux support. * 03/30/99 stephen Added Linux support.
skipping to change at line 302 skipping to change at line 302
#if 1 #if 1
#define U_TZNAME _tzname #define U_TZNAME _tzname
#endif #endif
#if 1 #if 1
#define U_DAYLIGHT _daylight #define U_DAYLIGHT _daylight
#endif #endif
#define U_HAVE_MMAP 0 #define U_HAVE_MMAP 0
#define U_HAVE_POPEN 0 #define U_HAVE_POPEN 0
#ifndef U_ENABLE_DYLOAD
#define U_ENABLE_DYLOAD 1
#endif
/** @} */ /** @} */
/*========================================================================= ==*/ /*========================================================================= ==*/
/** @{ Symbol import-export control */ /** @{ Symbol import-export control */
/*========================================================================= ==*/ /*========================================================================= ==*/
#ifdef U_STATIC_IMPLEMENTATION #ifdef U_STATIC_IMPLEMENTATION
#define U_EXPORT #define U_EXPORT
#else #else
#define U_EXPORT __declspec(dllexport) #define U_EXPORT __declspec(dllexport)
 End of changes. 2 change blocks. 
1 lines changed or deleted 5 lines changed or added


 regex.h   regex.h 
skipping to change at line 77 skipping to change at line 77
class RegexCImpl; class RegexCImpl;
/** /**
* RBBIPatternDump Debug function, displays the compiled form of a patt ern. * RBBIPatternDump Debug function, displays the compiled form of a patt ern.
* @internal * @internal
*/ */
#ifdef REGEX_DEBUG #ifdef REGEX_DEBUG
U_INTERNAL void U_EXPORT2 U_INTERNAL void U_EXPORT2
RegexPatternDump(const RegexPattern *pat); RegexPatternDump(const RegexPattern *pat);
#else #else
#undef RegexPatternDump
#define RegexPatternDump(pat) #define RegexPatternDump(pat)
#endif #endif
/** /**
* Class <code>RegexPattern</code> represents a compiled regular expressio n. It includes * Class <code>RegexPattern</code> represents a compiled regular expressio n. It includes
* factory methods for creating a RegexPattern object from the source (str ing) form * factory methods for creating a RegexPattern object from the source (str ing) form
* of a regular expression, methods for creating RegexMatchers that allow the pattern * of a regular expression, methods for creating RegexMatchers that allow the pattern
* to be applied to input text, and a few convenience methods for simple c ommon * to be applied to input text, and a few convenience methods for simple c ommon
* uses of regular expressions. * uses of regular expressions.
* *
 End of changes. 1 change blocks. 
0 lines changed or deleted 1 lines changed or added


 smpdtfmt.h   smpdtfmt.h 
/* /*
* Copyright (C) 1997-2009, International Business Machines Corporation and others. All Rights Reserved. * Copyright (C) 1997-2010, International Business Machines Corporation and others. All Rights Reserved.
*************************************************************************** **** *************************************************************************** ****
* *
* File SMPDTFMT.H * File SMPDTFMT.H
* *
* Modification History: * Modification History:
* *
* Date Name Description * Date Name Description
* 02/19/97 aliu Converted from java. * 02/19/97 aliu Converted from java.
* 07/09/97 helena Make ParsePosition into a class. * 07/09/97 helena Make ParsePosition into a class.
* 07/21/98 stephen Added GMT_PLUS, GMT_MINUS * 07/21/98 stephen Added GMT_PLUS, GMT_MINUS
skipping to change at line 42 skipping to change at line 42
#if !UCONFIG_NO_FORMATTING #if !UCONFIG_NO_FORMATTING
#include "unicode/datefmt.h" #include "unicode/datefmt.h"
U_NAMESPACE_BEGIN U_NAMESPACE_BEGIN
class DateFormatSymbols; class DateFormatSymbols;
class DateFormat; class DateFormat;
class MessageFormat; class MessageFormat;
class FieldPositionHandler;
/** /**
* *
* SimpleDateFormat is a concrete class for formatting and parsing dates in a * SimpleDateFormat is a concrete class for formatting and parsing dates in a
* language-independent manner. It allows for formatting (millis -> text), * language-independent manner. It allows for formatting (millis -> text),
* parsing (text -> millis), and normalization. Formats/Parses a date or ti me, * parsing (text -> millis), and normalization. Formats/Parses a date or ti me,
* which is the standard milliseconds since 24:00 GMT, Jan 1, 1970. * which is the standard milliseconds since 24:00 GMT, Jan 1, 1970.
* <P> * <P>
* Clients are encouraged to create a date-time formatter using DateFormat: :getInstance(), * Clients are encouraged to create a date-time formatter using DateFormat: :getInstance(),
* getDateInstance(), getDateInstance(), or getDateTimeInstance() rather th an * getDateInstance(), getDateInstance(), or getDateTimeInstance() rather th an
skipping to change at line 259 skipping to change at line 260
* as "thai". To specify that just the year portion of the date be for matted using Hebrew numbering, * as "thai". To specify that just the year portion of the date be for matted using Hebrew numbering,
* use the override string "y=hebrew". Numbering system overrides can be combined using a semi-colon * use the override string "y=hebrew". Numbering system overrides can be combined using a semi-colon
* character in the override string, such as "d=decimal;M=arabic;y=hebr ew", etc. * character in the override string, such as "d=decimal;M=arabic;y=hebr ew", etc.
* *
* <P> * <P>
* [Note:] Not all locales support SimpleDateFormat; for full generalit y, * [Note:] Not all locales support SimpleDateFormat; for full generalit y,
* use the factory methods in the DateFormat class. * use the factory methods in the DateFormat class.
* @param pattern the pattern for the format. * @param pattern the pattern for the format.
* @param override the override string. * @param override the override string.
* @param status Output param set to success/failure code. * @param status Output param set to success/failure code.
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
SimpleDateFormat(const UnicodeString& pattern, SimpleDateFormat(const UnicodeString& pattern,
const UnicodeString& override, const UnicodeString& override,
UErrorCode& status); UErrorCode& status);
/** /**
* Construct a SimpleDateFormat using the given pattern and locale. * Construct a SimpleDateFormat using the given pattern and locale.
* The locale is used to obtain the symbols used in formatting (e.g., t he * The locale is used to obtain the symbols used in formatting (e.g., t he
* names of the months), but not to provide the pattern. * names of the months), but not to provide the pattern.
* <P> * <P>
skipping to change at line 300 skipping to change at line 301
* as "thai". To specify that just the year portion of the date be for matted using Hebrew numbering, * as "thai". To specify that just the year portion of the date be for matted using Hebrew numbering,
* use the override string "y=hebrew". Numbering system overrides can be combined using a semi-colon * use the override string "y=hebrew". Numbering system overrides can be combined using a semi-colon
* character in the override string, such as "d=decimal;M=arabic;y=hebr ew", etc. * character in the override string, such as "d=decimal;M=arabic;y=hebr ew", etc.
* <P> * <P>
* [Note:] Not all locales support SimpleDateFormat; for full generalit y, * [Note:] Not all locales support SimpleDateFormat; for full generalit y,
* use the factory methods in the DateFormat class. * use the factory methods in the DateFormat class.
* @param pattern the pattern for the format. * @param pattern the pattern for the format.
* @param override the numbering system override. * @param override the numbering system override.
* @param locale the given locale. * @param locale the given locale.
* @param status Output param set to success/failure code. * @param status Output param set to success/failure code.
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
SimpleDateFormat(const UnicodeString& pattern, SimpleDateFormat(const UnicodeString& pattern,
const UnicodeString& override, const UnicodeString& override,
const Locale& locale, const Locale& locale,
UErrorCode& status); UErrorCode& status);
/** /**
* Construct a SimpleDateFormat using the given pattern and locale-spec ific * Construct a SimpleDateFormat using the given pattern and locale-spec ific
* symbol data. The formatter takes ownership of the DateFormatSymbols object; * symbol data. The formatter takes ownership of the DateFormatSymbols object;
* the caller is no longer responsible for deleting it. * the caller is no longer responsible for deleting it.
skipping to change at line 395 skipping to change at line 396
UnicodeString& appendTo, UnicodeString& appendTo,
FieldPosition& pos) const; FieldPosition& pos) const;
/** /**
* Format a date or time, which is the standard millis since 24:00 GMT, Jan * Format a date or time, which is the standard millis since 24:00 GMT, Jan
* 1, 1970. Overrides DateFormat pure virtual method. * 1, 1970. Overrides DateFormat pure virtual method.
* <P> * <P>
* Example: using the US locale: "yyyy.MM.dd e 'at' HH:mm:ss zzz" ->> * Example: using the US locale: "yyyy.MM.dd e 'at' HH:mm:ss zzz" ->>
* 1996.07.10 AD at 15:08:56 PDT * 1996.07.10 AD at 15:08:56 PDT
* *
* @param cal Calendar set to the date and time to be formatted
* into a date/time string.
* @param appendTo Output parameter to receive result.
* Result is appended to existing contents.
* @param posIter On return, can be used to iterate over positions
* of fields generated by this format call. Field val
ues
* are defined in UDateFormatField.
* @param status Input/output param set to success/failure code.
* @return Reference to 'appendTo' parameter.
* @draft ICU 4.4
*/
virtual UnicodeString& format( Calendar& cal,
UnicodeString& appendTo,
FieldPositionIterator& posIter,
UErrorCode& status) const;
/**
* Format a date or time, which is the standard millis since 24:00 GMT,
Jan
* 1, 1970. Overrides DateFormat pure virtual method.
* <P>
* Example: using the US locale: "yyyy.MM.dd e 'at' HH:mm:ss zzz" ->>
* 1996.07.10 AD at 15:08:56 PDT
*
* @param obj A Formattable containing the date-time value to be formatted * @param obj A Formattable containing the date-time value to be formatted
* into a date-time string. If the type of the Format table * into a date-time string. If the type of the Format table
* is a numeric type, it is treated as if it were an * is a numeric type, it is treated as if it were an
* instance of Date. * instance of Date.
* @param appendTo Output parameter to receive result. * @param appendTo Output parameter to receive result.
* Result is appended to existing contents. * Result is appended to existing contents.
* @param pos The formatting position. On input: an alignment fie ld, * @param pos The formatting position. On input: an alignment fie ld,
* if desired. On output: the offsets of the alignment field. * if desired. On output: the offsets of the alignment field.
* @param status Output param set to success/faulure code. * @param status Input/output param set to success/failure code.
* @return Reference to 'appendTo' parameter. * @return Reference to 'appendTo' parameter.
* @stable ICU 2.0 * @stable ICU 2.0
*/ */
virtual UnicodeString& format( const Formattable& obj, virtual UnicodeString& format( const Formattable& obj,
UnicodeString& appendTo, UnicodeString& appendTo,
FieldPosition& pos, FieldPosition& pos,
UErrorCode& status) const; UErrorCode& status) const;
/** /**
* Format a date or time, which is the standard millis since 24:00 GMT,
Jan
* 1, 1970. Overrides DateFormat pure virtual method.
* <P>
* Example: using the US locale: "yyyy.MM.dd e 'at' HH:mm:ss zzz" ->>
* 1996.07.10 AD at 15:08:56 PDT
*
* @param obj A Formattable containing the date-time value to be
formatted
* into a date-time string. If the type of the Format
table
* is a numeric type, it is treated as if it were an
* instance of Date.
* @param appendTo Output parameter to receive result.
* Result is appended to existing contents.
* @param posIter On return, can be used to iterate over positions
* of fields generated by this format call. Field val
ues
* are defined in UDateFormatField.
* @param status Input/output param set to success/failure code.
* @return Reference to 'appendTo' parameter.
* @draft ICU 4.4
*/
virtual UnicodeString& format( const Formattable& obj,
UnicodeString& appendTo,
FieldPositionIterator& posIter,
UErrorCode& status) const;
/**
* Redeclared DateFormat method. * Redeclared DateFormat method.
* @param date the Date value to be formatted. * @param date the Date value to be formatted.
* @param appendTo Output parameter to receive result. * @param appendTo Output parameter to receive result.
* Result is appended to existing contents. * Result is appended to existing contents.
* @param fieldPosition The formatting position. On input: an alignment field, * @param fieldPosition The formatting position. On input: an alignment field,
* if desired. On output: the offsets of the align ment field. * if desired. On output: the offsets of the align ment field.
* @return Reference to 'appendTo' parameter. * @return Reference to 'appendTo' parameter.
* @stable ICU 2.1 * @stable ICU 2.1
*/ */
UnicodeString& format(UDate date, UnicodeString& format(UDate date,
UnicodeString& appendTo, UnicodeString& appendTo,
FieldPosition& fieldPosition) const; FieldPosition& fieldPosition) const;
/** /**
* Redeclared DateFormat method. * Redeclared DateFormat method.
* @param date the Date value to be formatted.
* @param appendTo Output parameter to receive result.
* Result is appended to existing contents.
* @param posIter On return, can be used to iterate over position
s
* of fields generated by this format call. Field
values
* are defined in UDateFormatField.
* @param status Input/output param set to success/failure code.
* @return Reference to 'appendTo' parameter.
* @draft ICU 4.4
*/
UnicodeString& format(UDate date,
UnicodeString& appendTo,
FieldPositionIterator& posIter,
UErrorCode& status) const;
/**
* Redeclared DateFormat method.
* @param obj Object to be formatted. * @param obj Object to be formatted.
* @param appendTo Output parameter to receive result. * @param appendTo Output parameter to receive result.
* Result is appended to existing contents. * Result is appended to existing contents.
* @param status Input/output success/failure code. * @param status Input/output success/failure code.
* @return Reference to 'appendTo' parameter. * @return Reference to 'appendTo' parameter.
* @stable ICU 2.0 * @stable ICU 2.0
*/ */
UnicodeString& format(const Formattable& obj, UnicodeString& format(const Formattable& obj,
UnicodeString& appendTo, UnicodeString& appendTo,
UErrorCode& status) const; UErrorCode& status) const;
skipping to change at line 723 skipping to change at line 789
* Construct a SimpleDateFormat for the given locale. If no resource d ata * Construct a SimpleDateFormat for the given locale. If no resource d ata
* is available, create an object of last resort, using hard-coded stri ngs. * is available, create an object of last resort, using hard-coded stri ngs.
* This is an internal method, called by DateFormat. It should never f ail. * This is an internal method, called by DateFormat. It should never f ail.
* @param locale the given locale. * @param locale the given locale.
* @param status Output param set to success/failure code on * @param status Output param set to success/failure code on
* exit. * exit.
*/ */
SimpleDateFormat(const Locale& locale, UErrorCode& status); // Use defa ult pattern SimpleDateFormat(const Locale& locale, UErrorCode& status); // Use defa ult pattern
/** /**
* Hook called by format(... FieldPosition& ...) and format(...FieldPos
itionIterator&...)
*/
UnicodeString& _format(Calendar& cal, UnicodeString& appendTo, FieldPos
itionHandler& handler,
UErrorCode& status) const;
/**
* Called by format() to format a single field. * Called by format() to format a single field.
* *
* @param appendTo Output parameter to receive result. * @param appendTo Output parameter to receive result.
* Result is appended to existing contents. * Result is appended to existing contents.
* @param ch The format character we encountered in the pattern. * @param ch The format character we encountered in the pattern.
* @param count Number of characters in the current pattern symbol (e.g., * @param count Number of characters in the current pattern symbol (e.g.,
* "yyyy" in the pattern would result in a call to thi s function * "yyyy" in the pattern would result in a call to thi s function
* with ch equal to 'y' and count equal to 4) * with ch equal to 'y' and count equal to 4)
* @param pos The FieldPosition being filled in by the format() c * @param handler Records information about field positions.
all. If
* this function is formatting the field specfied by p
os, it
* will fill in pos with the beginning and ending offs
ets of the
* field.
* @param status Receives a status code, which will be U_ZERO_ERROR if the operation * @param status Receives a status code, which will be U_ZERO_ERROR if the operation
* succeeds. * succeeds.
*/ */
void subFormat( UnicodeString &appendTo, void subFormat(UnicodeString &appendTo,
UChar ch, UChar ch,
int32_t count, int32_t count,
FieldPosition& pos, FieldPositionHandler& handler,
Calendar& cal, Calendar& cal,
UErrorCode& status) const; // in case of il UErrorCode& status) const; // in case of illegal argumen
legal argument t
/** /**
* Used by subFormat() to format a numeric value. * Used by subFormat() to format a numeric value.
* Appends to toAppendTo a string representation of "value" * Appends to toAppendTo a string representation of "value"
* having a number of digits between "minDigits" and * having a number of digits between "minDigits" and
* "maxDigits". Uses the DateFormat's NumberFormat. * "maxDigits". Uses the DateFormat's NumberFormat.
* *
* @param appendTo Output parameter to receive result. * @param appendTo Output parameter to receive result.
* Formatted number is appended to existing contents. * Formatted number is appended to existing contents.
* @param value Value to format. * @param value Value to format.
* @param minDigits Minimum number of digits the result should have * @param minDigits Minimum number of digits the result should have
* @param maxDigits Maximum number of digits the result should have * @param maxDigits Maximum number of digits the result should have
*/ */
void zeroPaddingNumber( NumberFormat *currentNumberFormat, void zeroPaddingNumber(NumberFormat *currentNumberFormat,
UnicodeString &appendTo, UnicodeString &appendTo,
int32_t value, int32_t value,
int32_t minDigits, int32_t minDigits,
int32_t maxDigits) const; int32_t maxDigits) const;
/** /**
* Return true if the given format character, occuring count * Return true if the given format character, occuring count
* times, represents a numeric field. * times, represents a numeric field.
*/ */
static UBool isNumeric(UChar formatChar, int32_t count); static UBool isNumeric(UChar formatChar, int32_t count);
/** /**
* initializes fCalendar from parameters. Returns fCalendar as a conve nience. * initializes fCalendar from parameters. Returns fCalendar as a conve nience.
* @param adoptZone Zone to be adopted, or NULL for TimeZone::createDe fault(). * @param adoptZone Zone to be adopted, or NULL for TimeZone::createDe fault().
skipping to change at line 1079 skipping to change at line 1148
inline UnicodeString& inline UnicodeString&
SimpleDateFormat::format(const Formattable& obj, SimpleDateFormat::format(const Formattable& obj,
UnicodeString& appendTo, UnicodeString& appendTo,
UErrorCode& status) const { UErrorCode& status) const {
// Don't use Format:: - use immediate base class only, // Don't use Format:: - use immediate base class only,
// in case immediate base modifies behavior later. // in case immediate base modifies behavior later.
return DateFormat::format(obj, appendTo, status); return DateFormat::format(obj, appendTo, status);
} }
inline UnicodeString& inline UnicodeString&
SimpleDateFormat::format(const Formattable& obj,
UnicodeString& appendTo,
FieldPosition& pos,
UErrorCode& status) const
{
// Don't use Format:: - use immediate base class only,
// in case immediate base modifies behavior later.
return DateFormat::format(obj, appendTo, pos, status);
}
inline UnicodeString&
SimpleDateFormat::format(const Formattable& obj,
UnicodeString& appendTo,
FieldPositionIterator& posIter,
UErrorCode& status) const
{
// Don't use Format:: - use immediate base class only,
// in case immediate base modifies behavior later.
return DateFormat::format(obj, appendTo, posIter, status);
}
inline UnicodeString&
SimpleDateFormat::format(UDate date, SimpleDateFormat::format(UDate date,
UnicodeString& appendTo, UnicodeString& appendTo,
FieldPosition& fieldPosition) const { FieldPosition& fieldPosition) const {
// Don't use Format:: - use immediate base class only, // Don't use Format:: - use immediate base class only,
// in case immediate base modifies behavior later. // in case immediate base modifies behavior later.
return DateFormat::format(date, appendTo, fieldPosition); return DateFormat::format(date, appendTo, fieldPosition);
} }
inline UnicodeString& inline UnicodeString&
SimpleDateFormat::format(UDate date,
UnicodeString& appendTo,
FieldPositionIterator& posIter,
UErrorCode& status) const {
// Don't use Format:: - use immediate base class only,
// in case immediate base modifies behavior later.
return DateFormat::format(date, appendTo, posIter, status);
}
inline UnicodeString&
SimpleDateFormat::format(UDate date, UnicodeString& appendTo) const { SimpleDateFormat::format(UDate date, UnicodeString& appendTo) const {
return DateFormat::format(date, appendTo); return DateFormat::format(date, appendTo);
} }
U_NAMESPACE_END U_NAMESPACE_END
#endif /* #if !UCONFIG_NO_FORMATTING */ #endif /* #if !UCONFIG_NO_FORMATTING */
#endif // _SMPDTFMT #endif // _SMPDTFMT
//eof //eof
 End of changes. 14 change blocks. 
23 lines changed or deleted 131 lines changed or added


 stringpiece.h   stringpiece.h 
// Copyright (C) 2009, International Business Machines // Copyright (C) 2010, International Business Machines
// Corporation and others. All Rights Reserved. // Corporation and others. All Rights Reserved.
// //
// Copyright 2001 and onwards Google Inc. // Copyright 2001 and onwards Google Inc.
// Author: Sanjay Ghemawat // Author: Sanjay Ghemawat
// This code is a contribution of Google code, and the style used here is // This code is a contribution of Google code, and the style used here is
// a compromise between the original Google code and the ICU coding guideli nes. // a compromise between the original Google code and the ICU coding guideli nes.
// For example, data types are ICU-ified (size_t,int->int32_t), // For example, data types are ICU-ified (size_t,int->int32_t),
// and API comments doxygen-ified, but function names and behavior are // and API comments doxygen-ified, but function names and behavior are
// as in the original, if possible. // as in the original, if possible.
skipping to change at line 50 skipping to change at line 50
* in a "const char*" or a "string" wherever a "StringPiece" is * in a "const char*" or a "string" wherever a "StringPiece" is
* expected. * expected.
* *
* Functions or methods may use const StringPiece& parameters to accept eit her * Functions or methods may use const StringPiece& parameters to accept eit her
* a "const char*" or a "string" value that will be implicitly converted to * a "const char*" or a "string" value that will be implicitly converted to
* a StringPiece. * a StringPiece.
* *
* Systematic usage of StringPiece is encouraged as it will reduce unnecess ary * Systematic usage of StringPiece is encouraged as it will reduce unnecess ary
* conversions from "const char*" to "string" and back again. * conversions from "const char*" to "string" and back again.
* *
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
class U_COMMON_API StringPiece : public UMemory { class U_COMMON_API StringPiece : public UMemory {
private: private:
const char* ptr_; const char* ptr_;
int32_t length_; int32_t length_;
public: public:
/** /**
* Default constructor, creates an empty StringPiece. * Default constructor, creates an empty StringPiece.
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
StringPiece() : ptr_(NULL), length_(0) { } StringPiece() : ptr_(NULL), length_(0) { }
/** /**
* Constructs from a NUL-terminated const char * pointer. * Constructs from a NUL-terminated const char * pointer.
* @param str a NUL-terminated const char * pointer * @param str a NUL-terminated const char * pointer
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
StringPiece(const char* str); StringPiece(const char* str);
#if U_HAVE_STD_STRING #if U_HAVE_STD_STRING
/** /**
* Constructs from a std::string. * Constructs from a std::string.
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
StringPiece(const U_STD_NSQ string& str) StringPiece(const U_STD_NSQ string& str)
: ptr_(str.data()), length_(static_cast<int32_t>(str.size())) { } : ptr_(str.data()), length_(static_cast<int32_t>(str.size())) { }
#endif #endif
/** /**
* Constructs from a const char * pointer and a specified length. * Constructs from a const char * pointer and a specified length.
* @param offset a const char * pointer (need not be terminated) * @param offset a const char * pointer (need not be terminated)
* @param len the length of the string; must be non-negative * @param len the length of the string; must be non-negative
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
StringPiece(const char* offset, int32_t len) : ptr_(offset), length_(len) { } StringPiece(const char* offset, int32_t len) : ptr_(offset), length_(len) { }
/** /**
* Substring of another StringPiece. * Substring of another StringPiece.
* @param x the other StringPiece * @param x the other StringPiece
* @param pos start position in x; must be non-negative and <= x.length() . * @param pos start position in x; must be non-negative and <= x.length() .
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
StringPiece(const StringPiece& x, int32_t pos); StringPiece(const StringPiece& x, int32_t pos);
/** /**
* Substring of another StringPiece. * Substring of another StringPiece.
* @param x the other StringPiece * @param x the other StringPiece
* @param pos start position in x; must be non-negative and <= x.length() . * @param pos start position in x; must be non-negative and <= x.length() .
* @param len length of the substring; * @param len length of the substring;
* must be non-negative and will be pinned to at most x.length () - pos. * must be non-negative and will be pinned to at most x.length () - pos.
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
StringPiece(const StringPiece& x, int32_t pos, int32_t len); StringPiece(const StringPiece& x, int32_t pos, int32_t len);
/** /**
* Returns the string pointer. May be NULL if it is empty. * Returns the string pointer. May be NULL if it is empty.
* *
* data() may return a pointer to a buffer with embedded NULs, and the * data() may return a pointer to a buffer with embedded NULs, and the
* returned buffer may or may not be null terminated. Therefore it is * returned buffer may or may not be null terminated. Therefore it is
* typically a mistake to pass data() to a routine that expects a NUL * typically a mistake to pass data() to a routine that expects a NUL
* terminated string. * terminated string.
* @return the string pointer * @return the string pointer
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
const char* data() const { return ptr_; } const char* data() const { return ptr_; }
/** /**
* Returns the string length. Same as length(). * Returns the string length. Same as length().
* @return the string length * @return the string length
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
int32_t size() const { return length_; } int32_t size() const { return length_; }
/** /**
* Returns the string length. Same as size(). * Returns the string length. Same as size().
* @return the string length * @return the string length
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
int32_t length() const { return length_; } int32_t length() const { return length_; }
/** /**
* Returns whether the string is empty. * Returns whether the string is empty.
* @return TRUE if the string is empty * @return TRUE if the string is empty
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
UBool empty() const { return length_ == 0; } UBool empty() const { return length_ == 0; }
/** /**
* Sets to an empty string. * Sets to an empty string.
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
void clear() { ptr_ = NULL; length_ = 0; } void clear() { ptr_ = NULL; length_ = 0; }
/** /**
* Removes the first n string units. * Removes the first n string units.
* @param n prefix length, must be non-negative and <=length() * @param n prefix length, must be non-negative and <=length()
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
void remove_prefix(int32_t n) { void remove_prefix(int32_t n) {
if (n >= 0) { if (n >= 0) {
if (n > length_) { if (n > length_) {
n = length_; n = length_;
} }
ptr_ += n; ptr_ += n;
length_ -= n; length_ -= n;
} }
} }
/** /**
* Removes the last n string units. * Removes the last n string units.
* @param n suffix length, must be non-negative and <=length() * @param n suffix length, must be non-negative and <=length()
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
void remove_suffix(int32_t n) { void remove_suffix(int32_t n) {
if (n >= 0) { if (n >= 0) {
if (n <= length_) { if (n <= length_) {
length_ -= n; length_ -= n;
} else { } else {
length_ = 0; length_ = 0;
} }
} }
} }
/** /**
* Maximum integer, used as a default value for substring methods. * Maximum integer, used as a default value for substring methods.
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
static const int32_t npos = 0x7fffffff; static const int32_t npos = 0x7fffffff;
/** /**
* Returns a substring of this StringPiece. * Returns a substring of this StringPiece.
* @param pos start position; must be non-negative and <= length(). * @param pos start position; must be non-negative and <= length().
* @param len length of the substring; * @param len length of the substring;
* must be non-negative and will be pinned to at most length() - pos. * must be non-negative and will be pinned to at most length() - pos.
* @return the substring StringPiece * @return the substring StringPiece
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
StringPiece substr(int32_t pos, int32_t len = npos) const { StringPiece substr(int32_t pos, int32_t len = npos) const {
return StringPiece(*this, pos, len); return StringPiece(*this, pos, len);
} }
}; };
U_NAMESPACE_END U_NAMESPACE_END
#endif // __STRINGPIECE_H__ #endif // __STRINGPIECE_H__
 End of changes. 17 change blocks. 
17 lines changed or deleted 17 lines changed or added


 tblcoll.h   tblcoll.h 
/* /*
*************************************************************************** *** *************************************************************************** ***
* Copyright (C) 1996-2009, International Business Machines Corporation and * Copyright (C) 1996-2010, International Business Machines Corporation and
* others. All Rights Reserved. * others. All Rights Reserved.
*************************************************************************** *** *************************************************************************** ***
*/ */
/** /**
* \file * \file
* \brief C++ API: RuleBasedCollator class provides the simple implementati on of Collator. * \brief C++ API: RuleBasedCollator class provides the simple implementati on of Collator.
*/ */
/** /**
skipping to change at line 397 skipping to change at line 397
/** /**
* Compares two strings using the Collator. * Compares two strings using the Collator.
* Returns whether the first one compares less than/equal to/greater th an * Returns whether the first one compares less than/equal to/greater th an
* the second one. * the second one.
* This version takes UCharIterator input. * This version takes UCharIterator input.
* @param sIter the first ("source") string iterator * @param sIter the first ("source") string iterator
* @param tIter the second ("target") string iterator * @param tIter the second ("target") string iterator
* @param status ICU status * @param status ICU status
* @return UCOL_LESS, UCOL_EQUAL or UCOL_GREATER * @return UCOL_LESS, UCOL_EQUAL or UCOL_GREATER
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
virtual UCollationResult compare(UCharIterator &sIter, virtual UCollationResult compare(UCharIterator &sIter,
UCharIterator &tIter, UCharIterator &tIter,
UErrorCode &status) const; UErrorCode &status) const;
/** /**
* Transforms a specified region of the string into a series of characte rs * Transforms a specified region of the string into a series of characte rs
* that can be compared with CollationKey.compare. Use a CollationKey wh en * that can be compared with CollationKey.compare. Use a CollationKey wh en
* you need to do repeated comparisions on the same string. For a single * you need to do repeated comparisions on the same string. For a single
* comparison the compare method will be faster. * comparison the compare method will be faster.
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 timezone.h   timezone.h 
/************************************************************************* /*************************************************************************
* Copyright (c) 1997-2009, International Business Machines Corporation * Copyright (c) 1997-2010, International Business Machines Corporation
* and others. All Rights Reserved. * and others. All Rights Reserved.
************************************************************************** **************************************************************************
* *
* File TIMEZONE.H * File TIMEZONE.H
* *
* Modification History: * Modification History:
* *
* Date Name Description * Date Name Description
* 04/21/97 aliu Overhauled header. * 04/21/97 aliu Overhauled header.
* 07/09/97 helena Changed createInstance to createDefault. * 07/09/97 helena Changed createInstance to createDefault.
skipping to change at line 599 skipping to change at line 599
/** /**
* Returns a name of this time zone suitable for presentation to the us er * Returns a name of this time zone suitable for presentation to the us er
* in the default locale. * in the default locale.
* If the display name is not available for the locale, * If the display name is not available for the locale,
* then this method returns a string in the format * then this method returns a string in the format
* <code>GMT[+-]hh:mm</code>. * <code>GMT[+-]hh:mm</code>.
* @param daylight if true, return the daylight savings name. * @param daylight if true, return the daylight savings name.
* @param style * @param style
* @param result the human-readable name of this time zone in the defau lt locale. * @param result the human-readable name of this time zone in the defau lt locale.
* @return A reference to 'result'. * @return A reference to 'result'.
* @draft ICU 4.4 * @stable ICU 2.0
*/ */
UnicodeString& getDisplayName(UBool daylight, EDisplayType style, Unico deString& result) const; UnicodeString& getDisplayName(UBool daylight, EDisplayType style, Unico deString& result) const;
/** /**
* Returns a name of this time zone suitable for presentation to the us er * Returns a name of this time zone suitable for presentation to the us er
* in the specified locale. * in the specified locale.
* If the display name is not available for the locale, * If the display name is not available for the locale,
* then this method returns a string in the format * then this method returns a string in the format
* <code>GMT[+-]hh:mm</code>. * <code>GMT[+-]hh:mm</code>.
* @param daylight if true, return the daylight savings name. * @param daylight if true, return the daylight savings name.
* @param style * @param style
* @param locale the locale in which to supply the display name. * @param locale the locale in which to supply the display name.
* @param result the human-readable name of this time zone in the given locale * @param result the human-readable name of this time zone in the given locale
* or in the default locale if the given locale is not re cognized. * or in the default locale if the given locale is not re cognized.
* @return A refence to 'result'. * @return A refence to 'result'.
* @draft ICU 4.4 * @stable ICU 2.0
*/ */
UnicodeString& getDisplayName(UBool daylight, EDisplayType style, const Locale& locale, UnicodeString& result) const; UnicodeString& getDisplayName(UBool daylight, EDisplayType style, const Locale& locale, UnicodeString& result) const;
/** /**
* Sets default time zone name style.
* @param sytle EDisplayType to set as default
* @draft ICU 4.4
*/
void setDefaultTimeZoneNameStyle(EDisplayType style);
/**
* Get default time zone name style.
* @return Default name style for the time zone.
* @draft ICU 4.4
*/
EDisplayType getDefaultTimeZoneNameStyle();
/**
* Queries if this time zone uses daylight savings time. * Queries if this time zone uses daylight savings time.
* @return true if this time zone uses daylight savings time, * @return true if this time zone uses daylight savings time,
* false, otherwise. * false, otherwise.
* @stable ICU 2.0 * @stable ICU 2.0
*/ */
virtual UBool useDaylightTime(void) const = 0; virtual UBool useDaylightTime(void) const = 0;
/** /**
* Queries if the given date is in daylight savings time in * Queries if the given date is in daylight savings time in
* this time zone. * this time zone.
 End of changes. 4 change blocks. 
17 lines changed or deleted 3 lines changed or added


 tmunit.h   tmunit.h 
/* /*
************************************************************************** ***** ************************************************************************** *****
* Copyright (C) 2009, Google, International Business Machines Corporation and * * Copyright (C) 2009-2010, Google, International Business Machines Corpora tion and *
* others. All Rights Reserved. * * others. All Rights Reserved. *
************************************************************************** ***** ************************************************************************** *****
*/ */
#ifndef __TMUNIT_H__ #ifndef __TMUNIT_H__
#define __TMUNIT_H__ #define __TMUNIT_H__
/** /**
* \file * \file
* \brief C++ API: time unit object * \brief C++ API: time unit object
skipping to change at line 26 skipping to change at line 26
#include "unicode/measunit.h" #include "unicode/measunit.h"
#if !UCONFIG_NO_FORMATTING #if !UCONFIG_NO_FORMATTING
U_NAMESPACE_BEGIN U_NAMESPACE_BEGIN
/** /**
* Measurement unit for time units. * Measurement unit for time units.
* @see TimeUnitAmount * @see TimeUnitAmount
* @see TimeUnit * @see TimeUnit
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
class U_I18N_API TimeUnit: public MeasureUnit { class U_I18N_API TimeUnit: public MeasureUnit {
public: public:
/** /**
* Constants for all the time units we supported. * Constants for all the time units we supported.
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
enum UTimeUnitFields { enum UTimeUnitFields {
UTIMEUNIT_YEAR, UTIMEUNIT_YEAR,
UTIMEUNIT_MONTH, UTIMEUNIT_MONTH,
UTIMEUNIT_DAY, UTIMEUNIT_DAY,
UTIMEUNIT_WEEK, UTIMEUNIT_WEEK,
UTIMEUNIT_HOUR, UTIMEUNIT_HOUR,
UTIMEUNIT_MINUTE, UTIMEUNIT_MINUTE,
UTIMEUNIT_SECOND, UTIMEUNIT_SECOND,
UTIMEUNIT_FIELD_COUNT UTIMEUNIT_FIELD_COUNT
}; };
/** /**
* Create Instance. * Create Instance.
* @param timeUnitField time unit field based on which the instance * @param timeUnitField time unit field based on which the instance
* is created. * is created.
* @param status input-output error code. * @param status input-output error code.
* If the timeUnitField is invalid, * If the timeUnitField is invalid,
* then this will be set to U_ILLEGAL_ARGUMENT_ER ROR. * then this will be set to U_ILLEGAL_ARGUMENT_ER ROR.
* @return a TimeUnit instance * @return a TimeUnit instance
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
static TimeUnit* U_EXPORT2 createInstance(UTimeUnitFields timeUnitField , static TimeUnit* U_EXPORT2 createInstance(UTimeUnitFields timeUnitField ,
UErrorCode& status); UErrorCode& status);
/** /**
* Override clone. * Override clone.
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
virtual UObject* clone() const; virtual UObject* clone() const;
/** /**
* Copy operator. * Copy operator.
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
TimeUnit(const TimeUnit& other); TimeUnit(const TimeUnit& other);
/** /**
* Assignment operator. * Assignment operator.
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
TimeUnit& operator=(const TimeUnit& other); TimeUnit& operator=(const TimeUnit& other);
/** /**
* Equality operator. * Equality operator.
* @return true if 2 objects are the same. * @return true if 2 objects are the same.
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
virtual UBool operator==(const UObject& other) const; virtual UBool operator==(const UObject& other) const;
/** /**
* Non-Equality operator. * Non-Equality operator.
* @return true if 2 objects are not the same. * @return true if 2 objects are not the same.
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
UBool operator!=(const UObject& other) const; UBool operator!=(const UObject& other) const;
/** /**
* Returns a unique class ID for this object POLYMORPHICALLY. * Returns a unique class ID for this object POLYMORPHICALLY.
* This method implements a simple form of RTTI used by ICU. * This method implements a simple form of RTTI used by ICU.
* @return The class ID for this object. All objects of a given * @return The class ID for this object. All objects of a given
* class have the same class ID. Objects of other classes have * class have the same class ID. Objects of other classes have
* different class IDs. * different class IDs.
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
virtual UClassID getDynamicClassID() const; virtual UClassID getDynamicClassID() const;
/** /**
* Returns the class ID for this class. This is used to compare to * Returns the class ID for this class. This is used to compare to
* the return value of getDynamicClassID(). * the return value of getDynamicClassID().
* @return The class ID for all objects of this class. * @return The class ID for all objects of this class.
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
static UClassID U_EXPORT2 getStaticClassID(); static UClassID U_EXPORT2 getStaticClassID();
/** /**
* Get time unit field. * Get time unit field.
* @return time unit field. * @return time unit field.
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
UTimeUnitFields getTimeUnitField() const; UTimeUnitFields getTimeUnitField() const;
/** /**
* Destructor. * Destructor.
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
virtual ~TimeUnit(); virtual ~TimeUnit();
private: private:
UTimeUnitFields fTimeUnitField; UTimeUnitFields fTimeUnitField;
/** /**
* Constructor * Constructor
* @internal ICU 4.2 * @internal ICU 4.2
*/ */
 End of changes. 13 change blocks. 
13 lines changed or deleted 13 lines changed or added


 tmutamt.h   tmutamt.h 
/* /*
************************************************************************** ***** ************************************************************************** *****
* Copyright (C) 2009, Google, International Business Machines Corporation and * * Copyright (C) 2009-2010, Google, International Business Machines Corpora tion and *
* others. All Rights Reserved. * * others. All Rights Reserved. *
************************************************************************** ***** ************************************************************************** *****
*/ */
#ifndef __TMUTAMT_H__ #ifndef __TMUTAMT_H__
#define __TMUTAMT_H__ #define __TMUTAMT_H__
/** /**
* \file * \file
* \brief C++ API: time unit amount object. * \brief C++ API: time unit amount object.
skipping to change at line 27 skipping to change at line 27
#include "unicode/tmunit.h" #include "unicode/tmunit.h"
#if !UCONFIG_NO_FORMATTING #if !UCONFIG_NO_FORMATTING
U_NAMESPACE_BEGIN U_NAMESPACE_BEGIN
/** /**
* Express a duration as a time unit and number. Patterned after Currency. * Express a duration as a time unit and number. Patterned after Currency.
* @see TimeUnitAmount * @see TimeUnitAmount
* @see TimeUnitFormat * @see TimeUnitFormat
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
class U_I18N_API TimeUnitAmount: public Measure { class U_I18N_API TimeUnitAmount: public Measure {
public: public:
/** /**
* Construct TimeUnitAmount object with the given number and the * Construct TimeUnitAmount object with the given number and the
* given time unit. * given time unit.
* @param number a numeric object; number.isNumeric() must be TR UE * @param number a numeric object; number.isNumeric() must be TR UE
* @param timeUnitField the time unit field of a time unit * @param timeUnitField the time unit field of a time unit
* @param status the input-output error code. * @param status the input-output error code.
* If the number is not numeric or the timeUnitFie ld * If the number is not numeric or the timeUnitFie ld
* is not valid, * is not valid,
* then this will be set to a failing value: * then this will be set to a failing value:
* U_ILLEGAL_ARGUMENT_ERROR. * U_ILLEGAL_ARGUMENT_ERROR.
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
TimeUnitAmount(const Formattable& number, TimeUnitAmount(const Formattable& number,
TimeUnit::UTimeUnitFields timeUnitField, TimeUnit::UTimeUnitFields timeUnitField,
UErrorCode& status); UErrorCode& status);
/** /**
* Construct TimeUnitAmount object with the given numeric amount and th e * Construct TimeUnitAmount object with the given numeric amount and th e
* given time unit. * given time unit.
* @param amount a numeric amount. * @param amount a numeric amount.
* @param timeUnitField the time unit field on which a time unit amount * @param timeUnitField the time unit field on which a time unit amount
* object will be created. * object will be created.
* @param status the input-output error code. * @param status the input-output error code.
* If the timeUnitField is not valid, * If the timeUnitField is not valid,
* then this will be set to a failing value: * then this will be set to a failing value:
* U_ILLEGAL_ARGUMENT_ERROR. * U_ILLEGAL_ARGUMENT_ERROR.
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
TimeUnitAmount(double amount, TimeUnit::UTimeUnitFields timeUnitField, TimeUnitAmount(double amount, TimeUnit::UTimeUnitFields timeUnitField,
UErrorCode& status); UErrorCode& status);
/** /**
* Copy constructor * Copy constructor
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
TimeUnitAmount(const TimeUnitAmount& other); TimeUnitAmount(const TimeUnitAmount& other);
/** /**
* Assignment operator * Assignment operator
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
TimeUnitAmount& operator=(const TimeUnitAmount& other); TimeUnitAmount& operator=(const TimeUnitAmount& other);
/** /**
* Clone. * Clone.
* @return a polymorphic clone of this object. The result will have the same class as returned by getDynamicClassID(). * @return a polymorphic clone of this object. The result will have the same class as returned by getDynamicClassID().
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
virtual UObject* clone() const; virtual UObject* clone() const;
/** /**
* Destructor * Destructor
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
virtual ~TimeUnitAmount(); virtual ~TimeUnitAmount();
/** /**
* Equality operator. * Equality operator.
* @param other the object to compare to. * @param other the object to compare to.
* @return true if this object is equal to the given object. * @return true if this object is equal to the given object.
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
virtual UBool operator==(const UObject& other) const; virtual UBool operator==(const UObject& other) const;
/** /**
* Not-equality operator. * Not-equality operator.
* @param other the object to compare to. * @param other the object to compare to.
* @return true if this object is not equal to the given object. * @return true if this object is not equal to the given object.
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
UBool operator!=(const UObject& other) const; UBool operator!=(const UObject& other) const;
/** /**
* Return the class ID for this class. This is useful only for comparin g to * Return the class ID for this class. This is useful only for comparin g to
* a return value from getDynamicClassID(). For example: * a return value from getDynamicClassID(). For example:
* <pre> * <pre>
* . Base* polymorphic_pointer = createPolymorphicObject(); * . Base* polymorphic_pointer = createPolymorphicObject();
* . if (polymorphic_pointer->getDynamicClassID() == * . if (polymorphic_pointer->getDynamicClassID() ==
* . erived::getStaticClassID()) ... * . erived::getStaticClassID()) ...
* </pre> * </pre>
* @return The class ID for all objects of this class. * @return The class ID for all objects of this class.
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
static UClassID U_EXPORT2 getStaticClassID(void); static UClassID U_EXPORT2 getStaticClassID(void);
/** /**
* Returns a unique class ID POLYMORPHICALLY. Pure virtual override. Th is * Returns a unique class ID POLYMORPHICALLY. Pure virtual override. Th is
* method is to implement a simple version of RTTI, since not all C++ * method is to implement a simple version of RTTI, since not all C++
* compilers support genuine RTTI. Polymorphic operator==() and clone() * compilers support genuine RTTI. Polymorphic operator==() and clone()
* methods call this method. * methods call this method.
* *
* @return The class ID for this object. All objects of a * @return The class ID for this object. All objects of a
* given class have the same class ID. Objects of * given class have the same class ID. Objects of
* other classes have different class IDs. * other classes have different class IDs.
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
virtual UClassID getDynamicClassID(void) const; virtual UClassID getDynamicClassID(void) const;
/** /**
* Get the time unit. * Get the time unit.
* @return time unit object. * @return time unit object.
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
const TimeUnit& getTimeUnit() const; const TimeUnit& getTimeUnit() const;
/** /**
* Get the time unit field value. * Get the time unit field value.
* @return time unit field value. * @return time unit field value.
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
TimeUnit::UTimeUnitFields getTimeUnitField() const; TimeUnit::UTimeUnitFields getTimeUnitField() const;
}; };
inline UBool inline UBool
TimeUnitAmount::operator!=(const UObject& other) const { TimeUnitAmount::operator!=(const UObject& other) const {
return !operator==(other); return !operator==(other);
} }
U_NAMESPACE_END U_NAMESPACE_END
 End of changes. 14 change blocks. 
14 lines changed or deleted 14 lines changed or added


 tmutfmt.h   tmutfmt.h 
/* /*
************************************************************************** ***** ************************************************************************** *****
* Copyright (C) 2009, Google, International Business Machines Corporation and * * Copyright (C) 2010, Google, International Business Machines Corporation and *
* others. All Rights Reserved. * * others. All Rights Reserved. *
************************************************************************** ***** ************************************************************************** *****
*/ */
#ifndef __TMUTFMT_H__ #ifndef __TMUTFMT_H__
#define __TMUTFMT_H__ #define __TMUTFMT_H__
#include "unicode/utypes.h" #include "unicode/utypes.h"
/** /**
skipping to change at line 35 skipping to change at line 35
#include "unicode/plurrule.h" #include "unicode/plurrule.h"
/** /**
* @internal ICU 4.2 * @internal ICU 4.2
*/ */
union UHashTok; union UHashTok;
U_NAMESPACE_BEGIN U_NAMESPACE_BEGIN
U_CDECL_BEGIN
/**
* @internal ICU 4.2
*/
UBool U_CALLCONV tmutfmtHashTableValueComparator(UHashTok val1, UHashTok va
l2) ;
U_CDECL_END
class Hashtable; class Hashtable;
/** /**
* Format or parse a TimeUnitAmount, using plural rules for the units where available. * Format or parse a TimeUnitAmount, using plural rules for the units where available.
* *
* <P> * <P>
* Code Sample: * Code Sample:
* <pre> * <pre>
* // create time unit amount instance - a combination of Number and time unit * // create time unit amount instance - a combination of Number and time unit
* UErrorCode status = U_ZERO_ERROR; * UErrorCode status = U_ZERO_ERROR;
skipping to change at line 74 skipping to change at line 65
* ((Format*)format)->parseObject(formatted, result, status); * ((Format*)format)->parseObject(formatted, result, status);
* if (U_SUCCESS(status)) { * if (U_SUCCESS(status)) {
* assert (result == formattable); * assert (result == formattable);
* } * }
* } * }
* </pre> * </pre>
* *
* <P> * <P>
* @see TimeUnitAmount * @see TimeUnitAmount
* @see TimeUnitFormat * @see TimeUnitFormat
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
class U_I18N_API TimeUnitFormat: public MeasureFormat { class U_I18N_API TimeUnitFormat: public MeasureFormat {
public: public:
/** /**
* Constants for various styles. * Constants for various styles.
* There are 2 styles: full name and abbreviated name. * There are 2 styles: full name and abbreviated name.
* For example, for English, the full name for hour duration is "3 hour s", * For example, for English, the full name for hour duration is "3 hour s",
* and the abbreviated name is "3 hrs". * and the abbreviated name is "3 hrs".
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
enum EStyle { enum EStyle {
kFull = 0, kFull = 0,
kAbbreviate = 1, kAbbreviate = 1,
kTotal = kAbbreviate + 1 kTotal = kAbbreviate + 1
}; };
/** /**
* Create TimeUnitFormat with default locale, and full name style. * Create TimeUnitFormat with default locale, and full name style.
* Use setLocale and/or setFormat to modify. * Use setLocale and/or setFormat to modify.
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
TimeUnitFormat(UErrorCode& status); TimeUnitFormat(UErrorCode& status);
/** /**
* Create TimeUnitFormat given locale, and full name style. * Create TimeUnitFormat given locale, and full name style.
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
TimeUnitFormat(const Locale& locale, UErrorCode& status); TimeUnitFormat(const Locale& locale, UErrorCode& status);
/** /**
* Create TimeUnitFormat given locale and style. * Create TimeUnitFormat given locale and style.
* @draft ICU 4.2 * @draft ICU 4.2
*/ */
TimeUnitFormat(const Locale& locale, EStyle style, UErrorCode& status); TimeUnitFormat(const Locale& locale, EStyle style, UErrorCode& status);
/** /**
* Copy constructor. * Copy constructor.
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
TimeUnitFormat(const TimeUnitFormat&); TimeUnitFormat(const TimeUnitFormat&);
/** /**
* deconstructor * deconstructor
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
virtual ~TimeUnitFormat(); virtual ~TimeUnitFormat();
/** /**
* Clone this Format object polymorphically. The caller owns the result and * Clone this Format object polymorphically. The caller owns the result and
* should delete it when done. * should delete it when done.
* @return A copy of the object. * @return A copy of the object.
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
virtual Format* clone(void) const; virtual Format* clone(void) const;
/** /**
* Assignment operator * Assignment operator
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
TimeUnitFormat& operator=(const TimeUnitFormat& other); TimeUnitFormat& operator=(const TimeUnitFormat& other);
/** /**
* Return true if the given Format objects are semantically equal. Obje cts * Return true if the given Format objects are semantically equal. Obje cts
* of different subclasses are considered unequal. * of different subclasses are considered unequal.
* @param other the object to be compared with. * @param other the object to be compared with.
* @return true if the given Format objects are semantically eq ual. * @return true if the given Format objects are semantically eq ual.
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
virtual UBool operator==(const Format& other) const; virtual UBool operator==(const Format& other) const;
/** /**
* Return true if the given Format objects are not semantically equal. * Return true if the given Format objects are not semantically equal.
* Objects of different subclasses are considered unequal. * Objects of different subclasses are considered unequal.
* @param other the object to be compared with. * @param other the object to be compared with.
* @return true if the given Format objects are not semantically e qual. * @return true if the given Format objects are not semantically e qual.
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
UBool operator!=(const Format& other) const; UBool operator!=(const Format& other) const;
/** /**
* Set the locale used for formatting or parsing. * Set the locale used for formatting or parsing.
* @param locale the locale to be set * @param locale the locale to be set
* @param status output param set to success/failure code on exit * @param status output param set to success/failure code on exit
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
void setLocale(const Locale& locale, UErrorCode& status); void setLocale(const Locale& locale, UErrorCode& status);
/** /**
* Set the number format used for formatting or parsing. * Set the number format used for formatting or parsing.
* @param format the number formatter to be set * @param format the number formatter to be set
* @param status output param set to success/failure code on exit * @param status output param set to success/failure code on exit
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
void setNumberFormat(const NumberFormat& format, UErrorCode& status); void setNumberFormat(const NumberFormat& format, UErrorCode& status);
/** /**
* Format a TimeUnitAmount. * Format a TimeUnitAmount.
* If the formattable object is not a time unit amount object, * If the formattable object is not a time unit amount object,
* or the number in time unit amount is not a double type or long type * or the number in time unit amount is not a double type or long type
* numeric, it returns a failing status: U_ILLEGAL_ARGUMENT_ERROR. * numeric, it returns a failing status: U_ILLEGAL_ARGUMENT_ERROR.
* @see Format#format(const Formattable&, UnicodeString&, FieldPosition &, UErrorCode&) const * @see Format#format(const Formattable&, UnicodeString&, FieldPosition &, UErrorCode&) const
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
virtual UnicodeString& format(const Formattable& obj, virtual UnicodeString& format(const Formattable& obj,
UnicodeString& toAppendTo, UnicodeString& toAppendTo,
FieldPosition& pos, FieldPosition& pos,
UErrorCode& status) const; UErrorCode& status) const;
/** /**
* Parse a TimeUnitAmount. * Parse a TimeUnitAmount.
* @see Format#parseObject(const UnicodeString&, Formattable&, ParsePos ition&) const; * @see Format#parseObject(const UnicodeString&, Formattable&, ParsePos ition&) const;
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
virtual void parseObject(const UnicodeString& source, virtual void parseObject(const UnicodeString& source,
Formattable& result, Formattable& result,
ParsePosition& pos) const; ParsePosition& pos) const;
/** /**
* Return the class ID for this class. This is useful only for comparin g to * Return the class ID for this class. This is useful only for comparin g to
* a return value from getDynamicClassID(). For example: * a return value from getDynamicClassID(). For example:
* <pre> * <pre>
* . Base* polymorphic_pointer = createPolymorphicObject(); * . Base* polymorphic_pointer = createPolymorphicObject();
* . if (polymorphic_pointer->getDynamicClassID() == * . if (polymorphic_pointer->getDynamicClassID() ==
* . erived::getStaticClassID()) ... * . erived::getStaticClassID()) ...
* </pre> * </pre>
* @return The class ID for all objects of this class. * @return The class ID for all objects of this class.
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
static UClassID U_EXPORT2 getStaticClassID(void); static UClassID U_EXPORT2 getStaticClassID(void);
/** /**
* Returns a unique class ID POLYMORPHICALLY. Pure virtual override. Th is * Returns a unique class ID POLYMORPHICALLY. Pure virtual override. Th is
* method is to implement a simple version of RTTI, since not all C++ * method is to implement a simple version of RTTI, since not all C++
* compilers support genuine RTTI. Polymorphic operator==() and clone() * compilers support genuine RTTI. Polymorphic operator==() and clone()
* methods call this method. * methods call this method.
* *
* @return The class ID for this object. All objects of a * @return The class ID for this object. All objects of a
* given class have the same class ID. Objects of * given class have the same class ID. Objects of
* other classes have different class IDs. * other classes have different class IDs.
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
virtual UClassID getDynamicClassID(void) const; virtual UClassID getDynamicClassID(void) const;
private: private:
NumberFormat* fNumberFormat; NumberFormat* fNumberFormat;
Locale fLocale; Locale fLocale;
Hashtable* fTimeUnitToCountToPatterns[TimeUnit::UTIMEUNIT_FIELD_COUN T]; Hashtable* fTimeUnitToCountToPatterns[TimeUnit::UTIMEUNIT_FIELD_COUN T];
PluralRules* fPluralRules; PluralRules* fPluralRules;
EStyle fStyle; EStyle fStyle;
friend UBool U_CALLCONV tmutfmtHashTableValueComparator(UHashTok val1,
UHashTok val2);
void create(const Locale& locale, EStyle style, UErrorCode& status); void create(const Locale& locale, EStyle style, UErrorCode& status);
// it might actually be simpler to make them Decimal Formats later. // it might actually be simpler to make them Decimal Formats later.
// initialize all private data members // initialize all private data members
void setup(UErrorCode& status); void setup(UErrorCode& status);
// initialize data member without fill in data for fTimeUnitToCountToPa ttern // initialize data member without fill in data for fTimeUnitToCountToPa ttern
void initDataMembers(UErrorCode& status); void initDataMembers(UErrorCode& status);
// initialize fTimeUnitToCountToPatterns from current locale's resource . // initialize fTimeUnitToCountToPatterns from current locale's resource .
 End of changes. 19 change blocks. 
30 lines changed or deleted 17 lines changed or added


 ubidi.h   ubidi.h 
/* /*
*************************************************************************** *** *************************************************************************** ***
* *
* Copyright (C) 1999-2009, International Business Machines * Copyright (C) 1999-2010, International Business Machines
* Corporation and others. All Rights Reserved. * Corporation and others. All Rights Reserved.
* *
*************************************************************************** *** *************************************************************************** ***
* file name: ubidi.h * file name: ubidi.h
* encoding: US-ASCII * encoding: US-ASCII
* tab size: 8 (not used) * tab size: 8 (not used)
* indentation:4 * indentation:4
* *
* created on: 1999jul27 * created on: 1999jul27
* created by: Markus W. Scherer, updated by Matitiahu Allouche * created by: Markus W. Scherer, updated by Matitiahu Allouche
skipping to change at line 523 skipping to change at line 523
* *
* @param pBiDi is a <code>UBiDi</code> object. * @param pBiDi is a <code>UBiDi</code> object.
* *
* @see ubidi_setPara * @see ubidi_setPara
* @see ubidi_setLine * @see ubidi_setLine
* @stable ICU 2.0 * @stable ICU 2.0
*/ */
U_STABLE void U_EXPORT2 U_STABLE void U_EXPORT2
ubidi_close(UBiDi *pBiDi); ubidi_close(UBiDi *pBiDi);
#ifdef XP_CPLUSPLUS #if U_SHOW_CPLUSPLUS_API
U_NAMESPACE_BEGIN U_NAMESPACE_BEGIN
/** /**
* \class LocalUBiDiPointer * \class LocalUBiDiPointer
* "Smart pointer" class, closes a UBiDi via ubidi_close(). * "Smart pointer" class, closes a UBiDi via ubidi_close().
* For most methods see the LocalPointerBase base class. * For most methods see the LocalPointerBase base class.
* *
* @see LocalPointerBase * @see LocalPointerBase
* @see LocalPointer * @see LocalPointer
skipping to change at line 814 skipping to change at line 814
* with mode <code>UBIDI_REORDER_INVERSE_NUMBERS_AS_L</code>.<br> * with mode <code>UBIDI_REORDER_INVERSE_NUMBERS_AS_L</code>.<br>
* When used in conjunction with option * When used in conjunction with option
* <code>#UBIDI_OPTION_INSERT_MARKS</code>, this mode generally * <code>#UBIDI_OPTION_INSERT_MARKS</code>, this mode generally
* adds Bidi marks to the output significantly more sparingly than mode * adds Bidi marks to the output significantly more sparingly than mode
* <code>#UBIDI_REORDER_INVERSE_NUMBERS_AS_L</code> with option * <code>#UBIDI_REORDER_INVERSE_NUMBERS_AS_L</code> with option
* <code>#UBIDI_INSERT_LRM_FOR_NUMERIC</code> in calls to * <code>#UBIDI_INSERT_LRM_FOR_NUMERIC</code> in calls to
* <code>ubidi_writeReordered</code>.</li> * <code>ubidi_writeReordered</code>.</li>
* *
* <li>When the reordering mode is set to * <li>When the reordering mode is set to
* <code>#UBIDI_REORDER_INVERSE_FOR_NUMBERS_SPECIAL</code>, the Logical to Visual * <code>#UBIDI_REORDER_INVERSE_FOR_NUMBERS_SPECIAL</code>, the Logical to Visual
* Bidi algorithm used in Windows XP is used as an approximation of an * Bidi algorithm used in Windows XP is used as an approximation of an "inv
* "inverse Bidi" algorithm. erse Bidi" algorithm.
* <br> * <br>
* For example, an LTR paragraph with the content "abc FED123" (where * For example, an LTR paragraph with the content "abc FED123" (where
* upper case represents RTL characters) will be transformed to * upper case represents RTL characters) will be transformed to "abc 123DEF
* "abc 123DEF.</li> ."</li>
* </ul> * </ul>
* *
* <p>In all the reordering modes specifying an "inverse Bidi" algorithm * <p>In all the reordering modes specifying an "inverse Bidi" algorithm
* (i.e. those with a name starting with <code>UBIDI_REORDER_INVERSE</code> ), * (i.e. those with a name starting with <code>UBIDI_REORDER_INVERSE</code> ),
* output runs should be retrieved using * output runs should be retrieved using
* <code>ubidi_getVisualRun()</code>, and the output text with * <code>ubidi_getVisualRun()</code>, and the output text with
* <code>ubidi_writeReordered()</code>. The caller should keep in mind that in * <code>ubidi_writeReordered()</code>. The caller should keep in mind that in
* "inverse Bidi" modes the input is actually visually ordered text and * "inverse Bidi" modes the input is actually visually ordered text and
* reordered output returned by <code>ubidi_getVisualRun()</code> or * reordered output returned by <code>ubidi_getVisualRun()</code> or
* <code>ubidi_writeReordered()</code> are actually runs or character strin g * <code>ubidi_writeReordered()</code> are actually runs or character strin g
 End of changes. 4 change blocks. 
6 lines changed or deleted 6 lines changed or added


 ubrk.h   ubrk.h 
/* /*
*************************************************************************** *** *************************************************************************** ***
* Copyright (C) 1996-2009, International Business Machines Corporation and others. * Copyright (C) 1996-2010, International Business Machines Corporation and others.
* All Rights Reserved. * All Rights Reserved.
*************************************************************************** *** *************************************************************************** ***
*/ */
#ifndef UBRK_H #ifndef UBRK_H
#define UBRK_H #define UBRK_H
#include "unicode/utypes.h" #include "unicode/utypes.h"
#include "unicode/uloc.h" #include "unicode/uloc.h"
#include "unicode/utext.h" #include "unicode/utext.h"
skipping to change at line 80 skipping to change at line 80
* The text boundary positions are found according to the rules * The text boundary positions are found according to the rules
* described in Unicode Standard Annex #29, Text Boundaries, and * described in Unicode Standard Annex #29, Text Boundaries, and
* Unicode Standard Annex #14, Line Breaking Properties. These * Unicode Standard Annex #14, Line Breaking Properties. These
* are available at http://www.unicode.org/reports/tr14/ and * are available at http://www.unicode.org/reports/tr14/ and
* http://www.unicode.org/reports/tr29/. * http://www.unicode.org/reports/tr29/.
* <p> * <p>
* In addition to the plain C API defined in this header file, an * In addition to the plain C API defined in this header file, an
* object oriented C++ API with equivalent functionality is defined in the * object oriented C++ API with equivalent functionality is defined in the
* file brkiter.h. * file brkiter.h.
* <p> * <p>
* Code snippits illustrating the use of the Break Iterator APIs * Code snippets illustrating the use of the Break Iterator APIs
* are available in the ICU User Guide, * are available in the ICU User Guide,
* http://icu-project.org/userguide/boundaryAnalysis.html * http://icu-project.org/userguide/boundaryAnalysis.html
* and in the sample program icu/source/samples/break/break.cpp" * and in the sample program icu/source/samples/break/break.cpp
*/ */
/** The possible types of text boundaries. @stable ICU 2.0 */ /** The possible types of text boundaries. @stable ICU 2.0 */
typedef enum UBreakIteratorType { typedef enum UBreakIteratorType {
/** Character breaks @stable ICU 2.0 */ /** Character breaks @stable ICU 2.0 */
UBRK_CHARACTER = 0, UBRK_CHARACTER = 0,
/** Word breaks @stable ICU 2.0 */ /** Word breaks @stable ICU 2.0 */
UBRK_WORD = 1, UBRK_WORD = 1,
/** Line breaks @stable ICU 2.0 */ /** Line breaks @stable ICU 2.0 */
UBRK_LINE = 2, UBRK_LINE = 2,
skipping to change at line 277 skipping to change at line 277
/** /**
* Close a UBreakIterator. * Close a UBreakIterator.
* Once closed, a UBreakIterator may no longer be used. * Once closed, a UBreakIterator may no longer be used.
* @param bi The break iterator to close. * @param bi The break iterator to close.
* @stable ICU 2.0 * @stable ICU 2.0
*/ */
U_STABLE void U_EXPORT2 U_STABLE void U_EXPORT2
ubrk_close(UBreakIterator *bi); ubrk_close(UBreakIterator *bi);
#ifdef XP_CPLUSPLUS #if U_SHOW_CPLUSPLUS_API
U_NAMESPACE_BEGIN U_NAMESPACE_BEGIN
/** /**
* \class LocalUBreakIteratorPointer * \class LocalUBreakIteratorPointer
* "Smart pointer" class, closes a UBreakIterator via ubrk_close(). * "Smart pointer" class, closes a UBreakIterator via ubrk_close().
* For most methods see the LocalPointerBase base class. * For most methods see the LocalPointerBase base class.
* *
* @see LocalPointerBase * @see LocalPointerBase
* @see LocalPointer * @see LocalPointer
 End of changes. 4 change blocks. 
4 lines changed or deleted 4 lines changed or added


 ucasemap.h   ucasemap.h 
skipping to change at line 80 skipping to change at line 80
ucasemap_open(const char *locale, uint32_t options, UErrorCode *pErrorCode) ; ucasemap_open(const char *locale, uint32_t options, UErrorCode *pErrorCode) ;
/** /**
* Close a UCaseMap service object. * Close a UCaseMap service object.
* @param csm Object to be closed. * @param csm Object to be closed.
* @stable ICU 3.4 * @stable ICU 3.4
*/ */
U_STABLE void U_EXPORT2 U_STABLE void U_EXPORT2
ucasemap_close(UCaseMap *csm); ucasemap_close(UCaseMap *csm);
#ifdef XP_CPLUSPLUS #if U_SHOW_CPLUSPLUS_API
U_NAMESPACE_BEGIN U_NAMESPACE_BEGIN
/** /**
* \class LocalUCaseMapPointer * \class LocalUCaseMapPointer
* "Smart pointer" class, closes a UCaseMap via ucasemap_close(). * "Smart pointer" class, closes a UCaseMap via ucasemap_close().
* For most methods see the LocalPointerBase base class. * For most methods see the LocalPointerBase base class.
* *
* @see LocalPointerBase * @see LocalPointerBase
* @see LocalPointer * @see LocalPointer
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 uchar.h   uchar.h 
/* /*
********************************************************************** **********************************************************************
* Copyright (C) 1997-2009, International Business Machines * Copyright (C) 1997-2010, International Business Machines
* Corporation and others. All Rights Reserved. * Corporation and others. All Rights Reserved.
********************************************************************** **********************************************************************
* *
* File UCHAR.H * File UCHAR.H
* *
* Modification History: * Modification History:
* *
* Date Name Description * Date Name Description
* 04/02/97 aliu Creation. * 04/02/97 aliu Creation.
* 03/29/99 helena Updated for C APIs. * 03/29/99 helena Updated for C APIs.
skipping to change at line 324 skipping to change at line 324
UCHAR_S_TERM=35, UCHAR_S_TERM=35,
/** Binary property Variation_Selector (new in Unicode 4.0.1). /** Binary property Variation_Selector (new in Unicode 4.0.1).
Indicates all those characters that qualify as Variation Selectors. Indicates all those characters that qualify as Variation Selectors.
For details on the behavior of these characters, For details on the behavior of these characters,
see StandardizedVariants.html and 15.6 Variation Selectors. see StandardizedVariants.html and 15.6 Variation Selectors.
@stable ICU 3.0 */ @stable ICU 3.0 */
UCHAR_VARIATION_SELECTOR=36, UCHAR_VARIATION_SELECTOR=36,
/** Binary property NFD_Inert. /** Binary property NFD_Inert.
ICU-specific property for characters that are inert under NFD, ICU-specific property for characters that are inert under NFD,
i.e., they do not interact with adjacent characters. i.e., they do not interact with adjacent characters.
Used for example in normalizing transforms in incremental mode See the documentation for the Normalizer2 class and the
to find the boundary of safely normalizable text despite possible Normalizer2::isInert() method.
text additions.
There is one such property per normalization form.
These properties are computed as follows - an inert character is:
a) unassigned, or ALL of the following:
b) of combining class 0.
c) not decomposed by this normalization form.
AND if NFC or NFKC,
d) can never compose with a previous character.
e) can never compose with a following character.
f) can never change if another character is added.
Example: a-breve might satisfy all but f, but if you
add an ogonek it changes to a-ogonek + breve
See also com.ibm.text.UCD.NFSkippable in the ICU4J repository,
and icu/source/common/unormimp.h .
@stable ICU 3.0 */ @stable ICU 3.0 */
UCHAR_NFD_INERT=37, UCHAR_NFD_INERT=37,
/** Binary property NFKD_Inert. /** Binary property NFKD_Inert.
ICU-specific property for characters that are inert under NFKD, ICU-specific property for characters that are inert under NFKD,
i.e., they do not interact with adjacent characters. i.e., they do not interact with adjacent characters.
Used for example in normalizing transforms in incremental mode See the documentation for the Normalizer2 class and the
to find the boundary of safely normalizable text despite possible Normalizer2::isInert() method.
text additions.
@see UCHAR_NFD_INERT
@stable ICU 3.0 */ @stable ICU 3.0 */
UCHAR_NFKD_INERT=38, UCHAR_NFKD_INERT=38,
/** Binary property NFC_Inert. /** Binary property NFC_Inert.
ICU-specific property for characters that are inert under NFC, ICU-specific property for characters that are inert under NFC,
i.e., they do not interact with adjacent characters. i.e., they do not interact with adjacent characters.
Used for example in normalizing transforms in incremental mode See the documentation for the Normalizer2 class and the
to find the boundary of safely normalizable text despite possible Normalizer2::isInert() method.
text additions.
@see UCHAR_NFD_INERT
@stable ICU 3.0 */ @stable ICU 3.0 */
UCHAR_NFC_INERT=39, UCHAR_NFC_INERT=39,
/** Binary property NFKC_Inert. /** Binary property NFKC_Inert.
ICU-specific property for characters that are inert under NFKC, ICU-specific property for characters that are inert under NFKC,
i.e., they do not interact with adjacent characters. i.e., they do not interact with adjacent characters.
Used for example in normalizing transforms in incremental mode See the documentation for the Normalizer2 class and the
to find the boundary of safely normalizable text despite possible Normalizer2::isInert() method.
text additions.
@see UCHAR_NFD_INERT
@stable ICU 3.0 */ @stable ICU 3.0 */
UCHAR_NFKC_INERT=40, UCHAR_NFKC_INERT=40,
/** Binary Property Segment_Starter. /** Binary Property Segment_Starter.
ICU-specific property for characters that are starters in terms of ICU-specific property for characters that are starters in terms of
Unicode normalization and combining character sequences. Unicode normalization and combining character sequences.
They have ccc=0 and do not occur in non-initial position of the They have ccc=0 and do not occur in non-initial position of the
canonical decomposition of any character canonical decomposition of any character
(like " in NFD(a-umlaut) and a Jamo T in an NFD(Hangul LVT)). (like a-umlaut in NFD and a Jamo T in an NFD(Hangul LVT)).
ICU uses this property for segmenting a string for generating a set of ICU uses this property for segmenting a string for generating a set of
canonically equivalent strings, e.g. for canonical closure while canonically equivalent strings, e.g. for canonical closure while
processing collation tailoring rules. processing collation tailoring rules.
@stable ICU 3.0 */ @stable ICU 3.0 */
UCHAR_SEGMENT_STARTER=41, UCHAR_SEGMENT_STARTER=41,
/** Binary property Pattern_Syntax (new in Unicode 4.1). /** Binary property Pattern_Syntax (new in Unicode 4.1).
See UAX #31 Identifier and Pattern Syntax See UAX #31 Identifier and Pattern Syntax
(http://www.unicode.org/reports/tr31/) (http://www.unicode.org/reports/tr31/)
@stable ICU 3.4 */ @stable ICU 3.4 */
UCHAR_PATTERN_SYNTAX=42, UCHAR_PATTERN_SYNTAX=42,
skipping to change at line 431 skipping to change at line 409
/** Binary property Changes_When_Lowercased. @draft ICU 4.4 */ /** Binary property Changes_When_Lowercased. @draft ICU 4.4 */
UCHAR_CHANGES_WHEN_LOWERCASED=51, UCHAR_CHANGES_WHEN_LOWERCASED=51,
/** Binary property Changes_When_Uppercased. @draft ICU 4.4 */ /** Binary property Changes_When_Uppercased. @draft ICU 4.4 */
UCHAR_CHANGES_WHEN_UPPERCASED=52, UCHAR_CHANGES_WHEN_UPPERCASED=52,
/** Binary property Changes_When_Titlecased. @draft ICU 4.4 */ /** Binary property Changes_When_Titlecased. @draft ICU 4.4 */
UCHAR_CHANGES_WHEN_TITLECASED=53, UCHAR_CHANGES_WHEN_TITLECASED=53,
/** Binary property Changes_When_Casefolded. @draft ICU 4.4 */ /** Binary property Changes_When_Casefolded. @draft ICU 4.4 */
UCHAR_CHANGES_WHEN_CASEFOLDED=54, UCHAR_CHANGES_WHEN_CASEFOLDED=54,
/** Binary property Changes_When_Casemapped. @draft ICU 4.4 */ /** Binary property Changes_When_Casemapped. @draft ICU 4.4 */
UCHAR_CHANGES_WHEN_CASEMAPPED=55, UCHAR_CHANGES_WHEN_CASEMAPPED=55,
/** Binary property Changes_When_NFKC_Casefolded. @draft ICU 4.4 */
UCHAR_CHANGES_WHEN_NFKC_CASEFOLDED=56,
/** One more than the last constant for binary Unicode properties. @sta ble ICU 2.1 */ /** One more than the last constant for binary Unicode properties. @sta ble ICU 2.1 */
UCHAR_BINARY_LIMIT=56, UCHAR_BINARY_LIMIT=57,
/** Enumerated property Bidi_Class. /** Enumerated property Bidi_Class.
Same as u_charDirection, returns UCharDirection values. @stable ICU 2.2 */ Same as u_charDirection, returns UCharDirection values. @stable ICU 2.2 */
UCHAR_BIDI_CLASS=0x1000, UCHAR_BIDI_CLASS=0x1000,
/** First constant for enumerated/integer Unicode properties. @stable I CU 2.2 */ /** First constant for enumerated/integer Unicode properties. @stable I CU 2.2 */
UCHAR_INT_START=UCHAR_BIDI_CLASS, UCHAR_INT_START=UCHAR_BIDI_CLASS,
/** Enumerated property Block. /** Enumerated property Block.
Same as ublock_getCode, returns UBlockCode values. @stable ICU 2.2 */ Same as ublock_getCode, returns UBlockCode values. @stable ICU 2.2 */
UCHAR_BLOCK=0x1001, UCHAR_BLOCK=0x1001,
/** Enumerated property Canonical_Combining_Class. /** Enumerated property Canonical_Combining_Class.
 End of changes. 8 change blocks. 
33 lines changed or deleted 13 lines changed or added


 ucnv.h   ucnv.h 
skipping to change at line 525 skipping to change at line 525
* *
* @param converter the converter object to be deleted * @param converter the converter object to be deleted
* @see ucnv_open * @see ucnv_open
* @see ucnv_openU * @see ucnv_openU
* @see ucnv_openCCSID * @see ucnv_openCCSID
* @stable ICU 2.0 * @stable ICU 2.0
*/ */
U_STABLE void U_EXPORT2 U_STABLE void U_EXPORT2
ucnv_close(UConverter * converter); ucnv_close(UConverter * converter);
#ifdef XP_CPLUSPLUS #if U_SHOW_CPLUSPLUS_API
U_NAMESPACE_BEGIN U_NAMESPACE_BEGIN
/** /**
* \class LocalUConverterPointer * \class LocalUConverterPointer
* "Smart pointer" class, closes a UConverter via ucnv_close(). * "Smart pointer" class, closes a UConverter via ucnv_close().
* For most methods see the LocalPointerBase base class. * For most methods see the LocalPointerBase base class.
* *
* @see LocalPointerBase * @see LocalPointerBase
* @see LocalPointer * @see LocalPointer
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 ucnvsel.h   ucnvsel.h 
/* /*
*************************************************************************** **** *************************************************************************** ****
* *
* Copyright (C) 2008-2009, International Business Machines * Copyright (C) 2008-2010, International Business Machines
* Corporation, Google and others. All Rights Reserved. * Corporation, Google and others. All Rights Reserved.
* *
*************************************************************************** **** *************************************************************************** ****
*/ */
/* /*
* Author : eldawy@google.com (Mohamed Eldawy) * Author : eldawy@google.com (Mohamed Eldawy)
* ucnvsel.h * ucnvsel.h
* *
* Purpose: To generate a list of encodings capable of handling * Purpose: To generate a list of encodings capable of handling
* a given Unicode text * a given Unicode text
skipping to change at line 68 skipping to change at line 68
* If 0, builds a selector for all available conve rters. * If 0, builds a selector for all available conve rters.
* @param excludedCodePoints a set of code points to be excluded from consi deration. * @param excludedCodePoints a set of code points to be excluded from consi deration.
* That is, excluded code points in a string do n ot change * That is, excluded code points in a string do n ot change
* the selection result. (They might be handled b y a callback.) * the selection result. (They might be handled b y a callback.)
* Use NULL to exclude nothing. * Use NULL to exclude nothing.
* @param whichSet what converter set to use? Use this to determine whether * @param whichSet what converter set to use? Use this to determine whether
* to consider only roundtrip mappings or also fallbacks. * to consider only roundtrip mappings or also fallbacks.
* @param status an in/out ICU UErrorCode * @param status an in/out ICU UErrorCode
* @return the new selector * @return the new selector
* *
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
U_CAPI UConverterSelector* U_EXPORT2 U_STABLE UConverterSelector* U_EXPORT2
ucnvsel_open(const char* const* converterList, int32_t converterListSize, ucnvsel_open(const char* const* converterList, int32_t converterListSize,
const USet* excludedCodePoints, const USet* excludedCodePoints,
const UConverterUnicodeSet whichSet, UErrorCode* status); const UConverterUnicodeSet whichSet, UErrorCode* status);
/** /**
* Closes a selector. * Closes a selector.
* If any Enumerations were returned by ucnv_select*, they become invalid. * If any Enumerations were returned by ucnv_select*, they become invalid.
* They can be closed before or after calling ucnv_closeSelector, * They can be closed before or after calling ucnv_closeSelector,
* but should never be used after the selector is closed. * but should never be used after the selector is closed.
* *
* @see ucnv_selectForString * @see ucnv_selectForString
* @see ucnv_selectForUTF8 * @see ucnv_selectForUTF8
* *
* @param sel selector to close * @param sel selector to close
* *
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
U_CAPI void U_EXPORT2 U_STABLE void U_EXPORT2
ucnvsel_close(UConverterSelector *sel); ucnvsel_close(UConverterSelector *sel);
#ifdef XP_CPLUSPLUS #if U_SHOW_CPLUSPLUS_API
U_NAMESPACE_BEGIN U_NAMESPACE_BEGIN
/** /**
* \class LocalUConverterSelectorPointer * \class LocalUConverterSelectorPointer
* "Smart pointer" class, closes a UConverterSelector via ucnvsel_close(). * "Smart pointer" class, closes a UConverterSelector via ucnvsel_close().
* For most methods see the LocalPointerBase base class. * For most methods see the LocalPointerBase base class.
* *
* @see LocalPointerBase * @see LocalPointerBase
* @see LocalPointer * @see LocalPointer
skipping to change at line 123 skipping to change at line 123
* This is much faster than creating a selector from scratch. * This is much faster than creating a selector from scratch.
* Using a serialized form from a different machine (endianness/charset) is supported. * Using a serialized form from a different machine (endianness/charset) is supported.
* *
* @param buffer pointer to the serialized form of a converter selector; * @param buffer pointer to the serialized form of a converter selector;
* must be 32-bit-aligned * must be 32-bit-aligned
* @param length the capacity of this buffer (can be equal to or larger tha n * @param length the capacity of this buffer (can be equal to or larger tha n
* the actual data length) * the actual data length)
* @param status an in/out ICU UErrorCode * @param status an in/out ICU UErrorCode
* @return the new selector * @return the new selector
* *
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
U_CAPI UConverterSelector* U_EXPORT2 U_STABLE UConverterSelector* U_EXPORT2
ucnvsel_openFromSerialized(const void* buffer, int32_t length, UErrorCode* status); ucnvsel_openFromSerialized(const void* buffer, int32_t length, UErrorCode* status);
/** /**
* Serialize a selector into a linear buffer. * Serialize a selector into a linear buffer.
* The serialized form is portable to different machines. * The serialized form is portable to different machines.
* *
* @param sel selector to consider * @param sel selector to consider
* @param buffer pointer to 32-bit-aligned memory to be filled with the * @param buffer pointer to 32-bit-aligned memory to be filled with the
* serialized form of this converter selector * serialized form of this converter selector
* @param bufferCapacity the capacity of this buffer * @param bufferCapacity the capacity of this buffer
* @param status an in/out ICU UErrorCode * @param status an in/out ICU UErrorCode
* @return the required buffer capacity to hold serialize data (even if the call fails * @return the required buffer capacity to hold serialize data (even if the call fails
* with a U_BUFFER_OVERFLOW_ERROR, it will return the required capa city) * with a U_BUFFER_OVERFLOW_ERROR, it will return the required capa city)
* *
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
U_CAPI int32_t U_EXPORT2 U_STABLE int32_t U_EXPORT2
ucnvsel_serialize(const UConverterSelector* sel, ucnvsel_serialize(const UConverterSelector* sel,
void* buffer, int32_t bufferCapacity, UErrorCode* status) ; void* buffer, int32_t bufferCapacity, UErrorCode* status) ;
/** /**
* Select converters that can map all characters in a UTF-16 string, * Select converters that can map all characters in a UTF-16 string,
* ignoring the excluded code points. * ignoring the excluded code points.
* *
* @param sel a selector * @param sel a selector
* @param s UTF-16 string * @param s UTF-16 string
* @param length length of the string, or -1 if NUL-terminated * @param length length of the string, or -1 if NUL-terminated
* @param status an in/out ICU UErrorCode * @param status an in/out ICU UErrorCode
* @return an enumeration containing encoding names. * @return an enumeration containing encoding names.
* The returned encoding names and their order will be the same as * The returned encoding names and their order will be the same as
* supplied when building the selector. * supplied when building the selector.
* *
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
U_CAPI UEnumeration * U_EXPORT2 U_STABLE UEnumeration * U_EXPORT2
ucnvsel_selectForString(const UConverterSelector* sel, ucnvsel_selectForString(const UConverterSelector* sel,
const UChar *s, int32_t length, UErrorCode *status) ; const UChar *s, int32_t length, UErrorCode *status) ;
/** /**
* Select converters that can map all characters in a UTF-8 string, * Select converters that can map all characters in a UTF-8 string,
* ignoring the excluded code points. * ignoring the excluded code points.
* *
* @param sel a selector * @param sel a selector
* @param s UTF-8 string * @param s UTF-8 string
* @param length length of the string, or -1 if NUL-terminated * @param length length of the string, or -1 if NUL-terminated
* @param status an in/out ICU UErrorCode * @param status an in/out ICU UErrorCode
* @return an enumeration containing encoding names. * @return an enumeration containing encoding names.
* The returned encoding names and their order will be the same as * The returned encoding names and their order will be the same as
* supplied when building the selector. * supplied when building the selector.
* *
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
U_CAPI UEnumeration * U_EXPORT2 U_STABLE UEnumeration * U_EXPORT2
ucnvsel_selectForUTF8(const UConverterSelector* sel, ucnvsel_selectForUTF8(const UConverterSelector* sel,
const char *s, int32_t length, UErrorCode *status); const char *s, int32_t length, UErrorCode *status);
#endif /* __ICU_UCNV_SEL_H__ */ #endif /* __ICU_UCNV_SEL_H__ */
 End of changes. 14 change blocks. 
14 lines changed or deleted 14 lines changed or added


 ucol.h   ucol.h 
/* /*
*************************************************************************** **** *************************************************************************** ****
* Copyright (c) 1996-2009, International Business Machines Corporation and others. * Copyright (c) 1996-2010, International Business Machines Corporation and others.
* All Rights Reserved. * All Rights Reserved.
*************************************************************************** **** *************************************************************************** ****
*/ */
#ifndef UCOL_H #ifndef UCOL_H
#define UCOL_H #define UCOL_H
#include "unicode/utypes.h" #include "unicode/utypes.h"
#if !UCONFIG_NO_COLLATION #if !UCONFIG_NO_COLLATION
skipping to change at line 377 skipping to change at line 377
* be closed. Otherwise, a memory leak will result. * be closed. Otherwise, a memory leak will result.
* @param coll The UCollator to close. * @param coll The UCollator to close.
* @see ucol_open * @see ucol_open
* @see ucol_openRules * @see ucol_openRules
* @see ucol_safeClone * @see ucol_safeClone
* @stable ICU 2.0 * @stable ICU 2.0
*/ */
U_STABLE void U_EXPORT2 U_STABLE void U_EXPORT2
ucol_close(UCollator *coll); ucol_close(UCollator *coll);
#ifdef XP_CPLUSPLUS #if U_SHOW_CPLUSPLUS_API
U_NAMESPACE_BEGIN U_NAMESPACE_BEGIN
/** /**
* \class LocalUCollatorPointer * \class LocalUCollatorPointer
* "Smart pointer" class, closes a UCollator via ucol_close(). * "Smart pointer" class, closes a UCollator via ucol_close().
* For most methods see the LocalPointerBase base class. * For most methods see the LocalPointerBase base class.
* *
* @see LocalPointerBase * @see LocalPointerBase
* @see LocalPointer * @see LocalPointer
skipping to change at line 613 skipping to change at line 613
* plus input keyword and that value has different behavior than creation w ith the * plus input keyword and that value has different behavior than creation w ith the
* input locale alone. * input locale alone.
* @param key one of the keys supported by this service. For now , only * @param key one of the keys supported by this service. For now , only
* "collation" is supported. * "collation" is supported.
* @param locale the locale * @param locale the locale
* @param commonlyUsed if set to true it will return only commonly used va lues * @param commonlyUsed if set to true it will return only commonly used va lues
* with the given locale in preferred order. Otherwis e, * with the given locale in preferred order. Otherwis e,
* it will return all the available values for the loc ale. * it will return all the available values for the loc ale.
* @param status error status * @param status error status
* @return a string enumeration over keyword values for the given key and t he locale. * @return a string enumeration over keyword values for the given key and t he locale.
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
U_DRAFT UEnumeration* U_EXPORT2 U_STABLE UEnumeration* U_EXPORT2
ucol_getKeywordValuesForLocale(const char* key, ucol_getKeywordValuesForLocale(const char* key,
const char* locale, const char* locale,
UBool commonlyUsed, UBool commonlyUsed,
UErrorCode* status); UErrorCode* status);
/** /**
* Return the functionally equivalent locale for the given * Return the functionally equivalent locale for the given
* requested locale, with respect to given keyword, for the * requested locale, with respect to given keyword, for the
* collation service. If two locales return the same result, then * collation service. If two locales return the same result, then
* collators instantiated for these locales will behave * collators instantiated for these locales will behave
 End of changes. 4 change blocks. 
4 lines changed or deleted 4 lines changed or added


 ucsdet.h   ucsdet.h 
skipping to change at line 86 skipping to change at line 86
* owned by this charset detector will be released. Failure to * owned by this charset detector will be released. Failure to
* close a charset detector when finished with it can result in * close a charset detector when finished with it can result in
* memory leaks in the application. * memory leaks in the application.
* *
* @param ucsd The charset detector to be closed. * @param ucsd The charset detector to be closed.
* @stable ICU 3.6 * @stable ICU 3.6
*/ */
U_STABLE void U_EXPORT2 U_STABLE void U_EXPORT2
ucsdet_close(UCharsetDetector *ucsd); ucsdet_close(UCharsetDetector *ucsd);
#ifdef XP_CPLUSPLUS #if U_SHOW_CPLUSPLUS_API
U_NAMESPACE_BEGIN U_NAMESPACE_BEGIN
/** /**
* \class LocalUCharsetDetectorPointer * \class LocalUCharsetDetectorPointer
* "Smart pointer" class, closes a UCharsetDetector via ucsdet_close(). * "Smart pointer" class, closes a UCharsetDetector via ucsdet_close().
* For most methods see the LocalPointerBase base class. * For most methods see the LocalPointerBase base class.
* *
* @see LocalPointerBase * @see LocalPointerBase
* @see LocalPointer * @see LocalPointer
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 ucurr.h   ucurr.h 
/* /*
********************************************************************** **********************************************************************
* Copyright (c) 2002-2009, International Business Machines * Copyright (c) 2002-2010, International Business Machines
* Corporation and others. All Rights Reserved. * Corporation and others. All Rights Reserved.
********************************************************************** **********************************************************************
*/ */
#ifndef _UCURR_H_ #ifndef _UCURR_H_
#define _UCURR_H_ #define _UCURR_H_
#include "unicode/utypes.h" #include "unicode/utypes.h"
#include "unicode/uenum.h" #include "unicode/uenum.h"
/** /**
skipping to change at line 155 skipping to change at line 155
* @param currency null-terminated 3-letter ISO 4217 code * @param currency null-terminated 3-letter ISO 4217 code
* @param locale locale in which to display currency * @param locale locale in which to display currency
* @param isChoiceFormat fill-in set to TRUE if the returned value * @param isChoiceFormat fill-in set to TRUE if the returned value
* is a ChoiceFormat pattern; otherwise it is a static string * is a ChoiceFormat pattern; otherwise it is a static string
* @param pluralCount plural count * @param pluralCount plural count
* @param len fill-in parameter to receive length of result * @param len fill-in parameter to receive length of result
* @param ec error code * @param ec error code
* @return pointer to display string of 'len' UChars. If the resource * @return pointer to display string of 'len' UChars. If the resource
* data contains no entry for 'currency', then 'currency' itself is * data contains no entry for 'currency', then 'currency' itself is
* returned. * returned.
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
U_STABLE const UChar* U_EXPORT2 U_STABLE const UChar* U_EXPORT2
ucurr_getPluralName(const UChar* currency, ucurr_getPluralName(const UChar* currency,
const char* locale, const char* locale,
UBool* isChoiceFormat, UBool* isChoiceFormat,
const char* pluralCount, const char* pluralCount,
int32_t* len, int32_t* len,
UErrorCode* ec); UErrorCode* ec);
/** /**
skipping to change at line 260 skipping to change at line 260
* currency count. * currency count.
* @param date the date for which to retrieve the * @param date the date for which to retrieve the
* currency count for the given locale. * currency count for the given locale.
* @param ec error code * @param ec error code
* @return the number of currency codes for the * @return the number of currency codes for the
* given locale and date. If 0, currency * given locale and date. If 0, currency
* codes couldn't be found for the input * codes couldn't be found for the input
* values are invalid. * values are invalid.
* @stable ICU 4.0 * @stable ICU 4.0
*/ */
U_DRAFT int32_t U_EXPORT2 U_STABLE int32_t U_EXPORT2
ucurr_countCurrencies(const char* locale, ucurr_countCurrencies(const char* locale,
UDate date, UDate date,
UErrorCode* ec); UErrorCode* ec);
/** /**
* Finds a currency code for the given locale and date * Finds a currency code for the given locale and date
* @param locale the locale for which to retrieve a currency code. * @param locale the locale for which to retrieve a currency code.
* Currency can be specified by the "currency" keyword * Currency can be specified by the "currency" keyword
* in which case it overrides the default currency code * in which case it overrides the default currency code
* @param date the date for which to retrieve a currency code for * @param date the date for which to retrieve a currency code for
skipping to change at line 284 skipping to change at line 284
* @param buff fill in buffer. Can be NULL for preflighting. * @param buff fill in buffer. Can be NULL for preflighting.
* @param buffCapacity capacity of the fill in buffer. Can be 0 for * @param buffCapacity capacity of the fill in buffer. Can be 0 for
* preflighting. If it is non-zero, the buff parameter * preflighting. If it is non-zero, the buff parameter
* must not be NULL. * must not be NULL.
* @param ec error code * @param ec error code
* @return length of the currency string. It should always be 3. * @return length of the currency string. It should always be 3.
* If 0, currency couldn't be found or the input values are * If 0, currency couldn't be found or the input values are
* invalid. * invalid.
* @stable ICU 4.0 * @stable ICU 4.0
*/ */
U_DRAFT int32_t U_EXPORT2 U_STABLE int32_t U_EXPORT2
ucurr_forLocaleAndDate(const char* locale, ucurr_forLocaleAndDate(const char* locale,
UDate date, UDate date,
int32_t index, int32_t index,
UChar* buff, UChar* buff,
int32_t buffCapacity, int32_t buffCapacity,
UErrorCode* ec); UErrorCode* ec);
/** /**
* Given a key and a locale, returns an array of string values in a preferr ed * Given a key and a locale, returns an array of string values in a preferr ed
* order that would make a difference. These are all and only those values where * order that would make a difference. These are all and only those values where
skipping to change at line 306 skipping to change at line 306
* plus input keyword and that value has different behavior than creation w ith the * plus input keyword and that value has different behavior than creation w ith the
* input locale alone. * input locale alone.
* @param key one of the keys supported by this service. For now , only * @param key one of the keys supported by this service. For now , only
* "currency" is supported. * "currency" is supported.
* @param locale the locale * @param locale the locale
* @param commonlyUsed if set to true it will return only commonly used va lues * @param commonlyUsed if set to true it will return only commonly used va lues
* with the given locale in preferred order. Otherwis e, * with the given locale in preferred order. Otherwis e,
* it will return all the available values for the loc ale. * it will return all the available values for the loc ale.
* @param status error status * @param status error status
* @return a string enumeration over keyword values for the given key and t he locale. * @return a string enumeration over keyword values for the given key and t he locale.
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
U_DRAFT UEnumeration* U_EXPORT2 U_STABLE UEnumeration* U_EXPORT2
ucurr_getKeywordValuesForLocale(const char* key, ucurr_getKeywordValuesForLocale(const char* key,
const char* locale, const char* locale,
UBool commonlyUsed, UBool commonlyUsed,
UErrorCode* status); UErrorCode* status);
#endif /* #if !UCONFIG_NO_FORMATTING */ #endif /* #if !UCONFIG_NO_FORMATTING */
#endif #endif
 End of changes. 6 change blocks. 
6 lines changed or deleted 6 lines changed or added


 udat.h   udat.h 
skipping to change at line 444 skipping to change at line 444
UDAT_TIMEZONE_RFC_FIELD = 23, UDAT_TIMEZONE_RFC_FIELD = 23,
/** /**
* FieldPosition and UFieldPosition selector for 'v' field alignment, * FieldPosition and UFieldPosition selector for 'v' field alignment,
* corresponding to the UCAL_ZONE_OFFSET field. * corresponding to the UCAL_ZONE_OFFSET field.
* @stable ICU 3.4 * @stable ICU 3.4
*/ */
UDAT_TIMEZONE_GENERIC_FIELD = 24, UDAT_TIMEZONE_GENERIC_FIELD = 24,
/** /**
* FieldPosition selector for 'c' field alignment, * FieldPosition selector for 'c' field alignment,
* corresponding to the {@link #UCAL_DATE} field. * corresponding to the {@link #UCAL_DOW_LOCAL} field.
* This displays the stand alone day name, if available. * This displays the stand alone day name, if available.
* @stable ICU 3.4 * @stable ICU 3.4
*/ */
UDAT_STANDALONE_DAY_FIELD = 25, UDAT_STANDALONE_DAY_FIELD = 25,
/** /**
* FieldPosition selector for 'L' field alignment, * FieldPosition selector for 'L' field alignment,
* corresponding to the {@link #UCAL_MONTH} field. * corresponding to the {@link #UCAL_MONTH} field.
* This displays the stand alone month name, if available. * This displays the stand alone month name, if available.
* @stable ICU 3.4 * @stable ICU 3.4
skipping to change at line 496 skipping to change at line 496
* Valid selectors range from 0 to UDAT_FIELD_COUNT-1. * Valid selectors range from 0 to UDAT_FIELD_COUNT-1.
* This value is subject to change if new fields are defined * This value is subject to change if new fields are defined
* in the future. * in the future.
* @stable ICU 3.0 * @stable ICU 3.0
*/ */
UDAT_FIELD_COUNT = 30 UDAT_FIELD_COUNT = 30
} UDateFormatField; } UDateFormatField;
/** /**
* Maps from a UDateFormatField to the corresponding UCalendarDateFields.
* Note: since the mapping is many-to-one, there is no inverse mapping.
* @param field the UDateFormatField.
* @return the UCalendarDateField. This will be UCAL_FIELD_COUNT in case
* of error (e.g., the input field is UDAT_FIELD_COUNT).
* @draft ICU 4.4
*/
U_DRAFT UCalendarDateFields U_EXPORT2
udat_toCalendarDateField(UDateFormatField field);
/**
* Open a new UDateFormat for formatting and parsing dates and times. * Open a new UDateFormat for formatting and parsing dates and times.
* A UDateFormat may be used to format dates in calls to {@link #udat_forma t }, * A UDateFormat may be used to format dates in calls to {@link #udat_forma t },
* and to parse dates in calls to {@link #udat_parse }. * and to parse dates in calls to {@link #udat_parse }.
* @param timeStyle The style used to format times; one of UDAT_FULL, UDAT_ LONG, * @param timeStyle The style used to format times; one of UDAT_FULL, UDAT_ LONG,
* UDAT_MEDIUM, UDAT_SHORT, UDAT_DEFAULT, or UDAT_NONE (relative time style s * UDAT_MEDIUM, UDAT_SHORT, UDAT_DEFAULT, or UDAT_NONE (relative time style s
* are not currently supported) * are not currently supported)
* @param dateStyle The style used to format dates; one of UDAT_FULL, UDAT_ LONG, * @param dateStyle The style used to format dates; one of UDAT_FULL, UDAT_ LONG,
* UDAT_MEDIUM, UDAT_SHORT, UDAT_DEFAULT, UDAT_FULL_RELATIVE, UDAT_LONG_REL ATIVE, * UDAT_MEDIUM, UDAT_SHORT, UDAT_DEFAULT, UDAT_FULL_RELATIVE, UDAT_LONG_REL ATIVE,
* UDAT_MEDIUM_RELATIVE, UDAT_SHORT_RELATIVE, or UDAT_NONE * UDAT_MEDIUM_RELATIVE, UDAT_SHORT_RELATIVE, or UDAT_NONE
* @param locale The locale specifying the formatting conventions * @param locale The locale specifying the formatting conventions
skipping to change at line 535 skipping to change at line 546
/** /**
* Close a UDateFormat. * Close a UDateFormat.
* Once closed, a UDateFormat may no longer be used. * Once closed, a UDateFormat may no longer be used.
* @param format The formatter to close. * @param format The formatter to close.
* @stable ICU 2.0 * @stable ICU 2.0
*/ */
U_STABLE void U_EXPORT2 U_STABLE void U_EXPORT2
udat_close(UDateFormat* format); udat_close(UDateFormat* format);
#ifdef XP_CPLUSPLUS #if U_SHOW_CPLUSPLUS_API
U_NAMESPACE_BEGIN U_NAMESPACE_BEGIN
/** /**
* \class LocalUDateFormatPointer * \class LocalUDateFormatPointer
* "Smart pointer" class, closes a UDateFormat via udat_close(). * "Smart pointer" class, closes a UDateFormat via udat_close().
* For most methods see the LocalPointerBase base class. * For most methods see the LocalPointerBase base class.
* *
* @see LocalPointerBase * @see LocalPointerBase
* @see LocalPointer * @see LocalPointer
 End of changes. 3 change blocks. 
2 lines changed or deleted 13 lines changed or added


 udata.h   udata.h 
/* /*
*************************************************************************** *** *************************************************************************** ***
* *
* Copyright (C) 1999-2009, International Business Machines * Copyright (C) 1999-2010, International Business Machines
* Corporation and others. All Rights Reserved. * Corporation and others. All Rights Reserved.
* *
*************************************************************************** *** *************************************************************************** ***
* file name: udata.h * file name: udata.h
* encoding: US-ASCII * encoding: US-ASCII
* tab size: 8 (not used) * tab size: 8 (not used)
* indentation:4 * indentation:4
* *
* created on: 1999oct25 * created on: 1999oct25
* created by: Markus W. Scherer * created by: Markus W. Scherer
skipping to change at line 259 skipping to change at line 259
/** /**
* Close the data memory. * Close the data memory.
* This function must be called to allow the system to * This function must be called to allow the system to
* release resources associated with this data memory. * release resources associated with this data memory.
* @param pData The pointer to data memory object * @param pData The pointer to data memory object
* @stable ICU 2.0 * @stable ICU 2.0
*/ */
U_STABLE void U_EXPORT2 U_STABLE void U_EXPORT2
udata_close(UDataMemory *pData); udata_close(UDataMemory *pData);
#ifdef XP_CPLUSPLUS #if U_SHOW_CPLUSPLUS_API
U_NAMESPACE_BEGIN U_NAMESPACE_BEGIN
/** /**
* \class LocalUDataMemoryPointer * \class LocalUDataMemoryPointer
* "Smart pointer" class, closes a UDataMemory via udata_close(). * "Smart pointer" class, closes a UDataMemory via udata_close().
* For most methods see the LocalPointerBase base class. * For most methods see the LocalPointerBase base class.
* *
* @see LocalPointerBase * @see LocalPointerBase
* @see LocalPointer * @see LocalPointer
skipping to change at line 320 skipping to change at line 320
* allows you to force ICU's system data to come out of a user-specified * allows you to force ICU's system data to come out of a user-specified
* area in memory. * area in memory.
* *
* The format of this data is that of the icu common data file, as is * The format of this data is that of the icu common data file, as is
* generated by the pkgdata tool with mode=common or mode=dll. * generated by the pkgdata tool with mode=common or mode=dll.
* You can read in a whole common mode file and pass the address to the sta rt of the * You can read in a whole common mode file and pass the address to the sta rt of the
* data, or (with the appropriate link options) pass in the pointer to * data, or (with the appropriate link options) pass in the pointer to
* the data that has been loaded from a dll by the operating system, * the data that has been loaded from a dll by the operating system,
* as shown in this code: * as shown in this code:
* *
* extern const char U_IMPORT U_ICUDATA_ENTRY_POINT []; * extern const char U_IMPORT U_ICUDATA_ENTRY_POINT [];
* // U_ICUDATA_ENTRY_POINT is same as entry point specified to pkgd ata tool * // U_ICUDATA_ENTRY_POINT is same as entry point specified to pkgd ata tool
* UErrorCode status = U_ZERO_ERROR; * UErrorCode status = U_ZERO_ERROR;
* *
* udata_setCommonData(&U_ICUDATA_ENTRY_POINT, &status); * udata_setCommonData(&U_ICUDATA_ENTRY_POINT, &status);
* *
* Warning: ICU must NOT have even attempted to access its data yet * It is important that the declaration be as above. The entry point
* when this call is made, or U_USING_DEFAULT_WARNING code will
* be returned. Be careful of UnicodeStrings in static initialization which
* may attempt to load a converter (use the UNICODE_STRING(x) macro instead
).
*
* Also note that it is important that the declaration be as above. The ent
ry point
* must not be declared as an extern void*. * must not be declared as an extern void*.
* *
* Starting with ICU 4.4, it is possible to set several data packages,
* one per call to this function.
* udata_open() will look for data in the multiple data packages in the ord
er
* in which they were set.
* The position of the linked-in or default-name ICU .data package in the
* search list depends on when the first data item is loaded that is not co
ntained
* in the already explicitly set packages.
* If data was loaded implicitly before the first call to this function
* (for example, via opening a converter, constructing a UnicodeString
* from default-codepage data, using formatting or collation APIs, etc.),
* then the default data will be first in the list.
*
* This function has no effect on application (non ICU) data. See udata_se tAppData() * This function has no effect on application (non ICU) data. See udata_se tAppData()
* for similar functionality for application data. * for similar functionality for application data.
* *
* @param data pointer to ICU common data * @param data pointer to ICU common data
* @param err outgoing error status <code>U_USING_DEFAULT_WARNING, U_UNSUPP ORTED_ERROR</code> * @param err outgoing error status <code>U_USING_DEFAULT_WARNING, U_UNSUPP ORTED_ERROR</code>
* @stable ICU 2.0 * @stable ICU 2.0
*/ */
U_STABLE void U_EXPORT2 U_STABLE void U_EXPORT2
udata_setCommonData(const void *data, UErrorCode *err); udata_setCommonData(const void *data, UErrorCode *err);
/** /**
* This function bypasses the normal ICU data loading process for applicati on-specific * This function bypasses the normal ICU data loading process for applicati on-specific
* data and allows you to force the it to come out of a user-specified * data and allows you to force the it to come out of a user-specified
* pointer. * pointer.
* *
* The format of this data is that of the icu common data file, like 'icudt 26l.dat' * The format of this data is that of the icu common data file, like 'icudt 26l.dat'
* or the corresponding shared library (DLL) file. * or the corresponding shared library (DLL) file.
 End of changes. 6 change blocks. 
12 lines changed or deleted 18 lines changed or added


 udatpg.h   udatpg.h 
skipping to change at line 91 skipping to change at line 91
UDATPG_SECOND_FIELD, UDATPG_SECOND_FIELD,
/** @stable ICU 3.8 */ /** @stable ICU 3.8 */
UDATPG_FRACTIONAL_SECOND_FIELD, UDATPG_FRACTIONAL_SECOND_FIELD,
/** @stable ICU 3.8 */ /** @stable ICU 3.8 */
UDATPG_ZONE_FIELD, UDATPG_ZONE_FIELD,
/** @stable ICU 3.8 */ /** @stable ICU 3.8 */
UDATPG_FIELD_COUNT UDATPG_FIELD_COUNT
} UDateTimePatternField; } UDateTimePatternField;
/** /**
* Masks to control forcing the length of specified fields in the returned
* pattern to match those in the skeleton (when this would not happen
* otherwise). These may be combined to force the length of multiple fields
.
* Used with udatpg_getBestPatternWithOptions, udatpg_replaceFieldTypesWith
Options.
* @draft ICU 4.4
*/
typedef enum UDateTimePatternMatchOptions {
/** @draft ICU 4.4 */
UDATPG_MATCH_NO_OPTIONS = 0,
/** @draft ICU 4.4 */
UDATPG_MATCH_HOUR_FIELD_LENGTH = 1 << UDATPG_HOUR_FIELD,
/** @draft ICU 4.4 */
UDATPG_MATCH_ALL_FIELDS_LENGTH = (1 << UDATPG_FIELD_COUNT) - 1
} UDateTimePatternMatchOptions;
/**
* Status return values from udatpg_addPattern(). * Status return values from udatpg_addPattern().
* @stable ICU 3.8 * @stable ICU 3.8
*/ */
typedef enum UDateTimePatternConflict { typedef enum UDateTimePatternConflict {
/** @stable ICU 3.8 */ /** @stable ICU 3.8 */
UDATPG_NO_CONFLICT, UDATPG_NO_CONFLICT,
/** @stable ICU 3.8 */ /** @stable ICU 3.8 */
UDATPG_BASE_CONFLICT, UDATPG_BASE_CONFLICT,
/** @stable ICU 3.8 */ /** @stable ICU 3.8 */
UDATPG_CONFLICT, UDATPG_CONFLICT,
skipping to change at line 134 skipping to change at line 150
udatpg_openEmpty(UErrorCode *pErrorCode); udatpg_openEmpty(UErrorCode *pErrorCode);
/** /**
* Close a generator. * Close a generator.
* @param dtpg a pointer to UDateTimePatternGenerator. * @param dtpg a pointer to UDateTimePatternGenerator.
* @stable ICU 3.8 * @stable ICU 3.8
*/ */
U_DRAFT void U_EXPORT2 U_DRAFT void U_EXPORT2
udatpg_close(UDateTimePatternGenerator *dtpg); udatpg_close(UDateTimePatternGenerator *dtpg);
#ifdef XP_CPLUSPLUS #if U_SHOW_CPLUSPLUS_API
U_NAMESPACE_BEGIN U_NAMESPACE_BEGIN
/** /**
* \class LocalUDateTimePatternGeneratorPointer * \class LocalUDateTimePatternGeneratorPointer
* "Smart pointer" class, closes a UDateTimePatternGenerator via udatpg_clo se(). * "Smart pointer" class, closes a UDateTimePatternGenerator via udatpg_clo se().
* For most methods see the LocalPointerBase base class. * For most methods see the LocalPointerBase base class.
* *
* @see LocalPointerBase * @see LocalPointerBase
* @see LocalPointer * @see LocalPointer
skipping to change at line 194 skipping to change at line 210
* @return the length of bestPattern. * @return the length of bestPattern.
* @stable ICU 3.8 * @stable ICU 3.8
*/ */
U_DRAFT int32_t U_EXPORT2 U_DRAFT int32_t U_EXPORT2
udatpg_getBestPattern(UDateTimePatternGenerator *dtpg, udatpg_getBestPattern(UDateTimePatternGenerator *dtpg,
const UChar *skeleton, int32_t length, const UChar *skeleton, int32_t length,
UChar *bestPattern, int32_t capacity, UChar *bestPattern, int32_t capacity,
UErrorCode *pErrorCode); UErrorCode *pErrorCode);
/** /**
* Get the best pattern matching the input skeleton. It is guaranteed to
* have all of the fields in the skeleton.
*
* Note that this function uses a non-const UDateTimePatternGenerator:
* It uses a stateful pattern parser which is set up for each generator obj
ect,
* rather than creating one for each function call.
* Consecutive calls to this function do not affect each other,
* but this function cannot be used concurrently on a single generator obje
ct.
*
* @param dtpg a pointer to UDateTimePatternGenerator.
* @param skeleton
* The skeleton is a pattern containing only the variable fields
.
* For example, "MMMdd" and "mmhh" are skeletons.
* @param length the length of skeleton
* @param options
* Options for forcing the length of specified fields in the
* returned pattern to match those in the skeleton (when this
* would not happen otherwise). For default behavior, use
* UDATPG_MATCH_NO_OPTIONS.
* @param bestPattern
* The best pattern found from the given skeleton.
* @param capacity
* the capacity of bestPattern.
* @param pErrorCode
* a pointer to the UErrorCode which must not indicate a
* failure before the function call.
* @return the length of bestPattern.
* @draft ICU 4.4
*/
U_DRAFT int32_t U_EXPORT2
udatpg_getBestPatternWithOptions(UDateTimePatternGenerator *dtpg,
const UChar *skeleton, int32_t length,
UDateTimePatternMatchOptions options,
UChar *bestPattern, int32_t capacity,
UErrorCode *pErrorCode);
/**
* Get a unique skeleton from a given pattern. For example, * Get a unique skeleton from a given pattern. For example,
* both "MMM-dd" and "dd/MMM" produce the skeleton "MMMdd". * both "MMM-dd" and "dd/MMM" produce the skeleton "MMMdd".
* *
* Note that this function uses a non-const UDateTimePatternGenerator: * Note that this function uses a non-const UDateTimePatternGenerator:
* It uses a stateful pattern parser which is set up for each generator ob ject, * It uses a stateful pattern parser which is set up for each generator ob ject,
* rather than creating one for each function call. * rather than creating one for each function call.
* Consecutive calls to this function do not affect each other, * Consecutive calls to this function do not affect each other,
* but this function cannot be used concurrently on a single generator obj ect. * but this function cannot be used concurrently on a single generator obj ect.
* *
* @param dtpg a pointer to UDateTimePatternGenerator. * @param dtpg a pointer to UDateTimePatternGenerator.
skipping to change at line 450 skipping to change at line 503
* @stable ICU 3.8 * @stable ICU 3.8
*/ */
U_DRAFT int32_t U_EXPORT2 U_DRAFT int32_t U_EXPORT2
udatpg_replaceFieldTypes(UDateTimePatternGenerator *dtpg, udatpg_replaceFieldTypes(UDateTimePatternGenerator *dtpg,
const UChar *pattern, int32_t patternLength, const UChar *pattern, int32_t patternLength,
const UChar *skeleton, int32_t skeletonLength, const UChar *skeleton, int32_t skeletonLength,
UChar *dest, int32_t destCapacity, UChar *dest, int32_t destCapacity,
UErrorCode *pErrorCode); UErrorCode *pErrorCode);
/** /**
* Adjusts the field types (width and subtype) of a pattern to match what i
s
* in a skeleton. That is, if you supply a pattern like "d-M H:m", and a
* skeleton of "MMMMddhhmm", then the input pattern is adjusted to be
* "dd-MMMM hh:mm". This is used internally to get the best match for the
* input skeleton, but can also be used externally.
*
* Note that this function uses a non-const UDateTimePatternGenerator:
* It uses a stateful pattern parser which is set up for each generator obj
ect,
* rather than creating one for each function call.
* Consecutive calls to this function do not affect each other,
* but this function cannot be used concurrently on a single generator obje
ct.
*
* @param dtpg a pointer to UDateTimePatternGenerator.
* @param pattern Input pattern
* @param patternLength the length of input pattern.
* @param skeleton
* @param skeletonLength the length of input skeleton.
* @param options
* Options controlling whether the length of specified fields in
the
* pattern are adjusted to match those in the skeleton (when thi
s
* would not happen otherwise). For default behavior, use
* UDATPG_MATCH_NO_OPTIONS.
* @param dest pattern adjusted to match the skeleton fields widths and su
btypes.
* @param destCapacity the capacity of dest.
* @param pErrorCode a pointer to the UErrorCode which must not indicate a
* failure before the function call.
* @return the length of dest.
* @draft ICU 4.4
*/
U_DRAFT int32_t U_EXPORT2
udatpg_replaceFieldTypesWithOptions(UDateTimePatternGenerator *dtpg,
const UChar *pattern, int32_t patternLe
ngth,
const UChar *skeleton, int32_t skeleton
Length,
UDateTimePatternMatchOptions options,
UChar *dest, int32_t destCapacity,
UErrorCode *pErrorCode);
/**
* Return a UEnumeration list of all the skeletons in canonical form. * Return a UEnumeration list of all the skeletons in canonical form.
* Call udatpg_getPatternForSkeleton() to get the corresponding pattern. * Call udatpg_getPatternForSkeleton() to get the corresponding pattern.
* *
* @param dtpg a pointer to UDateTimePatternGenerator. * @param dtpg a pointer to UDateTimePatternGenerator.
* @param pErrorCode a pointer to the UErrorCode which must not indicate a * @param pErrorCode a pointer to the UErrorCode which must not indicate a
* failure before the function call * failure before the function call
* @return a UEnumeration list of all the skeletons * @return a UEnumeration list of all the skeletons
* The caller must close the object. * The caller must close the object.
* @stable ICU 3.8 * @stable ICU 3.8
*/ */
 End of changes. 4 change blocks. 
1 lines changed or deleted 105 lines changed or added


 uenum.h   uenum.h 
skipping to change at line 23 skipping to change at line 23
* created on: 2002jul08 * created on: 2002jul08
* created by: Vladimir Weinstein * created by: Vladimir Weinstein
*/ */
#ifndef __UENUM_H #ifndef __UENUM_H
#define __UENUM_H #define __UENUM_H
#include "unicode/utypes.h" #include "unicode/utypes.h"
#include "unicode/localpointer.h" #include "unicode/localpointer.h"
#ifdef XP_CPLUSPLUS #if U_SHOW_CPLUSPLUS_API
#include "unicode/strenum.h" #include "unicode/strenum.h"
#endif #endif
/** /**
* \file * \file
* \brief C API: String Enumeration * \brief C API: String Enumeration
*/ */
/** /**
* An enumeration object. * An enumeration object.
skipping to change at line 51 skipping to change at line 51
/** /**
* Disposes of resources in use by the iterator. If en is NULL, * Disposes of resources in use by the iterator. If en is NULL,
* does nothing. After this call, any char* or UChar* pointer * does nothing. After this call, any char* or UChar* pointer
* returned by uenum_unext() or uenum_next() is invalid. * returned by uenum_unext() or uenum_next() is invalid.
* @param en UEnumeration structure pointer * @param en UEnumeration structure pointer
* @stable ICU 2.2 * @stable ICU 2.2
*/ */
U_STABLE void U_EXPORT2 U_STABLE void U_EXPORT2
uenum_close(UEnumeration* en); uenum_close(UEnumeration* en);
#ifdef XP_CPLUSPLUS #if U_SHOW_CPLUSPLUS_API
U_NAMESPACE_BEGIN U_NAMESPACE_BEGIN
/** /**
* \class LocalUEnumerationPointer * \class LocalUEnumerationPointer
* "Smart pointer" class, closes a UEnumeration via uenum_close(). * "Smart pointer" class, closes a UEnumeration via uenum_close().
* For most methods see the LocalPointerBase base class. * For most methods see the LocalPointerBase base class.
* *
* @see LocalPointerBase * @see LocalPointerBase
* @see LocalPointer * @see LocalPointer
skipping to change at line 158 skipping to change at line 158
* re-establishes sync with the service and rewinds the iterator * re-establishes sync with the service and rewinds the iterator
* to start at the first element. * to start at the first element.
* @param en the iterator object * @param en the iterator object
* @param status the error code, set to U_ENUM_OUT_OF_SYNC_ERROR if * @param status the error code, set to U_ENUM_OUT_OF_SYNC_ERROR if
* the iterator is out of sync with its service. * the iterator is out of sync with its service.
* @stable ICU 2.2 * @stable ICU 2.2
*/ */
U_STABLE void U_EXPORT2 U_STABLE void U_EXPORT2
uenum_reset(UEnumeration* en, UErrorCode* status); uenum_reset(UEnumeration* en, UErrorCode* status);
#ifdef XP_CPLUSPLUS #if U_SHOW_CPLUSPLUS_API
/** /**
* Given a StringEnumeration, wrap it in a UEnumeration. The * Given a StringEnumeration, wrap it in a UEnumeration. The
* StringEnumeration is adopted; after this call, the caller must not * StringEnumeration is adopted; after this call, the caller must not
* delete it (regardless of error status). * delete it (regardless of error status).
* @param adopted the C++ StringEnumeration to be wrapped in a UEnumeration . * @param adopted the C++ StringEnumeration to be wrapped in a UEnumeration .
* @param ec the error code. * @param ec the error code.
* @return a UEnumeration wrapping the adopted StringEnumeration. * @return a UEnumeration wrapping the adopted StringEnumeration.
* @draft ICU 4.2 * @draft ICU 4.2
*/ */
 End of changes. 3 change blocks. 
3 lines changed or deleted 3 lines changed or added


 uidna.h   uidna.h 
/* /*
************************************************************************** ***** ************************************************************************** *****
* *
* Copyright (C) 2003-2007, International Business Machines * Copyright (C) 2003-2010, International Business Machines
* Corporation and others. All Rights Reserved. * Corporation and others. All Rights Reserved.
* *
************************************************************************** ***** ************************************************************************** *****
* file name: uidna.h * file name: uidna.h
* encoding: US-ASCII * encoding: US-ASCII
* tab size: 8 (not used) * tab size: 8 (not used)
* indentation:4 * indentation:4
* *
* created on: 2003feb1 * created on: 2003feb1
* created by: Ram Viswanadha * created by: Ram Viswanadha
skipping to change at line 79 skipping to change at line 79
* *
* @see uidna_toASCII uidna_toUnicode * @see uidna_toASCII uidna_toUnicode
* @stable ICU 2.6 * @stable ICU 2.6
*/ */
#define UIDNA_USE_STD3_RULES 0x0002 #define UIDNA_USE_STD3_RULES 0x0002
/** /**
* This function implements the ToASCII operation as defined in the IDNA RF C. * This function implements the ToASCII operation as defined in the IDNA RF C.
* This operation is done on <b>single labels</b> before sending it to some thing that expects * This operation is done on <b>single labels</b> before sending it to some thing that expects
* ASCII names. A label is an individual part of a domain name. Labels are usually * 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 * separated by dots; e.g." "www.example.com" is composed of 3 labels "www"
* "www","example", and "com". ,"example", and "com".
* *
* *
* @param src Input UChar array containing label in Unicode. * @param src Input UChar array containing label in Unicode.
* @param srcLength Number of UChars in src, or -1 if NUL-terminate d. * @param srcLength Number of UChars in src, or -1 if NUL-terminate d.
* @param dest Output UChar array with ASCII (ACE encoded) lab el. * @param dest Output UChar array with ASCII (ACE encoded) lab el.
* @param destCapacity Size of dest. * @param destCapacity Size of dest.
* @param options A bit set of options: * @param options A bit set of options:
* *
* - UIDNA_DEFAULT Use default options, i.e., do not process u nassigned code points * - UIDNA_DEFAULT Use default options, i.e., do not process u nassigned code points
* and do not use STD3 ASCII rules * and do not use STD3 ASCII rules
skipping to change at line 125 skipping to change at line 124
uidna_toASCII(const UChar* src, int32_t srcLength, uidna_toASCII(const UChar* src, int32_t srcLength,
UChar* dest, int32_t destCapacity, UChar* dest, int32_t destCapacity,
int32_t options, int32_t options,
UParseError* parseError, UParseError* parseError,
UErrorCode* status); UErrorCode* status);
/** /**
* This function implements the ToUnicode operation as defined in the IDNA RFC. * This function implements the ToUnicode operation as defined in the IDNA RFC.
* This operation is done on <b>single labels</b> before sending it to some thing that expects * This operation is done on <b>single labels</b> before sending it to some thing that expects
* Unicode names. A label is an individual part of a domain name. Labels ar e usually * Unicode names. A label is an individual part of a domain name. Labels ar e usually
* separated by dots; for e.g." "www.example.com" is composed of 3 labels * separated by dots; for e.g." "www.example.com" is composed of 3 labels "
* "www","example", and "com". www","example", and "com".
* *
* @param src Input UChar array containing ASCII (ACE encoded ) label. * @param src Input UChar array containing ASCII (ACE encoded ) label.
* @param srcLength Number of UChars in src, or -1 if NUL-terminate d. * @param srcLength Number of UChars in src, or -1 if NUL-terminate d.
* @param dest Output Converted UChar array containing Unicode equiva lent of label. * @param dest Output Converted UChar array containing Unicode equiva lent of label.
* @param destCapacity Size of dest. * @param destCapacity Size of dest.
* @param options A bit set of options: * @param options A bit set of options:
* *
* - UIDNA_DEFAULT Use default options, i.e., do not process u nassigned code points * - UIDNA_DEFAULT Use default options, i.e., do not process u nassigned code points
* and do not use STD3 ASCII rules * and do not use STD3 ASCII rules
* If unassigned code points are found the ope ration fails with * If unassigned code points are found the ope ration fails with
 End of changes. 3 change blocks. 
5 lines changed or deleted 5 lines changed or added


 uintrnal.h   uintrnal.h 
/* /*
*************************************************************************** **** *************************************************************************** ****
* Copyright (C) 2004-2009, International Business Machines * Copyright (C) 2004-2009, International Business Machines
* Corporation and others. All Rights Reserved. * Corporation and others. All Rights Reserved.
*************************************************************************** **** *************************************************************************** ****
* *
* file name: * file name: uintrnal.h
* encoding: US-ASCII * encoding: US-ASCII
* tab size: 8 (not used) * tab size: 8 (not used)
* indentation:4 * indentation:4
* *
* Created by: genheaders.pl, a perl script written by Ram Viswanadha * Created by: genheaders.pl, a perl script written by Ram Viswanadha
* *
* Contains data for commenting out APIs. * Contains data for commenting out APIs.
* Gets included by umachine.h * Gets included by umachine.h
* *
* THIS FILE IS MACHINE-GENERATED, DON'T PLAY WITH IT IF YOU DON'T KNOW WHA T * THIS FILE IS MACHINE-GENERATED, DON'T PLAY WITH IT IF YOU DON'T KNOW WHA T
* YOU ARE DOING, OTHERWISE VERY BAD THINGS WILL HAPPEN! * YOU ARE DOING, OTHERWISE VERY BAD THINGS WILL HAPPEN!
*/ */
#ifndef UINTRNAL_H #ifndef UINTRNAL_H
#define UINTRNAL_H #define UINTRNAL_H
#ifdef U_HIDE_INTERNAL_API #ifdef U_HIDE_INTERNAL_API
# if U_DISABLE_RENAMING # if U_DISABLE_RENAMING
# define RegexPatternDump RegexPatternDump_INTERNAL_API_DO_NOT_USE # define RegexPatternDump RegexPatternDump_INTERNAL_API_DO_NOT_USE
# define bms.h bms.h_INTERNAL_API_DO_NOT_USE
# define bms_empty bms_empty_INTERNAL_API_DO_NOT_USE # define bms_empty bms_empty_INTERNAL_API_DO_NOT_USE
# define bms_getData bms_getData_INTERNAL_API_DO_NOT_USE # define bms_getData bms_getData_INTERNAL_API_DO_NOT_USE
# define bms_open bms_open_INTERNAL_API_DO_NOT_USE # define bms_open bms_open_INTERNAL_API_DO_NOT_USE
# define bms_search bms_search_INTERNAL_API_DO_NOT_USE # define bms_search bms_search_INTERNAL_API_DO_NOT_USE
# define bms_setTargetString bms_setTargetString_INTERNAL_API_DO_NOT _USE # define bms_setTargetString bms_setTargetString_INTERNAL_API_DO_NOT _USE
# define bmsearch.h bmsearch.h_INTERNAL_API_DO_NOT_USE
# define colldata.h colldata.h_INTERNAL_API_DO_NOT_USE
# define decimfmtAffixPatternValueComparator decimfmtAffixPatternVal ueComparator_INTERNAL_API_DO_NOT_USE # define decimfmtAffixPatternValueComparator decimfmtAffixPatternVal ueComparator_INTERNAL_API_DO_NOT_USE
# define decimfmtAffixValueComparator decimfmtAffixValueComparator_I NTERNAL_API_DO_NOT_USE # define decimfmtAffixValueComparator decimfmtAffixValueComparator_I NTERNAL_API_DO_NOT_USE
# define dtitvinfHashTableValueComparator dtitvinfHashTableValueComp arator_INTERNAL_API_DO_NOT_USE # define dtitvinfHashTableValueComparator dtitvinfHashTableValueComp arator_INTERNAL_API_DO_NOT_USE
# define pl_addFontRun pl_addFontRun_INTERNAL_API_DO_NOT_USE # define pl_addFontRun pl_addFontRun_INTERNAL_API_DO_NOT_USE
# define pl_addLocaleRun pl_addLocaleRun_INTERNAL_API_DO_NOT_USE # define pl_addLocaleRun pl_addLocaleRun_INTERNAL_API_DO_NOT_USE
# define pl_addValueRun pl_addValueRun_INTERNAL_API_DO_NOT_USE # define pl_addValueRun pl_addValueRun_INTERNAL_API_DO_NOT_USE
# define pl_close pl_close_INTERNAL_API_DO_NOT_USE # define pl_close pl_close_INTERNAL_API_DO_NOT_USE
# define pl_closeFontRuns pl_closeFontRuns_INTERNAL_API_DO_NOT_USE # define pl_closeFontRuns pl_closeFontRuns_INTERNAL_API_DO_NOT_USE
# define pl_closeLine pl_closeLine_INTERNAL_API_DO_NOT_USE # define pl_closeLine pl_closeLine_INTERNAL_API_DO_NOT_USE
# define pl_closeLocaleRuns pl_closeLocaleRuns_INTERNAL_API_DO_NOT_U SE # define pl_closeLocaleRuns pl_closeLocaleRuns_INTERNAL_API_DO_NOT_U SE
skipping to change at line 123 skipping to change at line 120
# define ures_openFillIn ures_openFillIn_INTERNAL_API_DO_NOT_USE # define ures_openFillIn ures_openFillIn_INTERNAL_API_DO_NOT_USE
# define usearch_search usearch_search_INTERNAL_API_DO_NOT_USE # define usearch_search usearch_search_INTERNAL_API_DO_NOT_USE
# define usearch_searchBackwards usearch_searchBackwards_INTERNAL_AP I_DO_NOT_USE # define usearch_searchBackwards usearch_searchBackwards_INTERNAL_AP I_DO_NOT_USE
# define utf8_appendCharSafeBody utf8_appendCharSafeBody_INTERNAL_AP I_DO_NOT_USE # define utf8_appendCharSafeBody utf8_appendCharSafeBody_INTERNAL_AP I_DO_NOT_USE
# define utf8_back1SafeBody utf8_back1SafeBody_INTERNAL_API_DO_NOT_U SE # define utf8_back1SafeBody utf8_back1SafeBody_INTERNAL_API_DO_NOT_U SE
# define utf8_countTrailBytes utf8_countTrailBytes_INTERNAL_API_DO_N OT_USE # define utf8_countTrailBytes utf8_countTrailBytes_INTERNAL_API_DO_N OT_USE
# define utf8_nextCharSafeBody utf8_nextCharSafeBody_INTERNAL_API_DO _NOT_USE # define utf8_nextCharSafeBody utf8_nextCharSafeBody_INTERNAL_API_DO _NOT_USE
# define utf8_prevCharSafeBody utf8_prevCharSafeBody_INTERNAL_API_DO _NOT_USE # define utf8_prevCharSafeBody utf8_prevCharSafeBody_INTERNAL_API_DO _NOT_USE
# else # else
# define RegexPatternDump_4_2 RegexPatternDump_INTERNAL_API_DO_NOT_U SE # define RegexPatternDump_4_2 RegexPatternDump_INTERNAL_API_DO_NOT_U SE
# define bms.h_4_2 bms.h_INTERNAL_API_DO_NOT_USE
# define bms_empty_4_2 bms_empty_INTERNAL_API_DO_NOT_USE # define bms_empty_4_2 bms_empty_INTERNAL_API_DO_NOT_USE
# define bms_getData_4_2 bms_getData_INTERNAL_API_DO_NOT_USE # define bms_getData_4_2 bms_getData_INTERNAL_API_DO_NOT_USE
# define bms_open_4_2 bms_open_INTERNAL_API_DO_NOT_USE # define bms_open_4_2 bms_open_INTERNAL_API_DO_NOT_USE
# define bms_search_4_2 bms_search_INTERNAL_API_DO_NOT_USE # define bms_search_4_2 bms_search_INTERNAL_API_DO_NOT_USE
# define bms_setTargetString_4_2 bms_setTargetString_INTERNAL_API_DO _NOT_USE # define bms_setTargetString_4_2 bms_setTargetString_INTERNAL_API_DO _NOT_USE
# define bmsearch.h_4_2 bmsearch.h_INTERNAL_API_DO_NOT_USE
# define colldata.h_4_2 colldata.h_INTERNAL_API_DO_NOT_USE
# define decimfmtAffixPatternValueComparator_4_2 decimfmtAffixPatter nValueComparator_INTERNAL_API_DO_NOT_USE # define decimfmtAffixPatternValueComparator_4_2 decimfmtAffixPatter nValueComparator_INTERNAL_API_DO_NOT_USE
# define decimfmtAffixValueComparator_4_2 decimfmtAffixValueComparat or_INTERNAL_API_DO_NOT_USE # define decimfmtAffixValueComparator_4_2 decimfmtAffixValueComparat or_INTERNAL_API_DO_NOT_USE
# define dtitvinfHashTableValueComparator_4_2 dtitvinfHashTableValue Comparator_INTERNAL_API_DO_NOT_USE # define dtitvinfHashTableValueComparator_4_2 dtitvinfHashTableValue Comparator_INTERNAL_API_DO_NOT_USE
# define pl_addFontRun_4_2 pl_addFontRun_INTERNAL_API_DO_NOT_USE # define pl_addFontRun_4_2 pl_addFontRun_INTERNAL_API_DO_NOT_USE
# define pl_addLocaleRun_4_2 pl_addLocaleRun_INTERNAL_API_DO_NOT_USE # define pl_addLocaleRun_4_2 pl_addLocaleRun_INTERNAL_API_DO_NOT_USE
# define pl_addValueRun_4_2 pl_addValueRun_INTERNAL_API_DO_NOT_USE # define pl_addValueRun_4_2 pl_addValueRun_INTERNAL_API_DO_NOT_USE
# define pl_closeFontRuns_4_2 pl_closeFontRuns_INTERNAL_API_DO_NOT_U SE # define pl_closeFontRuns_4_2 pl_closeFontRuns_INTERNAL_API_DO_NOT_U SE
# define pl_closeLine_4_2 pl_closeLine_INTERNAL_API_DO_NOT_USE # define pl_closeLine_4_2 pl_closeLine_INTERNAL_API_DO_NOT_USE
# define pl_closeLocaleRuns_4_2 pl_closeLocaleRuns_INTERNAL_API_DO_N OT_USE # define pl_closeLocaleRuns_4_2 pl_closeLocaleRuns_INTERNAL_API_DO_N OT_USE
# define pl_closeValueRuns_4_2 pl_closeValueRuns_INTERNAL_API_DO_NOT _USE # define pl_closeValueRuns_4_2 pl_closeValueRuns_INTERNAL_API_DO_NOT _USE
 End of changes. 5 change blocks. 
7 lines changed or deleted 1 lines changed or added


 uiter.h   uiter.h 
/* /*
*************************************************************************** **** *************************************************************************** ****
* *
* Copyright (C) 2002-2006, International Business Machines * Copyright (C) 2002-2006,2009 International Business Machines
* Corporation and others. All Rights Reserved. * Corporation and others. All Rights Reserved.
* *
*************************************************************************** **** *************************************************************************** ****
* file name: uiter.h * file name: uiter.h
* encoding: US-ASCII * encoding: US-ASCII
* tab size: 8 (not used) * tab size: 8 (not used)
* indentation:4 * indentation:4
* *
* created on: 2002jan18 * created on: 2002jan18
* created by: Markus W. Scherer * created by: Markus W. Scherer
skipping to change at line 29 skipping to change at line 29
/** /**
* \file * \file
* \brief C API: Unicode Character Iteration * \brief C API: Unicode Character Iteration
* *
* @see UCharIterator * @see UCharIterator
*/ */
#include "unicode/utypes.h" #include "unicode/utypes.h"
#ifdef XP_CPLUSPLUS #if U_SHOW_CPLUSPLUS_API
U_NAMESPACE_BEGIN U_NAMESPACE_BEGIN
class CharacterIterator; class CharacterIterator;
class Replaceable; class Replaceable;
U_NAMESPACE_END U_NAMESPACE_END
#endif #endif
U_CDECL_BEGIN U_CDECL_BEGIN
skipping to change at line 651 skipping to change at line 651
* @param iter UCharIterator structure to be set for iteration * @param iter UCharIterator structure to be set for iteration
* @param s UTF-8 string to iterate over * @param s UTF-8 string to iterate over
* @param length Length of s in bytes, or -1 if NUL-terminated * @param length Length of s in bytes, or -1 if NUL-terminated
* *
* @see UCharIterator * @see UCharIterator
* @stable ICU 2.6 * @stable ICU 2.6
*/ */
U_STABLE void U_EXPORT2 U_STABLE void U_EXPORT2
uiter_setUTF8(UCharIterator *iter, const char *s, int32_t length); uiter_setUTF8(UCharIterator *iter, const char *s, int32_t length);
#ifdef XP_CPLUSPLUS #if U_SHOW_CPLUSPLUS_API
/** /**
* Set up a UCharIterator to wrap around a C++ CharacterIterator. * Set up a UCharIterator to wrap around a C++ CharacterIterator.
* *
* Sets the UCharIterator function pointers for iteration using the * Sets the UCharIterator function pointers for iteration using the
* CharacterIterator charIter. * CharacterIterator charIter.
* *
* The CharacterIterator pointer charIter is set into UCharIterator.context * The CharacterIterator pointer charIter is set into UCharIterator.context
* without copying or cloning the CharacterIterator object. * without copying or cloning the CharacterIterator object.
* The other "protected" UCharIterator fields are set to 0 and will be igno red. * The other "protected" UCharIterator fields are set to 0 and will be igno red.
 End of changes. 3 change blocks. 
3 lines changed or deleted 3 lines changed or added


 ulocdata.h   ulocdata.h 
/* /*
*************************************************************************** *** *************************************************************************** ***
* * * *
* Copyright (C) 2003-2009, International Business Machines * * Copyright (C) 2003-2010, International Business Machines *
* Corporation and others. All Rights Reserved. * * Corporation and others. All Rights Reserved. *
* * * *
*************************************************************************** *** *************************************************************************** ***
* file name: ulocdata.h * file name: ulocdata.h
* encoding: US-ASCII * encoding: US-ASCII
* tab size: 8 (not used) * tab size: 8 (not used)
* indentation:4 * indentation:4
* *
* created on: 2003Oct21 * created on: 2003Oct21
* created by: Ram Viswanadha * created by: Ram Viswanadha
skipping to change at line 76 skipping to change at line 76
/** /**
* Closes a locale data object. * Closes a locale data object.
* *
* @param uld The locale data object to close * @param uld The locale data object to close
* @stable ICU 3.4 * @stable ICU 3.4
*/ */
U_STABLE void U_EXPORT2 U_STABLE void U_EXPORT2
ulocdata_close(ULocaleData *uld); ulocdata_close(ULocaleData *uld);
#ifdef XP_CPLUSPLUS #if U_SHOW_CPLUSPLUS_API
U_NAMESPACE_BEGIN U_NAMESPACE_BEGIN
/** /**
* \class LocalULocaleDataPointer * \class LocalULocaleDataPointer
* "Smart pointer" class, closes a ULocaleData via ulocdata_close(). * "Smart pointer" class, closes a ULocaleData via ulocdata_close().
* For most methods see the LocalPointerBase base class. * For most methods see the LocalPointerBase base class.
* *
* @see LocalPointerBase * @see LocalPointerBase
* @see LocalPointer * @see LocalPointer
skipping to change at line 214 skipping to change at line 214
* which must not indicate a failure before the functi on call. * which must not indicate a failure before the functi on call.
* @stable ICU 2.8 * @stable ICU 2.8
*/ */
U_STABLE void U_EXPORT2 U_STABLE void U_EXPORT2
ulocdata_getPaperSize(const char *localeID, int32_t *height, int32_t *width , UErrorCode *status); ulocdata_getPaperSize(const char *localeID, int32_t *height, int32_t *width , UErrorCode *status);
/** /**
* Return the current CLDR version used by the library. * Return the current CLDR version used by the library.
* @param versionArray fillin that will recieve the version number * @param versionArray fillin that will recieve the version number
* @param status error code - could be U_MISSING_RESOURCE_ERROR if the vers ion was not found. * @param status error code - could be U_MISSING_RESOURCE_ERROR if the vers ion was not found.
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
U_DRAFT void U_EXPORT2 U_STABLE void U_EXPORT2
ulocdata_getCLDRVersion(UVersionInfo versionArray, UErrorCode *status); ulocdata_getCLDRVersion(UVersionInfo versionArray, UErrorCode *status);
/** /**
* Returns locale display pattern associated with a locale. * Returns locale display pattern associated with a locale.
* *
* @param uld Pointer to the locale data object from which the * @param uld Pointer to the locale data object from which the
* exemplar character set is to be retrieved. * exemplar character set is to be retrieved.
* @param pattern locale display pattern for locale. * @param pattern locale display pattern for locale.
* @param patternCapacity the size of the buffer to store the locale displa y * @param patternCapacity the size of the buffer to store the locale displa y
* pattern with. * pattern with.
* @param status Must be a valid pointer to an error code value, * @param status Must be a valid pointer to an error code value,
* which must not indicate a failure before the function c all. * which must not indicate a failure before the function c all.
* @return the actual buffer size needed for localeDisplayPattern. If it's greater * @return the actual buffer size needed for localeDisplayPattern. If it's greater
* than patternCapacity, the returned pattern will be truncated. * than patternCapacity, the returned pattern will be truncated.
* *
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
U_DRAFT int32_t U_EXPORT2 U_STABLE int32_t U_EXPORT2
ulocdata_getLocaleDisplayPattern(ULocaleData *uld, ulocdata_getLocaleDisplayPattern(ULocaleData *uld,
UChar *pattern, UChar *pattern,
int32_t patternCapacity, int32_t patternCapacity,
UErrorCode *status); UErrorCode *status);
/** /**
* Returns locale separator associated with a locale. * Returns locale separator associated with a locale.
* *
* @param uld Pointer to the locale data object from which the * @param uld Pointer to the locale data object from which the
* exemplar character set is to be retrieved. * exemplar character set is to be retrieved.
* @param separator locale separator for locale. * @param separator locale separator for locale.
* @param separatorCapacity the size of the buffer to store the locale * @param separatorCapacity the size of the buffer to store the locale
* separator with. * separator with.
* @param status Must be a valid pointer to an error code value, * @param status Must be a valid pointer to an error code value,
* which must not indicate a failure before the function c all. * which must not indicate a failure before the function c all.
* @return the actual buffer size needed for localeSeparator. If it's grea ter * @return the actual buffer size needed for localeSeparator. If it's grea ter
* than separatorCapacity, the returned separator will be truncated. * than separatorCapacity, the returned separator will be truncated.
* *
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
U_DRAFT int32_t U_EXPORT2 U_STABLE int32_t U_EXPORT2
ulocdata_getLocaleSeparator(ULocaleData *uld, ulocdata_getLocaleSeparator(ULocaleData *uld,
UChar *separator, UChar *separator,
int32_t separatorCapacity, int32_t separatorCapacity,
UErrorCode *status); UErrorCode *status);
#endif #endif
 End of changes. 8 change blocks. 
8 lines changed or deleted 8 lines changed or added


 umsg.h   umsg.h 
/* /********************************************************************
*************************************************************************** * COPYRIGHT:
**** * Copyright (c) 1997-2010, International Business Machines Corporation and
* Copyright (C) 1996-2009, International Business Machines Corporation * others. All Rights Reserved.
* and others. All Rights Reserved. * Copyright (C) 2010 , Yahoo! Inc.
*************************************************************************** ********************************************************************
**** *
* * file name: umsg.h
* file name: umsg.h * encoding: US-ASCII
* encoding: US-ASCII * tab size: 8 (not used)
* tab size: 8 (not used) * indentation:4
* indentation:4 *
* * Change history:
* Change history: *
* * 08/5/2001 Ram Added C wrappers for C++ API.
* 08/5/2001 Ram Added C wrappers for C++ API. *
* ********************************************************************/
*
*/
#ifndef UMSG_H #ifndef UMSG_H
#define UMSG_H #define UMSG_H
#include "unicode/utypes.h" #include "unicode/utypes.h"
#if !UCONFIG_NO_FORMATTING #if !UCONFIG_NO_FORMATTING
#include "unicode/localpointer.h" #include "unicode/localpointer.h"
#include "unicode/uloc.h" #include "unicode/uloc.h"
skipping to change at line 109 skipping to change at line 109
* printf("%s\n", austrdup(result) ); //austrdup( a function used to convert UChar* to char*) * printf("%s\n", austrdup(result) ); //austrdup( a function used to convert UChar* to char*)
* free(result); * free(result);
* } * }
* // output, with different testArgs: * // output, with different testArgs:
* // output: The disk "MyDisk" contains 100 files. * // output: The disk "MyDisk" contains 100 files.
* // output: The disk "MyDisk" contains one file. * // output: The disk "MyDisk" contains one file.
* // output: The disk "MyDisk" contains no files. * // output: The disk "MyDisk" contains no files.
* \endcode * \endcode
* </pre> * </pre>
* *
*
* Example 3:
* <pre>
* \code
* UChar* str;
* UChar* str1;
* UErrorCode status = U_ZERO_ERROR;
* UChar *result;
* UChar pattern[100];
* UChar expected[100];
* int32_t resultlength,resultLengthOut;
* str=(UChar*)malloc(sizeof(UChar) * 25);
* u_uastrcpy(str, "Kirti");
* str1=(UChar*)malloc(sizeof(UChar) * 25);
* u_uastrcpy(str1, "female");
* log_verbose("Testing message format with Select test #1\n:");
* u_uastrcpy(pattern, "{0} est {1, select, female {all\\u00E9e} other {all
\\u00E9}} \\u00E0 Paris.");
* u_uastrcpy(expected, "Kirti est all\\u00E9e \\u00E0 Paris.");
* resultlength=0;
* resultLengthOut=u_formatMessage( "fr", pattern, u_strlen(pattern), NULL,
resultlength, &status, str , str1);
* if(status==U_BUFFER_OVERFLOW_ERROR)
* {
* status=U_ZERO_ERROR;
* resultlength=resultLengthOut+1;
* result=(UChar*)malloc(sizeof(UChar) * resultlength);
* u_formatMessage( "fr", pattern, u_strlen(pattern), result, resultle
ngth, &status, str , str1);
* if(u_strcmp(result, expected)==0)
* log_verbose("PASS: MessagFormat successful on Select test#1\n")
;
* else{
* log_err("FAIL: Error in MessageFormat on Select test#1\n GOT %s
EXPECTED %s\n", austrdup(result),
* austrdup(expected) );
* }
* free(result);
* }
* \endcode
* </pre>
*
* The pattern is of the following form. Legend: * The pattern is of the following form. Legend:
* <pre> * <pre>
* \code * \code
* {optional item} * {optional item}
* (group that may be repeated)* * (group that may be repeated)*
* \endcode * \endcode
* </pre> * </pre>
* Do not confuse optional items with items inside quotes braces, such * Do not confuse optional items with items inside quotes braces, such
* as this: "{". Quoted braces are literals. * as this: "{". Quoted braces are literals.
* <pre> * <pre>
* \code * \code
* messageFormatPattern := string ( "{" messageFormatElement "}" stri ng )* * messageFormatPattern := string ( "{" messageFormatElement "}" stri ng )*
* *
* messageFormatElement := argument { "," elementFormat } * messageFormatElement := argument { "," elementFormat }
* *
* elementFormat := "time" { "," datetimeStyle } * elementFormat := "time" { "," datetimeStyle }
* | "date" { "," datetimeStyle } * | "date" { "," datetimeStyle }
* | "number" { "," numberStyle } * | "number" { "," numberStyle }
* | "choice" "," choiceStyle * | "choice" "," choiceStyle
* | "select" "," selectStyle
* *
* datetimeStyle := "short" * datetimeStyle := "short"
* | "medium" * | "medium"
* | "long" * | "long"
* | "full" * | "full"
* | dateFormatPattern * | dateFormatPattern
* *
* numberStyle := "currency" * numberStyle := "currency"
* | "percent" * | "percent"
* | "integer" * | "integer"
* | numberFormatPattern * | numberFormatPattern
* *
* choiceStyle := choiceFormatPattern * choiceStyle := choiceFormatPattern
*
* selectStyle := selectFormatPattern
* \endcode * \endcode
* </pre> * </pre>
* If there is no elementFormat, then the argument must be a string, * If there is no elementFormat, then the argument must be a string,
* which is substituted. If there is no dateTimeStyle or numberStyle, * which is substituted. If there is no dateTimeStyle or numberStyle,
* then the default format is used (e.g. NumberFormat.getInstance(), * then the default format is used (e.g. NumberFormat.getInstance(),
* DateFormat.getDefaultTime() or DateFormat.getDefaultDate(). For * DateFormat.getDefaultTime() or DateFormat.getDefaultDate(). For
* a ChoiceFormat, the pattern must always be specified, since there * a ChoiceFormat, the pattern must always be specified, since there
* is no default. * is no default.
* <P> * <P>
* In strings, single quotes can be used to quote the "{" sign if * In strings, single quotes can be used to quote the "{" sign if
skipping to change at line 456 skipping to change at line 498
/** /**
* Close a UMessageFormat. * Close a UMessageFormat.
* Once closed, a UMessageFormat may no longer be used. * Once closed, a UMessageFormat may no longer be used.
* @param format The formatter to close. * @param format The formatter to close.
* @stable ICU 2.0 * @stable ICU 2.0
*/ */
U_STABLE void U_EXPORT2 U_STABLE void U_EXPORT2
umsg_close(UMessageFormat* format); umsg_close(UMessageFormat* format);
#ifdef XP_CPLUSPLUS #if U_SHOW_CPLUSPLUS_API
U_NAMESPACE_BEGIN U_NAMESPACE_BEGIN
/** /**
* \class LocalUMessageFormatPointer * \class LocalUMessageFormatPointer
* "Smart pointer" class, closes a UMessageFormat via umsg_close(). * "Smart pointer" class, closes a UMessageFormat via umsg_close().
* For most methods see the LocalPointerBase base class. * For most methods see the LocalPointerBase base class.
* *
* @see LocalPointerBase * @see LocalPointerBase
* @see LocalPointer * @see LocalPointer
 End of changes. 5 change blocks. 
20 lines changed or deleted 65 lines changed or added


 uniset.h   uniset.h 
/* /*
*************************************************************************** ***************************************************************************
* Copyright (C) 1999-2009, International Business Machines Corporation * Copyright (C) 1999-2010, International Business Machines Corporation
* and others. All Rights Reserved. * and others. All Rights Reserved.
*************************************************************************** ***************************************************************************
* Date Name Description * Date Name Description
* 10/20/99 alan Creation. * 10/20/99 alan Creation.
*************************************************************************** ***************************************************************************
*/ */
#ifndef UNICODESET_H #ifndef UNICODESET_H
#define UNICODESET_H #define UNICODESET_H
skipping to change at line 479 skipping to change at line 479
* @stable ICU 2.0 * @stable ICU 2.0
*/ */
virtual int32_t hashCode(void) const; virtual int32_t hashCode(void) const;
/** /**
* Get a UnicodeSet pointer from a USet * Get a UnicodeSet pointer from a USet
* *
* @param uset a USet (the ICU plain C type for UnicodeSet) * @param uset a USet (the ICU plain C type for UnicodeSet)
* @return the corresponding UnicodeSet pointer. * @return the corresponding UnicodeSet pointer.
* *
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
inline static UnicodeSet *fromUSet(USet *uset); inline static UnicodeSet *fromUSet(USet *uset);
/** /**
* Get a UnicodeSet pointer from a const USet * Get a UnicodeSet pointer from a const USet
* *
* @param uset a const USet (the ICU plain C type for UnicodeSet) * @param uset a const USet (the ICU plain C type for UnicodeSet)
* @return the corresponding UnicodeSet pointer. * @return the corresponding UnicodeSet pointer.
* *
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
inline static const UnicodeSet *fromUSet(const USet *uset); inline static const UnicodeSet *fromUSet(const USet *uset);
/** /**
* Produce a USet * pointer for this UnicodeSet. * Produce a USet * pointer for this UnicodeSet.
* USet is the plain C type for UnicodeSet * USet is the plain C type for UnicodeSet
* *
* @return a USet pointer for this UnicodeSet * @return a USet pointer for this UnicodeSet
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
inline USet *toUSet(); inline USet *toUSet();
/** /**
* Produce a const USet * pointer for this UnicodeSet. * Produce a const USet * pointer for this UnicodeSet.
* USet is the plain C type for UnicodeSet * USet is the plain C type for UnicodeSet
* *
* @return a const USet pointer for this UnicodeSet * @return a const USet pointer for this UnicodeSet
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
inline const USet * toUSet() const; inline const USet * toUSet() const;
//---------------------------------------------------------------- //----------------------------------------------------------------
// Freezable API // Freezable API
//---------------------------------------------------------------- //----------------------------------------------------------------
/** /**
* Determines whether the set has been frozen (made immutable) or not. * Determines whether the set has been frozen (made immutable) or not.
* See the ICU4J Freezable interface for details. * See the ICU4J Freezable interface for details.
skipping to change at line 863 skipping to change at line 863
* @param length of the string; can be -1 for NUL-terminated * @param length of the string; can be -1 for NUL-terminated
* @param spanCondition specifies the containment condition * @param spanCondition specifies the containment condition
* @return the length of the initial substring according to the spanCon dition; * @return the length of the initial substring according to the spanCon dition;
* 0 if the start of the string does not fit the spanCondition * 0 if the start of the string does not fit the spanCondition
* @stable ICU 3.8 * @stable ICU 3.8
* @see USetSpanCondition * @see USetSpanCondition
*/ */
int32_t span(const UChar *s, int32_t length, USetSpanCondition spanCond ition) const; int32_t span(const UChar *s, int32_t length, USetSpanCondition spanCond ition) const;
/** /**
* Returns the end of the substring of the input string according to th
e USetSpanCondition.
* Same as <code>start+span(s.getBuffer()+start, s.length()-start, span
Condition)</code>
* after pinning start to 0<=start<=s.length().
* @param s the string
* @param start the start index in the string for the span operation
* @param spanCondition specifies the containment condition
* @return the exclusive end of the substring according to the spanCond
ition;
* the substring s.tempSubStringBetween(start, end) fulfills th
e spanCondition
* @draft ICU 4.4
* @see USetSpanCondition
*/
inline int32_t span(const UnicodeString &s, int32_t start, USetSpanCond
ition spanCondition) const;
/**
* Returns the start of the trailing substring of the input string whic h * Returns the start of the trailing substring of the input string whic h
* consists only of characters and strings that are contained in this s et * consists only of characters and strings that are contained in this s et
* (USET_SPAN_CONTAINED, USET_SPAN_SIMPLE), * (USET_SPAN_CONTAINED, USET_SPAN_SIMPLE),
* or only of characters and strings that are not contained * or only of characters and strings that are not contained
* in this set (USET_SPAN_NOT_CONTAINED). * in this set (USET_SPAN_NOT_CONTAINED).
* See USetSpanCondition for details. * See USetSpanCondition for details.
* Unpaired surrogates are treated according to contains() of their sur rogate code points. * Unpaired surrogates are treated according to contains() of their sur rogate code points.
* This function works faster with a frozen set and with a non-negative string length argument. * This function works faster with a frozen set and with a non-negative string length argument.
* @param s start of the string * @param s start of the string
* @param length of the string; can be -1 for NUL-terminated * @param length of the string; can be -1 for NUL-terminated
* @param spanCondition specifies the containment condition * @param spanCondition specifies the containment condition
* @return the start of the trailing substring according to the spanCon dition; * @return the start of the trailing substring according to the spanCon dition;
* the string length if the end of the string does not fit the spanCondition * the string length if the end of the string does not fit the spanCondition
* @stable ICU 3.8 * @stable ICU 3.8
* @see USetSpanCondition * @see USetSpanCondition
*/ */
int32_t spanBack(const UChar *s, int32_t length, USetSpanCondition span Condition) const; int32_t spanBack(const UChar *s, int32_t length, USetSpanCondition span Condition) const;
/** /**
* Returns the start of the substring of the input string according to
the USetSpanCondition.
* Same as <code>spanBack(s.getBuffer(), limit, spanCondition)</code>
* after pinning limit to 0<=end<=s.length().
* @param s the string
* @param limit the exclusive-end index in the string for the span oper
ation
* (use s.length() or INT32_MAX for spanning back from the
end of the string)
* @param spanCondition specifies the containment condition
* @return the start of the substring according to the spanCondition;
* the substring s.tempSubStringBetween(start, limit) fulfills
the spanCondition
* @draft ICU 4.4
* @see USetSpanCondition
*/
inline int32_t spanBack(const UnicodeString &s, int32_t limit, USetSpan
Condition spanCondition) const;
/**
* Returns the length of the initial substring of the input string whic h * Returns the length of the initial substring of the input string whic h
* consists only of characters and strings that are contained in this s et * consists only of characters and strings that are contained in this s et
* (USET_SPAN_CONTAINED, USET_SPAN_SIMPLE), * (USET_SPAN_CONTAINED, USET_SPAN_SIMPLE),
* or only of characters and strings that are not contained * or only of characters and strings that are not contained
* in this set (USET_SPAN_NOT_CONTAINED). * in this set (USET_SPAN_NOT_CONTAINED).
* See USetSpanCondition for details. * See USetSpanCondition for details.
* Similar to the strspn() C library function. * Similar to the strspn() C library function.
* Malformed byte sequences are treated according to contains(0xfffd). * Malformed byte sequences are treated according to contains(0xfffd).
* This function works faster with a frozen set and with a non-negative string length argument. * This function works faster with a frozen set and with a non-negative string length argument.
* @param s start of the string (UTF-8) * @param s start of the string (UTF-8)
skipping to change at line 1292 skipping to change at line 1321
* (Here foldCase(x) refers to the operation u_strFoldCase, and a * (Here foldCase(x) refers to the operation u_strFoldCase, and a
* == b denotes that the contents are the same, not pointer * == b denotes that the contents are the same, not pointer
* comparison.) * comparison.)
* *
* A frozen set will not be modified. * A frozen set will not be modified.
* *
* @param attribute bitmask for attributes to close over. * @param attribute bitmask for attributes to close over.
* Currently only the USET_CASE bit is supported. Any undefined bits * Currently only the USET_CASE bit is supported. Any undefined bits
* are ignored. * are ignored.
* @return a reference to this set. * @return a reference to this set.
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
UnicodeSet& closeOver(int32_t attribute); UnicodeSet& closeOver(int32_t attribute);
/** /**
* Remove all strings from this set. * Remove all strings from this set.
* *
* @return a reference to this set. * @return a reference to this set.
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
virtual UnicodeSet &removeAllStrings(); virtual UnicodeSet &removeAllStrings();
/** /**
* Iteration method that returns the number of ranges contained in * Iteration method that returns the number of ranges contained in
* this set. * this set.
* @see #getRangeStart * @see #getRangeStart
* @see #getRangeEnd * @see #getRangeEnd
* @stable ICU 2.4 * @stable ICU 2.4
*/ */
skipping to change at line 1616 skipping to change at line 1645
} }
inline USet *UnicodeSet::toUSet() { inline USet *UnicodeSet::toUSet() {
return reinterpret_cast<USet *>(this); return reinterpret_cast<USet *>(this);
} }
inline const USet *UnicodeSet::toUSet() const { inline const USet *UnicodeSet::toUSet() const {
return reinterpret_cast<const USet *>(this); return reinterpret_cast<const USet *>(this);
} }
inline int32_t UnicodeSet::span(const UnicodeString &s, int32_t start, USet
SpanCondition spanCondition) const {
int32_t sLength=s.length();
if(start<0) {
start=0;
} else if(start>sLength) {
start=sLength;
}
return start+span(s.getBuffer()+start, sLength-start, spanCondition);
}
inline int32_t UnicodeSet::spanBack(const UnicodeString &s, int32_t limit,
USetSpanCondition spanCondition) const {
int32_t sLength=s.length();
if(limit<0) {
limit=0;
} else if(limit>sLength) {
limit=sLength;
}
return spanBack(s.getBuffer(), limit, spanCondition);
}
U_NAMESPACE_END U_NAMESPACE_END
#endif #endif
 End of changes. 10 change blocks. 
7 lines changed or deleted 68 lines changed or added


 unistr.h   unistr.h 
/* /*
********************************************************************** **********************************************************************
* Copyright (C) 1998-2009, International Business Machines * Copyright (C) 1998-2010, International Business Machines
* Corporation and others. All Rights Reserved. * Corporation and others. All Rights Reserved.
********************************************************************** **********************************************************************
* *
* File unistr.h * File unistr.h
* *
* Modification History: * Modification History:
* *
* Date Name Description * Date Name Description
* 09/25/98 stephen Creation. * 09/25/98 stephen Creation.
* 11/11/98 stephen Changed per 11/9 code review. * 11/11/98 stephen Changed per 11/9 code review.
skipping to change at line 1568 skipping to change at line 1568
* and a buffer of the indicated length would need to be passed i n * and a buffer of the indicated length would need to be passed i n
* @stable ICU 2.0 * @stable ICU 2.0
*/ */
int32_t extract(char *dest, int32_t destCapacity, int32_t extract(char *dest, int32_t destCapacity,
UConverter *cnv, UConverter *cnv,
UErrorCode &errorCode) const; UErrorCode &errorCode) const;
#endif #endif
/** /**
* Create a temporary substring for the specified range.
* Unlike the substring constructor and setTo() functions,
* the object returned here will be a read-only alias (using getBuffer())
* rather than copying the text.
* As a result, this substring operation is much faster but requires
* that the original string not be modified or deleted during the lifetim
e
* of the returned substring object.
* @param start offset of the first character visible in the substring
* @param length length of the substring
* @return a read-only alias UnicodeString object for the substring
* @draft ICU 4.4
*/
UnicodeString tempSubString(int32_t start=0, int32_t length=INT32_MAX) co
nst;
/**
* Create a temporary substring for the specified range.
* Same as tempSubString(start, length) except that the substring range
* is specified as a (start, limit) pair (with an exclusive limit index)
* rather than a (start, length) pair.
* @param start offset of the first character visible in the substring
* @param limit offset immediately following the last character visible i
n the substring
* @return a read-only alias UnicodeString object for the substring
* @draft ICU 4.4
*/
inline UnicodeString tempSubStringBetween(int32_t start, int32_t limit=IN
T32_MAX) const;
/**
* Convert the UnicodeString to UTF-8 and write the result * Convert the UnicodeString to UTF-8 and write the result
* to a ByteSink. This is called by toUTF8String(). * to a ByteSink. This is called by toUTF8String().
* Unpaired surrogates are replaced with U+FFFD. * Unpaired surrogates are replaced with U+FFFD.
* Calls u_strToUTF8WithSub(). * Calls u_strToUTF8WithSub().
* *
* @param sink A ByteSink to which the UTF-8 version of the string is wri tten. * @param sink A ByteSink to which the UTF-8 version of the string is wri tten.
* @draft ICU 4.2 * @stable ICU 4.4
* @see toUTF8String * @see toUTF8String
*/ */
void toUTF8(ByteSink &sink) const; void toUTF8(ByteSink &sink) const;
#if U_HAVE_STD_STRING #if U_HAVE_STD_STRING
/** /**
* Convert the UnicodeString to UTF-8 and append the result * Convert the UnicodeString to UTF-8 and append the result
* to a standard string. * to a standard string.
* Unpaired surrogates are replaced with U+FFFD. * Unpaired surrogates are replaced with U+FFFD.
* Calls toUTF8(). * Calls toUTF8().
* *
* @param A standard string (or a compatible object) * @param result A standard string (or a compatible object)
* to which the UTF-8 version of the string is appended. * to which the UTF-8 version of the string is appended.
* @return The string object. * @return The string object.
* @draft ICU 4.2 * @stable ICU 4.4
* @see toUTF8 * @see toUTF8
*/ */
template<typename StringClass> template<typename StringClass>
StringClass &toUTF8String(StringClass &result) const { StringClass &toUTF8String(StringClass &result) const {
StringByteSink<StringClass> sbs(&result); StringByteSink<StringClass> sbs(&result);
toUTF8(sbs); toUTF8(sbs);
return result; return result;
} }
#endif #endif
skipping to change at line 1615 skipping to change at line 1642
* Calls u_strToUTF32WithSub(). * Calls u_strToUTF32WithSub().
* *
* @param utf32 destination string buffer, can be NULL if capacity==0 * @param utf32 destination string buffer, can be NULL if capacity==0
* @param capacity the number of UChar32s available at utf32 * @param capacity the number of UChar32s available at utf32
* @param errorCode Standard ICU error code. Its input value must * @param errorCode Standard ICU error code. Its input value must
* pass the U_SUCCESS() test, or else the function retur ns * pass the U_SUCCESS() test, or else the function retur ns
* immediately. Check for U_FAILURE() on output or use w ith * immediately. Check for U_FAILURE() on output or use w ith
* function chaining. (See User Guide for details.) * function chaining. (See User Guide for details.)
* @return The length of the UTF-32 string. * @return The length of the UTF-32 string.
* @see fromUTF32 * @see fromUTF32
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
int32_t toUTF32(UChar32 *utf32, int32_t capacity, UErrorCode &errorCode) const; int32_t toUTF32(UChar32 *utf32, int32_t capacity, UErrorCode &errorCode) const;
/* Length operations */ /* Length operations */
/** /**
* Return the length of the UnicodeString object. * Return the length of the UnicodeString object.
* The length is the number of UChar code units are in the UnicodeString. * The length is the number of UChar code units are in the UnicodeString.
* If you want the number of code points, please use countChar32(). * If you want the number of code points, please use countChar32().
* @return the length of the UnicodeString object * @return the length of the UnicodeString object
skipping to change at line 2392 skipping to change at line 2419
* Remove the characters in the range * Remove the characters in the range
* [<TT>start</TT>, <TT>limit</TT>) from the UnicodeString object. * [<TT>start</TT>, <TT>limit</TT>) from the UnicodeString object.
* @param start the offset of the first character to remove * @param start the offset of the first character to remove
* @param limit the offset immediately following the range to remove * @param limit the offset immediately following the range to remove
* @return a reference to this * @return a reference to this
* @stable ICU 2.0 * @stable ICU 2.0
*/ */
inline UnicodeString& removeBetween(int32_t start, inline UnicodeString& removeBetween(int32_t start,
int32_t limit = (int32_t)INT32_MAX); int32_t limit = (int32_t)INT32_MAX);
/**
* Retain only the characters in the range
* [<code>start</code>, <code>limit</code>) from the UnicodeString object
.
* Removes characters before <code>start</code> and at and after <code>li
mit</code>.
* @param start the offset of the first character to retain
* @param limit the offset immediately following the range to retain
* @return a reference to this
* @draft ICU 4.4
*/
inline UnicodeString &retainBetween(int32_t start, int32_t limit = INT32_
MAX);
/* Length operations */ /* Length operations */
/** /**
* Pad the start of this UnicodeString with the character <TT>padChar</TT >. * Pad the start of this UnicodeString with the character <TT>padChar</TT >.
* If the length of this UnicodeString is less than targetLength, * If the length of this UnicodeString is less than targetLength,
* length() - targetLength copies of padChar will be added to the * length() - targetLength copies of padChar will be added to the
* beginning of this UnicodeString. * beginning of this UnicodeString.
* @param targetLength the desired length of the string * @param targetLength the desired length of the string
* @param padChar the character to use for padding. Defaults to * @param padChar the character to use for padding. Defaults to
* space (U+0020) * space (U+0020)
skipping to change at line 3005 skipping to change at line 3043
* Create a UnicodeString from a UTF-8 string. * Create a UnicodeString from a UTF-8 string.
* Illegal input is replaced with U+FFFD. Otherwise, errors result in a b ogus string. * Illegal input is replaced with U+FFFD. Otherwise, errors result in a b ogus string.
* Calls u_strFromUTF8WithSub(). * Calls u_strFromUTF8WithSub().
* *
* @param utf8 UTF-8 input string. * @param utf8 UTF-8 input string.
* Note that a StringPiece can be implicitly constructed * Note that a StringPiece can be implicitly constructed
* from a std::string or a NUL-terminated const char * string . * from a std::string or a NUL-terminated const char * string .
* @return A UnicodeString with equivalent UTF-16 contents. * @return A UnicodeString with equivalent UTF-16 contents.
* @see toUTF8 * @see toUTF8
* @see toUTF8String * @see toUTF8String
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
static UnicodeString fromUTF8(const StringPiece &utf8); static UnicodeString fromUTF8(const StringPiece &utf8);
/** /**
* Create a UnicodeString from a UTF-32 string. * Create a UnicodeString from a UTF-32 string.
* Illegal input is replaced with U+FFFD. Otherwise, errors result in a b ogus string. * Illegal input is replaced with U+FFFD. Otherwise, errors result in a b ogus string.
* Calls u_strFromUTF32WithSub(). * Calls u_strFromUTF32WithSub().
* *
* @param utf32 UTF-32 input string. Must not be NULL. * @param utf32 UTF-32 input string. Must not be NULL.
* @param length Length of the input string, or -1 if NUL-terminated. * @param length Length of the input string, or -1 if NUL-terminated.
* @return A UnicodeString with equivalent UTF-16 contents. * @return A UnicodeString with equivalent UTF-16 contents.
* @see toUTF32 * @see toUTF32
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
static UnicodeString fromUTF32(const UChar32 *utf32, int32_t length); static UnicodeString fromUTF32(const UChar32 *utf32, int32_t length);
/* Miscellaneous operations */ /* Miscellaneous operations */
/** /**
* Unescape a string of characters and return a string containing * Unescape a string of characters and return a string containing
* the result. The following escape sequences are recognized: * the result. The following escape sequences are recognized:
* *
* \\uhhhh 4 hex digits; h in [0-9A-Fa-f] * \\uhhhh 4 hex digits; h in [0-9A-Fa-f]
skipping to change at line 4060 skipping to change at line 4098
inline void inline void
UnicodeString::extractBetween(int32_t start, UnicodeString::extractBetween(int32_t start,
int32_t limit, int32_t limit,
UChar *dst, UChar *dst,
int32_t dstStart) const { int32_t dstStart) const {
pinIndex(start); pinIndex(start);
pinIndex(limit); pinIndex(limit);
doExtract(start, limit - start, dst, dstStart); doExtract(start, limit - start, dst, dstStart);
} }
inline UnicodeString
UnicodeString::tempSubStringBetween(int32_t start, int32_t limit) const {
return tempSubString(start, limit - start);
}
inline UChar inline UChar
UnicodeString::doCharAt(int32_t offset) const UnicodeString::doCharAt(int32_t offset) const
{ {
if((uint32_t)offset < (uint32_t)length()) { if((uint32_t)offset < (uint32_t)length()) {
return getArrayStart()[offset]; return getArrayStart()[offset];
} else { } else {
return kInvalidUChar; return kInvalidUChar;
} }
} }
skipping to change at line 4153 skipping to change at line 4196
fUnion.fFields.fCapacity = capacity; fUnion.fFields.fCapacity = capacity;
} }
inline const UChar * inline const UChar *
UnicodeString::getTerminatedBuffer() { UnicodeString::getTerminatedBuffer() {
if(!isWritable()) { if(!isWritable()) {
return 0; return 0;
} else { } else {
UChar *array = getArrayStart(); UChar *array = getArrayStart();
int32_t len = length(); int32_t len = length();
if(len < getCapacity()) { if(len < getCapacity() && ((fFlags&kRefCounted) == 0 || refCount() == 1
)) {
/*
* kRefCounted: Do not write the NUL if the buffer is shared.
* That is mostly safe, except when the length of one copy was modifi
ed
* without copy-on-write, e.g., via truncate(newLength) or remove(voi
d).
* Then the NUL would be written into the middle of another copy's st
ring.
*/
if(!(fFlags&kBufferIsReadonly)) { if(!(fFlags&kBufferIsReadonly)) {
/* /*
* We must not write to a readonly buffer, but it is known to be * We must not write to a readonly buffer, but it is known to be
* NUL-terminated if len<capacity. * NUL-terminated if len<capacity.
* A shared, allocated buffer (refCount()>1) must not have its cont ents * A shared, allocated buffer (refCount()>1) must not have its cont ents
* modified, but the NUL at [len] is beyond the string contents, * modified, but the NUL at [len] is beyond the string contents,
* and multiple string objects and threads writing the same NUL int o the * and multiple string objects and threads writing the same NUL int o the
* same location is harmless. * same location is harmless.
* In all other cases, the buffer is fully writable and it is anywa y safe * In all other cases, the buffer is fully writable and it is anywa y safe
* to write the NUL. * to write the NUL.
skipping to change at line 4323 skipping to change at line 4372
inline UnicodeString& inline UnicodeString&
UnicodeString::insert(int32_t start, UnicodeString::insert(int32_t start,
UChar32 srcChar) UChar32 srcChar)
{ return replace(start, 0, srcChar); } { return replace(start, 0, srcChar); }
inline UnicodeString& inline UnicodeString&
UnicodeString::remove() UnicodeString::remove()
{ {
// remove() of a bogus string makes the string empty and non-bogus // remove() of a bogus string makes the string empty and non-bogus
if(isBogus()) { // we also un-alias a read-only alias to deal with NUL-termination
unBogus(); // issues with getTerminatedBuffer()
if(fFlags & (kIsBogus|kBufferIsReadonly)) {
setToEmpty();
} else { } else {
setLength(0); fShortLength = 0;
} }
return *this; return *this;
} }
inline UnicodeString& inline UnicodeString&
UnicodeString::remove(int32_t start, UnicodeString::remove(int32_t start,
int32_t _length) int32_t _length)
{ {
if(start <= 0 && _length == INT32_MAX) { if(start <= 0 && _length == INT32_MAX) {
// remove(guaranteed everything) of a bogus string makes the string empty and non-bogus // remove(guaranteed everything) of a bogus string makes the string empty and non-bogus
return remove(); return remove();
} }
return doReplace(start, _length, NULL, 0, 0); return doReplace(start, _length, NULL, 0, 0);
} }
inline UnicodeString& inline UnicodeString&
UnicodeString::removeBetween(int32_t start, UnicodeString::removeBetween(int32_t start,
int32_t limit) int32_t limit)
{ return doReplace(start, limit - start, NULL, 0, 0); } { return doReplace(start, limit - start, NULL, 0, 0); }
inline UnicodeString &
UnicodeString::retainBetween(int32_t start, int32_t limit) {
truncate(limit);
return doReplace(0, start, NULL, 0, 0);
}
inline UBool inline UBool
UnicodeString::truncate(int32_t targetLength) UnicodeString::truncate(int32_t targetLength)
{ {
if(isBogus() && targetLength == 0) { if(isBogus() && targetLength == 0) {
// truncate(0) of a bogus string makes the string empty and non-bogus // truncate(0) of a bogus string makes the string empty and non-bogus
unBogus(); unBogus();
return FALSE; return FALSE;
} else if((uint32_t)targetLength < (uint32_t)length()) { } else if((uint32_t)targetLength < (uint32_t)length()) {
setLength(targetLength); setLength(targetLength);
if(fFlags&kBufferIsReadonly) {
fUnion.fFields.fCapacity = targetLength; // not NUL-terminated any m
ore
}
return TRUE; return TRUE;
} else { } else {
return FALSE; return FALSE;
} }
} }
inline UnicodeString& inline UnicodeString&
UnicodeString::reverse() UnicodeString::reverse()
{ return doReverse(0, length()); } { return doReverse(0, length()); }
 End of changes. 15 change blocks. 
11 lines changed or deleted 83 lines changed or added


 unorm.h   unorm.h 
/* /*
*************************************************************************** **** *************************************************************************** ****
* Copyright (c) 1996-2007, International Business Machines Corporation * Copyright (c) 1996-2010, International Business Machines Corporation
* and others. All Rights Reserved. * and others. All Rights Reserved.
*************************************************************************** **** *************************************************************************** ****
* File unorm.h * File unorm.h
* *
* Created by: Vladimir Weinstein 12052000 * Created by: Vladimir Weinstein 12052000
* *
* Modification history : * Modification history :
* *
* Date Name Description * Date Name Description
* 02/01/01 synwee Added normalization quickcheck enum and method. * 02/01/01 synwee Added normalization quickcheck enum and method.
*/ */
#ifndef UNORM_H #ifndef UNORM_H
#define UNORM_H #define UNORM_H
#include "unicode/utypes.h" #include "unicode/utypes.h"
#if !UCONFIG_NO_NORMALIZATION #if !UCONFIG_NO_NORMALIZATION
#include "unicode/uiter.h" #include "unicode/uiter.h"
#include "unicode/unorm2.h"
/** /**
* \file * \file
* \brief C API: Unicode Normalization * \brief C API: Unicode Normalization
* *
* <h2>Unicode normalization API</h2> * <h2>Unicode normalization API</h2>
* *
* Note: This API has been replaced by the unorm2.h API and is only availab
le
* for backward compatibility. The functions here simply delegate to the
* unorm2.h functions, for example unorm2_getInstance() and unorm2_normaliz
e().
* There is one exception: The new API does not provide a replacement for u
norm_compare().
*
* <code>unorm_normalize</code> transforms Unicode text into an equivalent composed or * <code>unorm_normalize</code> transforms Unicode text into an equivalent composed or
* decomposed form, allowing for easier sorting and searching of text. * decomposed form, allowing for easier sorting and searching of text.
* <code>unorm_normalize</code> supports the standard normalization forms d escribed in * <code>unorm_normalize</code> supports the standard normalization forms d escribed in
* <a href="http://www.unicode.org/unicode/reports/tr15/" target="unicode"> * <a href="http://www.unicode.org/unicode/reports/tr15/" target="unicode">
* Unicode Standard Annex #15: Unicode Normalization Forms</a>. * Unicode Standard Annex #15: Unicode Normalization Forms</a>.
* *
* Characters with accents or other adornments can be encoded in * Characters with accents or other adornments can be encoded in
* several different ways in Unicode. For example, take the character A-ac ute. * several different ways in Unicode. For example, take the character A-ac ute.
* In Unicode, this can be encoded as a single character (the * In Unicode, this can be encoded as a single character (the
* "composed" form): * "composed" form):
skipping to change at line 205 skipping to change at line 211
* @param status A pointer to a UErrorCode to receive any errors. * @param status A pointer to a UErrorCode to receive any errors.
* @return The total buffer size needed; if greater than resultLength, * @return The total buffer size needed; if greater than resultLength,
* the output was truncated, and the error code is set to U_BUFFER_ OVERFLOW_ERROR. * the output was truncated, and the error code is set to U_BUFFER_ OVERFLOW_ERROR.
* @stable ICU 2.0 * @stable ICU 2.0
*/ */
U_STABLE int32_t U_EXPORT2 U_STABLE int32_t U_EXPORT2
unorm_normalize(const UChar *source, int32_t sourceLength, unorm_normalize(const UChar *source, int32_t sourceLength,
UNormalizationMode mode, int32_t options, UNormalizationMode mode, int32_t options,
UChar *result, int32_t resultLength, UChar *result, int32_t resultLength,
UErrorCode *status); UErrorCode *status);
#endif
/**
* Result values for unorm_quickCheck().
* For details see Unicode Technical Report 15.
* @stable ICU 2.0
*/
typedef enum UNormalizationCheckResult {
/**
* Indicates that string is not in the normalized format
*/
UNORM_NO,
/**
* Indicates that string is in the normalized format
*/
UNORM_YES,
/**
* Indicates that string cannot be determined if it is in the normalized
* format without further thorough checks.
*/
UNORM_MAYBE
} UNormalizationCheckResult;
#if !UCONFIG_NO_NORMALIZATION
/** /**
* Performing quick check on a string, to quickly determine if the string i s * Performing quick check on a string, to quickly determine if the string i s
* in a particular normalization format. * in a particular normalization format.
* Three types of result can be returned UNORM_YES, UNORM_NO or * Three types of result can be returned UNORM_YES, UNORM_NO or
* UNORM_MAYBE. Result UNORM_YES indicates that the argument * UNORM_MAYBE. Result UNORM_YES indicates that the argument
* string is in the desired normalized format, UNORM_NO determines that * string is in the desired normalized format, UNORM_NO determines that
* argument string is not in the desired normalized format. A * argument string is not in the desired normalized format. A
* UNORM_MAYBE result indicates that a more thorough check is required, * UNORM_MAYBE result indicates that a more thorough check is required,
* the user may have to put the string in its normalized form and compare t he * the user may have to put the string in its normalized form and compare t he
* results. * results.
 End of changes. 4 change blocks. 
23 lines changed or deleted 11 lines changed or added


 unum.h   unum.h 
/* /*
*************************************************************************** **** *************************************************************************** ****
* Copyright (C) 1997-2009, International Business Machines Corporation and others. * Copyright (C) 1997-2010, International Business Machines Corporation and others.
* All Rights Reserved. * All Rights Reserved.
* Modification History: * Modification History:
* *
* Date Name Description * Date Name Description
* 06/24/99 helena Integrated Alan's NF enhancements and Java2 bug fixes * 06/24/99 helena Integrated Alan's NF enhancements and Java2 bug fixes
*************************************************************************** **** *************************************************************************** ****
*/ */
#ifndef _UNUM #ifndef _UNUM
#define _UNUM #define _UNUM
skipping to change at line 257 skipping to change at line 257
/** /**
* Close a UNumberFormat. * Close a UNumberFormat.
* Once closed, a UNumberFormat may no longer be used. * Once closed, a UNumberFormat may no longer be used.
* @param fmt The formatter to close. * @param fmt The formatter to close.
* @stable ICU 2.0 * @stable ICU 2.0
*/ */
U_STABLE void U_EXPORT2 U_STABLE void U_EXPORT2
unum_close(UNumberFormat* fmt); unum_close(UNumberFormat* fmt);
#ifdef XP_CPLUSPLUS #if U_SHOW_CPLUSPLUS_API
U_NAMESPACE_BEGIN U_NAMESPACE_BEGIN
/** /**
* \class LocalUNumberFormatPointer * \class LocalUNumberFormatPointer
* "Smart pointer" class, closes a UNumberFormat via unum_close(). * "Smart pointer" class, closes a UNumberFormat via unum_close().
* For most methods see the LocalPointerBase base class. * For most methods see the LocalPointerBase base class.
* *
* @see LocalPointerBase * @see LocalPointerBase
* @see LocalPointer * @see LocalPointer
skipping to change at line 376 skipping to change at line 376
*/ */
U_STABLE int32_t U_EXPORT2 U_STABLE int32_t U_EXPORT2
unum_formatDouble( const UNumberFormat* fmt, unum_formatDouble( const UNumberFormat* fmt,
double number, double number,
UChar* result, UChar* result,
int32_t resultLength, int32_t resultLength,
UFieldPosition *pos, /* 0 if ignore */ UFieldPosition *pos, /* 0 if ignore */
UErrorCode* status); UErrorCode* status);
/** /**
* Format a decimal number using a UNumberFormat.
* The number will be formatted according to the UNumberFormat's locale.
* The syntax of the input number is a "numeric string"
* as defined in the Decimal Arithmetic Specification, available at
* http://speleotrove.com/decimal
* @param fmt The formatter to use.
* @param number The number to format.
* @param length The length of the input number, or -1 if the input is nul-t
erminated.
* @param result A pointer to a buffer to receive the formatted number.
* @param resultLength The maximum size of result.
* @param pos A pointer to a UFieldPosition. On input, position->field
* is read. On output, position->beginIndex and position->end
Index indicate
* the beginning and ending indices of field number position->
field, if such
* a field exists. This parameter may be NULL, in which case
it is ignored.
* @param status A pointer to an UErrorCode to receive any errors
* @return The total buffer size needed; if greater than resultLength, the o
utput was truncated.
* @see unum_format
* @see unum_formatInt64
* @see unum_parse
* @see unum_parseInt64
* @see unum_parseDouble
* @see UFieldPosition
* @draft ICU 4.4
*/
U_DRAFT int32_t U_EXPORT2
unum_formatDecimal( const UNumberFormat* fmt,
const char * number,
int32_t length,
UChar* result,
int32_t resultLength,
UFieldPosition *pos, /* 0 if ignore */
UErrorCode* status);
/**
* Format a double currency amount using a UNumberFormat. * Format a double currency amount using a UNumberFormat.
* The double will be formatted according to the UNumberFormat's locale. * The double will be formatted according to the UNumberFormat's locale.
* @param fmt the formatter to use * @param fmt the formatter to use
* @param number the number to format * @param number the number to format
* @param currency the 3-letter null-terminated ISO 4217 currency code * @param currency the 3-letter null-terminated ISO 4217 currency code
* @param result a pointer to the buffer to receive the formatted number * @param result a pointer to the buffer to receive the formatted number
* @param resultLength the maximum number of UChars to write to result * @param resultLength the maximum number of UChars to write to result
* @param pos a pointer to a UFieldPosition. On input, * @param pos a pointer to a UFieldPosition. On input,
* position->field is read. On output, position->beginIndex and * position->field is read. On output, position->beginIndex and
* position->endIndex indicate the beginning and ending indices of * position->endIndex indicate the beginning and ending indices of
skipping to change at line 478 skipping to change at line 512
* @stable ICU 2.0 * @stable ICU 2.0
*/ */
U_STABLE double U_EXPORT2 U_STABLE double U_EXPORT2
unum_parseDouble( const UNumberFormat* fmt, unum_parseDouble( const UNumberFormat* fmt,
const UChar* text, const UChar* text,
int32_t textLength, int32_t textLength,
int32_t *parsePos /* 0 = start */, int32_t *parsePos /* 0 = start */,
UErrorCode *status); UErrorCode *status);
/** /**
* Parse a number from a string into an unformatted numeric string using a U
NumberFormat.
* The input string will be parsed according to the UNumberFormat's locale.
* The syntax of the output is a "numeric string"
* as defined in the Decimal Arithmetic Specification, available at
* http://speleotrove.com/decimal
* @param fmt The formatter to use.
* @param text The text to parse.
* @param textLength The length of text, or -1 if null-terminated.
* @param parsePos If not 0, on input a pointer to an integer specifying the
offset at which
* to begin parsing. If not 0, on output the offset at whic
h parsing ended.
* @param outBuf A (char *) buffer to receive the parsed number as a string.
The output string
* will be nul-terminated if there is sufficient space.
* @param outBufLength The size of the output buffer. May be zero, in which
case
* the outBuf pointer may be NULL, and the function will retur
n the
* size of the output string.
* @param status A pointer to an UErrorCode to receive any errors
* @return the length of the output string, not including any terminating nu
l.
* @see unum_parse
* @see unum_parseInt64
* @see unum_format
* @see unum_formatInt64
* @see unum_formatDouble
* @draft ICU 4.4
*/
U_DRAFT int32_t U_EXPORT2
unum_parseDecimal(const UNumberFormat* fmt,
const UChar* text,
int32_t textLength,
int32_t *parsePos /* 0 = start */,
char *outBuf,
int32_t outBufLength,
UErrorCode *status);
/**
* Parse a string into a double and a currency using a UNumberFormat. * Parse a string into a double and a currency using a UNumberFormat.
* The string will be parsed according to the UNumberFormat's locale. * The string will be parsed according to the UNumberFormat's locale.
* @param fmt the formatter to use * @param fmt the formatter to use
* @param text the text to parse * @param text the text to parse
* @param textLength the length of text, or -1 if null-terminated * @param textLength the length of text, or -1 if null-terminated
* @param parsePos a pointer to an offset index into text at which to * @param parsePos a pointer to an offset index into text at which to
* begin parsing. On output, *parsePos will point after the last * begin parsing. On output, *parsePos will point after the last
* parsed character. This parameter may be 0, in which case parsing * parsed character. This parameter may be 0, in which case parsing
* begins at offset 0. * begins at offset 0.
* @param currency a pointer to the buffer to receive the parsed null- * @param currency a pointer to the buffer to receive the parsed null-
 End of changes. 4 change blocks. 
2 lines changed or deleted 82 lines changed or added


 uobject.h   uobject.h 
/* /*
*************************************************************************** *** *************************************************************************** ***
* *
* Copyright (C) 2002-2009, International Business Machines * Copyright (C) 2002-2010, International Business Machines
* Corporation and others. All Rights Reserved. * Corporation and others. All Rights Reserved.
* *
*************************************************************************** *** *************************************************************************** ***
* file name: uobject.h * file name: uobject.h
* encoding: US-ASCII * encoding: US-ASCII
* tab size: 8 (not used) * tab size: 8 (not used)
* indentation:4 * indentation:4
* *
* created on: 2002jun26 * created on: 2002jun26
* created by: Markus W. Scherer * created by: Markus W. Scherer
skipping to change at line 66 skipping to change at line 66
* Define this to define the MFC debug * Define this to define the MFC debug
* version of the operator new. * version of the operator new.
* *
* @stable ICU 3.4 * @stable ICU 3.4
*/ */
#ifndef U_HAVE_DEBUG_LOCATION_NEW #ifndef U_HAVE_DEBUG_LOCATION_NEW
#define U_HAVE_DEBUG_LOCATION_NEW 0 #define U_HAVE_DEBUG_LOCATION_NEW 0
#endif #endif
/** /**
* @{
* \def U_NO_THROW * \def U_NO_THROW
* Define this to define the throw() specification so * Define this to define the throw() specification so
certain functions do not throw any exceptions * certain functions do not throw any exceptions
* *
* UMemory operator new methods should have the throw() specificati on * UMemory operator new methods should have the throw() specificati on
* appended to them, so that the compiler adds the additional NULL check * appended to them, so that the compiler adds the additional NULL check
* before calling constructors. Without, if <code>operator new</cod e> returns NULL the * before calling constructors. Without, if <code>operator new</cod e> returns NULL the
* constructor is still called, and if the constructor references m ember * constructor is still called, and if the constructor references m ember
* data, (which it typically does), the result is a segmentation vi olation. * data, (which it typically does), the result is a segmentation vi olation.
* *
* @draft ICU 4.2 * @draft ICU 4.2
*/ */
#ifndef U_NO_THROW #ifndef U_NO_THROW
#define U_NO_THROW throw() #define U_NO_THROW throw()
#endif #endif
/** @} */
/** /**
* UMemory is the common ICU base class. * UMemory is the common ICU base class.
* All other ICU C++ classes are derived from UMemory (starting with ICU 2. 4). * All other ICU C++ classes are derived from UMemory (starting with ICU 2. 4).
* *
* This is primarily to make it possible and simple to override the * This is primarily to make it possible and simple to override the
* C++ memory management by adding new/delete operators to this base class. * C++ memory management by adding new/delete operators to this base class.
* *
* To override ALL ICU memory management, including that from plain C code, * To override ALL ICU memory management, including that from plain C code,
* replace the allocation functions declared in cmemory.h * replace the allocation functions declared in cmemory.h
* *
 End of changes. 4 change blocks. 
2 lines changed or deleted 5 lines changed or added


 uregex.h   uregex.h 
skipping to change at line 178 skipping to change at line 178
/** /**
* Close the regular expression, recovering all resources (memory) it * Close the regular expression, recovering all resources (memory) it
* was holding. * was holding.
* *
* @param regexp The regular expression to be closed. * @param regexp The regular expression to be closed.
* @stable ICU 3.0 * @stable ICU 3.0
*/ */
U_STABLE void U_EXPORT2 U_STABLE void U_EXPORT2
uregex_close(URegularExpression *regexp); uregex_close(URegularExpression *regexp);
#ifdef XP_CPLUSPLUS #if U_SHOW_CPLUSPLUS_API
U_NAMESPACE_BEGIN U_NAMESPACE_BEGIN
/** /**
* \class LocalURegularExpressionPointer * \class LocalURegularExpressionPointer
* "Smart pointer" class, closes a URegularExpression via uregex_close(). * "Smart pointer" class, closes a URegularExpression via uregex_close().
* For most methods see the LocalPointerBase base class. * For most methods see the LocalPointerBase base class.
* *
* @see LocalPointerBase * @see LocalPointerBase
* @see LocalPointer * @see LocalPointer
skipping to change at line 786 skipping to change at line 786
int32_t *destCapacity, int32_t *destCapacity,
UErrorCode *status); UErrorCode *status);
/** /**
* Split a string into fields. Somewhat like split() from Perl. * Split a string into fields. Somewhat like split() from Perl.
* The pattern matches identify delimiters that separate the input * The pattern matches identify delimiters that separate the input
* into fields. The input data between the matches becomes the * into fields. The input data between the matches becomes the
* fields themselves. * fields themselves.
* <p> * <p>
* Each of the fields is copied from the input string to the destination * Each of the fields is copied from the input string to the destination
* buffer, and the NUL terminated. The position of each field within * buffer, and NUL terminated. The position of each field within
* the destination buffer is returned in the destFields array. * the destination buffer is returned in the destFields array.
* *
* Note: another choice for the design of this function would be to not
* copy the resulting fields at all, but to return indexes and
* lengths within the source text.
* Advantages would be
* o Faster. No Copying.
* o Nothing extra needed when field data may contain embedd
ed NUL chars.
* o Less memory needed if working on large data.
* Disadvantages
* o Less consistent with C++ split, which copies into an
* array of UnicodeStrings.
* o No NUL termination, extracted fields would be less conv
enient
* to use in most cases.
* o Possible problems in the future, when support Unicode N
ormalization
* could cause the fields to not correspond exactly to
* a range of the source text.
*
* @param regexp The compiled regular expression. * @param regexp The compiled regular expression.
* @param destBuf A (UChar *) buffer to receive the fields that * @param destBuf A (UChar *) buffer to receive the fields that
* are extracted from the input string. These * are extracted from the input string. These
* field pointers will refer to positions within the * field pointers will refer to positions within the
* destination buffer supplied by the caller. An y * destination buffer supplied by the caller. An y
* extra positions within the destFields array wi ll be * extra positions within the destFields array wi ll be
* set to NULL. * set to NULL.
* @param destCapacity The capacity of the destBuf. * @param destCapacity The capacity of the destBuf.
* @param requiredCapacity The actual capacity required of the dest Buf. * @param requiredCapacity The actual capacity required of the dest Buf.
* If destCapacity is too small, requiredCapacity will return * If destCapacity is too small, requiredCapacity will return
 End of changes. 3 change blocks. 
21 lines changed or deleted 2 lines changed or added


 ures.h   ures.h 
skipping to change at line 241 skipping to change at line 241
* Close a resource bundle, all pointers returned from the various ures_get XXX calls * Close a resource bundle, all pointers returned from the various ures_get XXX calls
* on this particular bundle should be considered invalid henceforth. * on this particular bundle should be considered invalid henceforth.
* *
* @param resourceBundle a pointer to a resourceBundle struct. Can be NULL. * @param resourceBundle a pointer to a resourceBundle struct. Can be NULL.
* @see ures_open * @see ures_open
* @stable ICU 2.0 * @stable ICU 2.0
*/ */
U_STABLE void U_EXPORT2 U_STABLE void U_EXPORT2
ures_close(UResourceBundle* resourceBundle); ures_close(UResourceBundle* resourceBundle);
#ifdef XP_CPLUSPLUS #if U_SHOW_CPLUSPLUS_API
U_NAMESPACE_BEGIN U_NAMESPACE_BEGIN
/** /**
* \class LocalUResourceBundlePointer * \class LocalUResourceBundlePointer
* "Smart pointer" class, closes a UResourceBundle via ures_close(). * "Smart pointer" class, closes a UResourceBundle via ures_close().
* For most methods see the LocalPointerBase base class. * For most methods see the LocalPointerBase base class.
* *
* @see LocalPointerBase * @see LocalPointerBase
* @see LocalPointer * @see LocalPointer
skipping to change at line 776 skipping to change at line 776
* @see u_strToUTF8 * @see u_strToUTF8
* @stable ICU 3.6 * @stable ICU 3.6
*/ */
U_STABLE const char * U_EXPORT2 U_STABLE const char * U_EXPORT2
ures_getUTF8StringByKey(const UResourceBundle *resB, ures_getUTF8StringByKey(const UResourceBundle *resB,
const char *key, const char *key,
char *dest, int32_t *pLength, char *dest, int32_t *pLength,
UBool forceCopy, UBool forceCopy,
UErrorCode *status); UErrorCode *status);
#ifdef XP_CPLUSPLUS #if U_SHOW_CPLUSPLUS_API
#include "unicode/unistr.h" #include "unicode/unistr.h"
U_NAMESPACE_BEGIN U_NAMESPACE_BEGIN
/** /**
* returns a string from a string resource type * returns a string from a string resource type
* *
* @param resB a resource * @param resB a resource
* @param status: fills in the outgoing error code * @param status: fills in the outgoing error code
* could be <TT>U_MISSING_RESOURCE_ERROR</TT> if the key is not found * could be <TT>U_MISSING_RESOURCE_ERROR</TT> if the key is not found
* could be a non-failing error * could be a non-failing error
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 usearch.h   usearch.h 
/* /*
********************************************************************** **********************************************************************
* Copyright (C) 2001-2009 IBM and others. All rights reserved. * Copyright (C) 2001-2010 IBM and others. All rights reserved.
********************************************************************** **********************************************************************
* Date Name Description * Date Name Description
* 06/28/2001 synwee Creation. * 06/28/2001 synwee Creation.
********************************************************************** **********************************************************************
*/ */
#ifndef USEARCH_H #ifndef USEARCH_H
#define USEARCH_H #define USEARCH_H
#include "unicode/utypes.h" #include "unicode/utypes.h"
skipping to change at line 160 skipping to change at line 160
*/ */
typedef struct UStringSearch UStringSearch; typedef struct UStringSearch UStringSearch;
/** /**
* @stable ICU 2.4 * @stable ICU 2.4
*/ */
typedef enum { typedef enum {
/** Option for overlapping matches */ /** Option for overlapping matches */
USEARCH_OVERLAP, USEARCH_OVERLAP,
/** /**
Option for canonical matches. option 1 in header documentation. * Option for canonical matches. option 1 in header documentation.
The default value will be USEARCH_OFF * The default value will be USEARCH_OFF
*/ */
USEARCH_CANONICAL_MATCH, USEARCH_CANONICAL_MATCH,
/**
* Option to control how collation elements are compared.
* The default value will be USEARCH_STANDARD_ELEMENT_COMPARISON.
* @draft ICU 4.4
*/
USEARCH_ELEMENT_COMPARISON,
USEARCH_ATTRIBUTE_COUNT USEARCH_ATTRIBUTE_COUNT
} USearchAttribute; } USearchAttribute;
/** /**
* @stable ICU 2.4 * @stable ICU 2.4
*/ */
typedef enum { typedef enum {
/** default value for any USearchAttribute */ /** Default value for any USearchAttribute */
USEARCH_DEFAULT = -1, USEARCH_DEFAULT = -1,
/** value for USEARCH_OVERLAP and USEARCH_CANONICAL_MATCH */ /** Value for USEARCH_OVERLAP and USEARCH_CANONICAL_MATCH */
USEARCH_OFF, USEARCH_OFF,
/** value for USEARCH_OVERLAP and USEARCH_CANONICAL_MATCH */ /** Value for USEARCH_OVERLAP and USEARCH_CANONICAL_MATCH */
USEARCH_ON, USEARCH_ON,
/**
* Value (default) for USEARCH_ELEMENT_COMPARISON;
* standard collation element comparison at the specified collator
* strength.
* @draft ICU 4.4
*/
USEARCH_STANDARD_ELEMENT_COMPARISON,
/**
* Value for USEARCH_ELEMENT_COMPARISON;
* collation element comparison is modified to effectively provide
* behavior between the specified strength and strength - 1. Collation
* elements in the pattern that have the base weight for the specified
* strength are treated as "wildcards" that match an element with any
* other weight at that collation level in the searched text. For
* example, with a secondary-strength English collator, a plain 'e' in
* the pattern will match a plain e or an e with any diacritic in the
* searched text, but an e with diacritic in the pattern will only
* match an e with the same diacritic in the searched text.
* @draft ICU 4.4
*/
USEARCH_PATTERN_BASE_WEIGHT_IS_WILDCARD,
/**
* Value for USEARCH_ELEMENT_COMPARISON.
* collation element comparison is modified to effectively provide
* behavior between the specified strength and strength - 1. Collation
* elements in either the pattern or the searched text that have the
* base weight for the specified strength are treated as "wildcards"
* that match an element with any other weight at that collation level.
* For example, with a secondary-strength English collator, a plain 'e'
* in the pattern will match a plain e or an e with any diacritic in th
e
* searched text, but an e with diacritic in the pattern will only
* match an e with the same diacritic or a plain e in the searched text
.
* @draft ICU 4.4
*/
USEARCH_ANY_BASE_WEIGHT_IS_WILDCARD,
USEARCH_ATTRIBUTE_VALUE_COUNT USEARCH_ATTRIBUTE_VALUE_COUNT
} USearchAttributeValue; } USearchAttributeValue;
/* open and close ------------------------------------------------------ */ /* open and close ------------------------------------------------------ */
/** /**
* Creating a search iterator data struct using the argument locale language * Creating a search iterator data struct using the argument locale language
* rule set. A collator will be created in the process, which will be owned by * rule set. A collator will be created in the process, which will be owned by
* this search and will be deleted in <tt>usearch_close</tt>. * this search and will be deleted in <tt>usearch_close</tt>.
* @param pattern for matching * @param pattern for matching
skipping to change at line 253 skipping to change at line 296
UErrorCode *status); UErrorCode *status);
/** /**
* Destroying and cleaning up the search iterator data struct. * Destroying and cleaning up the search iterator data struct.
* If a collator is created in <tt>usearch_open</tt>, it will be destroyed h ere. * If a collator is created in <tt>usearch_open</tt>, it will be destroyed h ere.
* @param searchiter data struct to clean up * @param searchiter data struct to clean up
* @stable ICU 2.4 * @stable ICU 2.4
*/ */
U_STABLE void U_EXPORT2 usearch_close(UStringSearch *searchiter); U_STABLE void U_EXPORT2 usearch_close(UStringSearch *searchiter);
#ifdef XP_CPLUSPLUS #if U_SHOW_CPLUSPLUS_API
U_NAMESPACE_BEGIN U_NAMESPACE_BEGIN
/** /**
* \class LocalUStringSearchPointer * \class LocalUStringSearchPointer
* "Smart pointer" class, closes a UStringSearch via usearch_close(). * "Smart pointer" class, closes a UStringSearch via usearch_close().
* For most methods see the LocalPointerBase base class. * For most methods see the LocalPointerBase base class.
* *
* @see LocalPointerBase * @see LocalPointerBase
* @see LocalPointer * @see LocalPointer
 End of changes. 8 change blocks. 
8 lines changed or deleted 53 lines changed or added


 uset.h   uset.h 
/* /*
*************************************************************************** **** *************************************************************************** ****
* *
* Copyright (C) 2002-2009, International Business Machines * Copyright (C) 2002-2010, International Business Machines
* Corporation and others. All Rights Reserved. * Corporation and others. All Rights Reserved.
* *
*************************************************************************** **** *************************************************************************** ****
* file name: uset.h * file name: uset.h
* encoding: US-ASCII * encoding: US-ASCII
* tab size: 8 (not used) * tab size: 8 (not used)
* indentation:4 * indentation:4
* *
* created on: 2002mar07 * created on: 2002mar07
* created by: Markus W. Scherer * created by: Markus W. Scherer
skipping to change at line 246 skipping to change at line 246
/********************************************************************* /*********************************************************************
* USet API * USet API
*********************************************************************/ *********************************************************************/
/** /**
* Create an empty USet object. * Create an empty USet object.
* Equivalent to uset_open(1, 0). * Equivalent to uset_open(1, 0).
* @return a newly created USet. The caller must call uset_close() on * @return a newly created USet. The caller must call uset_close() on
* it when done. * it when done.
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
U_DRAFT USet* U_EXPORT2 U_STABLE USet* U_EXPORT2
uset_openEmpty(); uset_openEmpty();
/** /**
* Creates a USet object that contains the range of characters * Creates a USet object that contains the range of characters
* start..end, inclusive. If <code>start > end</code> * start..end, inclusive. If <code>start > end</code>
* then an empty set is created (same as using uset_openEmpty()). * then an empty set is created (same as using uset_openEmpty()).
* @param start first character of the range, inclusive * @param start first character of the range, inclusive
* @param end last character of the range, inclusive * @param end last character of the range, inclusive
* @return a newly created USet. The caller must call uset_close() on * @return a newly created USet. The caller must call uset_close() on
* it when done. * it when done.
skipping to change at line 302 skipping to change at line 302
/** /**
* Disposes of the storage used by a USet object. This function should * Disposes of the storage used by a USet object. This function should
* be called exactly once for objects returned by uset_open(). * be called exactly once for objects returned by uset_open().
* @param set the object to dispose of * @param set the object to dispose of
* @stable ICU 2.4 * @stable ICU 2.4
*/ */
U_STABLE void U_EXPORT2 U_STABLE void U_EXPORT2
uset_close(USet* set); uset_close(USet* set);
#ifdef XP_CPLUSPLUS #if U_SHOW_CPLUSPLUS_API
U_NAMESPACE_BEGIN U_NAMESPACE_BEGIN
/** /**
* \class LocalUSetPointer * \class LocalUSetPointer
* "Smart pointer" class, closes a USet via uset_close(). * "Smart pointer" class, closes a USet via uset_close().
* For most methods see the LocalPointerBase base class. * For most methods see the LocalPointerBase base class.
* *
* @see LocalPointerBase * @see LocalPointerBase
* @see LocalPointer * @see LocalPointer
skipping to change at line 330 skipping to change at line 330
/** /**
* Returns a copy of this object. * Returns a copy of this object.
* If this set is frozen, then the clone will be frozen as well. * If this set is frozen, then the clone will be frozen as well.
* Use uset_cloneAsThawed() for a mutable clone of a frozen set. * Use uset_cloneAsThawed() for a mutable clone of a frozen set.
* @param set the original set * @param set the original set
* @return the newly allocated copy of the set * @return the newly allocated copy of the set
* @see uset_cloneAsThawed * @see uset_cloneAsThawed
* @stable ICU 3.8 * @stable ICU 3.8
*/ */
U_DRAFT USet * U_EXPORT2 U_STABLE USet * U_EXPORT2
uset_clone(const USet *set); uset_clone(const USet *set);
/** /**
* Determines whether the set has been frozen (made immutable) or not. * Determines whether the set has been frozen (made immutable) or not.
* See the ICU4J Freezable interface for details. * See the ICU4J Freezable interface for details.
* @param set the set * @param set the set
* @return TRUE/FALSE for whether the set has been frozen * @return TRUE/FALSE for whether the set has been frozen
* @see uset_freeze * @see uset_freeze
* @see uset_cloneAsThawed * @see uset_cloneAsThawed
* @stable ICU 3.8 * @stable ICU 3.8
*/ */
U_DRAFT UBool U_EXPORT2 U_STABLE UBool U_EXPORT2
uset_isFrozen(const USet *set); uset_isFrozen(const USet *set);
/** /**
* Freeze the set (make it immutable). * Freeze the set (make it immutable).
* Once frozen, it cannot be unfrozen and is therefore thread-safe * Once frozen, it cannot be unfrozen and is therefore thread-safe
* until it is deleted. * until it is deleted.
* See the ICU4J Freezable interface for details. * See the ICU4J Freezable interface for details.
* Freezing the set may also make some operations faster, for example * Freezing the set may also make some operations faster, for example
* uset_contains() and uset_span(). * uset_contains() and uset_span().
* A frozen set will not be modified. (It remains frozen.) * A frozen set will not be modified. (It remains frozen.)
* @param set the set * @param set the set
* @return the same set, now frozen * @return the same set, now frozen
* @see uset_isFrozen * @see uset_isFrozen
* @see uset_cloneAsThawed * @see uset_cloneAsThawed
* @stable ICU 3.8 * @stable ICU 3.8
*/ */
U_DRAFT void U_EXPORT2 U_STABLE void U_EXPORT2
uset_freeze(USet *set); uset_freeze(USet *set);
/** /**
* Clone the set and make the clone mutable. * Clone the set and make the clone mutable.
* See the ICU4J Freezable interface for details. * See the ICU4J Freezable interface for details.
* @param set the set * @param set the set
* @return the mutable clone * @return the mutable clone
* @see uset_freeze * @see uset_freeze
* @see uset_isFrozen * @see uset_isFrozen
* @see uset_clone * @see uset_clone
* @stable ICU 3.8 * @stable ICU 3.8
*/ */
U_DRAFT USet * U_EXPORT2 U_STABLE USet * U_EXPORT2
uset_cloneAsThawed(const USet *set); uset_cloneAsThawed(const USet *set);
/** /**
* Causes the USet object to represent the range <code>start - end</code>. * Causes the USet object to represent the range <code>start - end</code>.
* If <code>start > end</code> then this USet is set to an empty range. * If <code>start > end</code> then this USet is set to an empty range.
* A frozen set will not be modified. * A frozen set will not be modified.
* @param set the object to set to the given range * @param set the object to set to the given range
* @param start first character in the set, inclusive * @param start first character in the set, inclusive
* @param end last character in the set, inclusive * @param end last character in the set, inclusive
* @stable ICU 3.2 * @stable ICU 3.2
skipping to change at line 729 skipping to change at line 729
* == b denotes that the contents are the same, not pointer * == b denotes that the contents are the same, not pointer
* comparison.) * comparison.)
* *
* A frozen set will not be modified. * A frozen set will not be modified.
* *
* @param set the set * @param set the set
* *
* @param attributes bitmask for attributes to close over. * @param attributes bitmask for attributes to close over.
* Currently only the USET_CASE bit is supported. Any undefined bits * Currently only the USET_CASE bit is supported. Any undefined bits
* are ignored. * are ignored.
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
U_DRAFT void U_EXPORT2 U_STABLE void U_EXPORT2
uset_closeOver(USet* set, int32_t attributes); uset_closeOver(USet* set, int32_t attributes);
/** /**
* Remove all strings from this set. * Remove all strings from this set.
* *
* @param set the set * @param set the set
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
U_DRAFT void U_EXPORT2 U_STABLE void U_EXPORT2
uset_removeAllStrings(USet* set); uset_removeAllStrings(USet* set);
/** /**
* Returns TRUE if the given USet contains no characters and no * Returns TRUE if the given USet contains no characters and no
* strings. * strings.
* @param set the set * @param set the set
* @return true if set is empty * @return true if set is empty
* @stable ICU 2.4 * @stable ICU 2.4
*/ */
U_STABLE UBool U_EXPORT2 U_STABLE UBool U_EXPORT2
skipping to change at line 924 skipping to change at line 924
* This function works faster with a frozen set and with a non-negative str ing length argument. * This function works faster with a frozen set and with a non-negative str ing length argument.
* @param set the set * @param set the set
* @param s start of the string * @param s start of the string
* @param length of the string; can be -1 for NUL-terminated * @param length of the string; can be -1 for NUL-terminated
* @param spanCondition specifies the containment condition * @param spanCondition specifies the containment condition
* @return the length of the initial substring according to the spanConditi on; * @return the length of the initial substring according to the spanConditi on;
* 0 if the start of the string does not fit the spanCondition * 0 if the start of the string does not fit the spanCondition
* @stable ICU 3.8 * @stable ICU 3.8
* @see USetSpanCondition * @see USetSpanCondition
*/ */
U_DRAFT int32_t U_EXPORT2 U_STABLE int32_t U_EXPORT2
uset_span(const USet *set, const UChar *s, int32_t length, USetSpanConditio n spanCondition); uset_span(const USet *set, const UChar *s, int32_t length, USetSpanConditio n spanCondition);
/** /**
* Returns the start of the trailing substring of the input string which * Returns the start of the trailing substring of the input string which
* consists only of characters and strings that are contained in this set * consists only of characters and strings that are contained in this set
* (USET_SPAN_CONTAINED, USET_SPAN_SIMPLE), * (USET_SPAN_CONTAINED, USET_SPAN_SIMPLE),
* or only of characters and strings that are not contained * or only of characters and strings that are not contained
* in this set (USET_SPAN_NOT_CONTAINED). * in this set (USET_SPAN_NOT_CONTAINED).
* See USetSpanCondition for details. * See USetSpanCondition for details.
* Unpaired surrogates are treated according to contains() of their surroga te code points. * Unpaired surrogates are treated according to contains() of their surroga te code points.
* This function works faster with a frozen set and with a non-negative str ing length argument. * This function works faster with a frozen set and with a non-negative str ing length argument.
* @param set the set * @param set the set
* @param s start of the string * @param s start of the string
* @param length of the string; can be -1 for NUL-terminated * @param length of the string; can be -1 for NUL-terminated
* @param spanCondition specifies the containment condition * @param spanCondition specifies the containment condition
* @return the start of the trailing substring according to the spanConditi on; * @return the start of the trailing substring according to the spanConditi on;
* the string length if the end of the string does not fit the span Condition * the string length if the end of the string does not fit the span Condition
* @stable ICU 3.8 * @stable ICU 3.8
* @see USetSpanCondition * @see USetSpanCondition
*/ */
U_DRAFT int32_t U_EXPORT2 U_STABLE int32_t U_EXPORT2
uset_spanBack(const USet *set, const UChar *s, int32_t length, USetSpanCond ition spanCondition); uset_spanBack(const USet *set, const UChar *s, int32_t length, USetSpanCond ition spanCondition);
/** /**
* Returns the length of the initial substring of the input string which * Returns the length of the initial substring of the input string which
* consists only of characters and strings that are contained in this set * consists only of characters and strings that are contained in this set
* (USET_SPAN_CONTAINED, USET_SPAN_SIMPLE), * (USET_SPAN_CONTAINED, USET_SPAN_SIMPLE),
* or only of characters and strings that are not contained * or only of characters and strings that are not contained
* in this set (USET_SPAN_NOT_CONTAINED). * in this set (USET_SPAN_NOT_CONTAINED).
* See USetSpanCondition for details. * See USetSpanCondition for details.
* Similar to the strspn() C library function. * Similar to the strspn() C library function.
skipping to change at line 967 skipping to change at line 967
* This function works faster with a frozen set and with a non-negative str ing length argument. * This function works faster with a frozen set and with a non-negative str ing length argument.
* @param set the set * @param set the set
* @param s start of the string (UTF-8) * @param s start of the string (UTF-8)
* @param length of the string; can be -1 for NUL-terminated * @param length of the string; can be -1 for NUL-terminated
* @param spanCondition specifies the containment condition * @param spanCondition specifies the containment condition
* @return the length of the initial substring according to the spanConditi on; * @return the length of the initial substring according to the spanConditi on;
* 0 if the start of the string does not fit the spanCondition * 0 if the start of the string does not fit the spanCondition
* @stable ICU 3.8 * @stable ICU 3.8
* @see USetSpanCondition * @see USetSpanCondition
*/ */
U_DRAFT int32_t U_EXPORT2 U_STABLE int32_t U_EXPORT2
uset_spanUTF8(const USet *set, const char *s, int32_t length, USetSpanCondi tion spanCondition); uset_spanUTF8(const USet *set, const char *s, int32_t length, USetSpanCondi tion spanCondition);
/** /**
* Returns the start of the trailing substring of the input string which * Returns the start of the trailing substring of the input string which
* consists only of characters and strings that are contained in this set * consists only of characters and strings that are contained in this set
* (USET_SPAN_CONTAINED, USET_SPAN_SIMPLE), * (USET_SPAN_CONTAINED, USET_SPAN_SIMPLE),
* or only of characters and strings that are not contained * or only of characters and strings that are not contained
* in this set (USET_SPAN_NOT_CONTAINED). * in this set (USET_SPAN_NOT_CONTAINED).
* See USetSpanCondition for details. * See USetSpanCondition for details.
* Malformed byte sequences are treated according to contains(0xfffd). * Malformed byte sequences are treated according to contains(0xfffd).
* This function works faster with a frozen set and with a non-negative str ing length argument. * This function works faster with a frozen set and with a non-negative str ing length argument.
* @param set the set * @param set the set
* @param s start of the string (UTF-8) * @param s start of the string (UTF-8)
* @param length of the string; can be -1 for NUL-terminated * @param length of the string; can be -1 for NUL-terminated
* @param spanCondition specifies the containment condition * @param spanCondition specifies the containment condition
* @return the start of the trailing substring according to the spanConditi on; * @return the start of the trailing substring according to the spanConditi on;
* the string length if the end of the string does not fit the span Condition * the string length if the end of the string does not fit the span Condition
* @stable ICU 3.8 * @stable ICU 3.8
* @see USetSpanCondition * @see USetSpanCondition
*/ */
U_DRAFT int32_t U_EXPORT2 U_STABLE int32_t U_EXPORT2
uset_spanBackUTF8(const USet *set, const char *s, int32_t length, USetSpanC ondition spanCondition); uset_spanBackUTF8(const USet *set, const char *s, int32_t length, USetSpanC ondition spanCondition);
/** /**
* Returns true if set1 contains all of the characters and strings * Returns true if set1 contains all of the characters and strings
* of set2, and vis versa. It answers the question, 'Is set1 equal to set2? ' * of set2, and vis versa. It answers the question, 'Is set1 equal to set2? '
* @param set1 set to be checked for containment * @param set1 set to be checked for containment
* @param set2 set to be checked for containment * @param set2 set to be checked for containment
* @return true if the test condition is met * @return true if the test condition is met
* @stable ICU 3.2 * @stable ICU 3.2
*/ */
 End of changes. 16 change blocks. 
16 lines changed or deleted 16 lines changed or added


 usprep.h   usprep.h 
/* /*
************************************************************************** ***** ************************************************************************** *****
* *
* Copyright (C) 2003-2009, International Business Machines * Copyright (C) 2003-2010, International Business Machines
* Corporation and others. All Rights Reserved. * Corporation and others. All Rights Reserved.
* *
************************************************************************** ***** ************************************************************************** *****
* file name: usprep.h * file name: usprep.h
* encoding: US-ASCII * encoding: US-ASCII
* tab size: 8 (not used) * tab size: 8 (not used)
* indentation:4 * indentation:4
* *
* created on: 2003jul2 * created on: 2003jul2
* created by: Ram Viswanadha * created by: Ram Viswanadha
skipping to change at line 90 skipping to change at line 90
* *
* @see usprep_prepare * @see usprep_prepare
* @stable ICU 2.8 * @stable ICU 2.8
*/ */
#define USPREP_ALLOW_UNASSIGNED 0x0001 #define USPREP_ALLOW_UNASSIGNED 0x0001
/** /**
* enums for the standard stringprep profile types * enums for the standard stringprep profile types
* supported by usprep_openByType. * supported by usprep_openByType.
* @see usprep_openByType * @see usprep_openByType
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
typedef enum UStringPrepProfileType { typedef enum UStringPrepProfileType {
/** /**
* RFC3491 Nameprep * RFC3491 Nameprep
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
USPREP_RFC3491_NAMEPREP, USPREP_RFC3491_NAMEPREP,
/** /**
* RFC3530 nfs4_cs_prep * RFC3530 nfs4_cs_prep
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
USPREP_RFC3530_NFS4_CS_PREP, USPREP_RFC3530_NFS4_CS_PREP,
/** /**
* RFC3530 nfs4_cs_prep with case insensitive option * RFC3530 nfs4_cs_prep with case insensitive option
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
USPREP_RFC3530_NFS4_CS_PREP_CI, USPREP_RFC3530_NFS4_CS_PREP_CI,
/** /**
* RFC3530 nfs4_cis_prep * RFC3530 nfs4_cis_prep
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
USPREP_RFC3530_NFS4_CIS_PREP, USPREP_RFC3530_NFS4_CIS_PREP,
/** /**
* RFC3530 nfs4_mixed_prep for prefix * RFC3530 nfs4_mixed_prep for prefix
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
USPREP_RFC3530_NFS4_MIXED_PREP_PREFIX, USPREP_RFC3530_NFS4_MIXED_PREP_PREFIX,
/** /**
* RFC3530 nfs4_mixed_prep for suffix * RFC3530 nfs4_mixed_prep for suffix
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
USPREP_RFC3530_NFS4_MIXED_PREP_SUFFIX, USPREP_RFC3530_NFS4_MIXED_PREP_SUFFIX,
/** /**
* RFC3722 iSCSI * RFC3722 iSCSI
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
USPREP_RFC3722_ISCSI, USPREP_RFC3722_ISCSI,
/** /**
* RFC3920 XMPP Nodeprep * RFC3920 XMPP Nodeprep
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
USPREP_RFC3920_NODEPREP, USPREP_RFC3920_NODEPREP,
/** /**
* RFC3920 XMPP Resourceprep * RFC3920 XMPP Resourceprep
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
USPREP_RFC3920_RESOURCEPREP, USPREP_RFC3920_RESOURCEPREP,
/** /**
* RFC4011 Policy MIB Stringprep * RFC4011 Policy MIB Stringprep
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
USPREP_RFC4011_MIB, USPREP_RFC4011_MIB,
/** /**
* RFC4013 SASLprep * RFC4013 SASLprep
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
USPREP_RFC4013_SASLPREP, USPREP_RFC4013_SASLPREP,
/** /**
* RFC4505 trace * RFC4505 trace
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
USPREP_RFC4505_TRACE, USPREP_RFC4505_TRACE,
/** /**
* RFC4518 LDAP * RFC4518 LDAP
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
USPREP_RFC4518_LDAP, USPREP_RFC4518_LDAP,
/** /**
* RFC4518 LDAP for case ignore, numeric and stored prefix * RFC4518 LDAP for case ignore, numeric and stored prefix
* matching rules * matching rules
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
USPREP_RFC4518_LDAP_CI USPREP_RFC4518_LDAP_CI
} UStringPrepProfileType; } UStringPrepProfileType;
/** /**
* Creates a StringPrep profile from the data file. * Creates a StringPrep profile from the data file.
* *
* @param path string containing the full path pointing to the directo ry * @param path string containing the full path pointing to the directo ry
* where the profile reside followed by the package name * where the profile reside followed by the package name
* e.g. "/usr/resource/my_app/profiles/mydata" on a Unix s ystem. * e.g. "/usr/resource/my_app/profiles/mydata" on a Unix s ystem.
skipping to change at line 195 skipping to change at line 195
/** /**
* Creates a StringPrep profile for the specified profile type. * Creates a StringPrep profile for the specified profile type.
* *
* @param type The profile type * @param type The profile type
* @param status ICU error code in/out parameter. Must not be NULL. * @param status ICU error code in/out parameter. Must not be NULL.
* Must fulfill U_SUCCESS before the function call. * Must fulfill U_SUCCESS before the function call.
* @return Pointer to UStringPrepProfile that is opened. Should be closed by * @return Pointer to UStringPrepProfile that is opened. Should be closed by
* calling usprep_close() * calling usprep_close()
* @see usprep_close() * @see usprep_close()
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
U_DRAFT UStringPrepProfile* U_EXPORT2 U_STABLE UStringPrepProfile* U_EXPORT2
usprep_openByType(UStringPrepProfileType type, usprep_openByType(UStringPrepProfileType type,
UErrorCode* status); UErrorCode* status);
/** /**
* Closes the profile * Closes the profile
* @param profile The profile to close * @param profile The profile to close
* @stable ICU 2.8 * @stable ICU 2.8
*/ */
U_STABLE void U_EXPORT2 U_STABLE void U_EXPORT2
usprep_close(UStringPrepProfile* profile); usprep_close(UStringPrepProfile* profile);
#ifdef XP_CPLUSPLUS #if U_SHOW_CPLUSPLUS_API
U_NAMESPACE_BEGIN U_NAMESPACE_BEGIN
/** /**
* \class LocalUStringPrepProfilePointer * \class LocalUStringPrepProfilePointer
* "Smart pointer" class, closes a UStringPrepProfile via usprep_close(). * "Smart pointer" class, closes a UStringPrepProfile via usprep_close().
* For most methods see the LocalPointerBase base class. * For most methods see the LocalPointerBase base class.
* *
* @see LocalPointerBase * @see LocalPointerBase
* @see LocalPointer * @see LocalPointer
 End of changes. 19 change blocks. 
19 lines changed or deleted 19 lines changed or added


 ustdio.h   ustdio.h 
/* /*
*************************************************************************** *** *************************************************************************** ***
* *
* Copyright (C) 1998-2009, International Business Machines * Copyright (C) 1998-2010, International Business Machines
* Corporation and others. All Rights Reserved. * Corporation and others. All Rights Reserved.
* *
*************************************************************************** *** *************************************************************************** ***
* *
* File ustdio.h * File ustdio.h
* *
* Modification History: * Modification History:
* *
* Date Name Description * Date Name Description
* 10/16/98 stephen Creation. * 10/16/98 stephen Creation.
skipping to change at line 243 skipping to change at line 243
* @return A new UFILE, or NULL if an error occurred. * @return A new UFILE, or NULL if an error occurred.
* @stable ICU 3.0 * @stable ICU 3.0
*/ */
U_DRAFT UFILE* U_EXPORT2 U_DRAFT UFILE* U_EXPORT2
u_fopen(const char *filename, u_fopen(const char *filename,
const char *perm, const char *perm,
const char *locale, const char *locale,
const char *codepage); const char *codepage);
/** /**
* Open a UFILE on top of an existing FILE* stream. * Open a UFILE on top of an existing FILE* stream. The FILE* stream
* @param f The FILE* to which this UFILE will attach. * ownership remains with the caller. To have the UFILE take over
* ownership and responsibility for the FILE* stream, use the
* function u_fadopt.
* @param f The FILE* to which this UFILE will attach and use.
* @param locale The locale whose conventions will be used to format * @param locale The locale whose conventions will be used to format
* and parse output. If this parameter is NULL, the default locale will * and parse output. If this parameter is NULL, the default locale will
* be used. * be used.
* @param codepage The codepage in which data will be written to and * @param codepage The codepage in which data will be written to and
* read from the file. If this paramter is NULL, data will be written and * read from the file. If this paramter is NULL, data will be written and
* read using the default codepage for <TT>locale</TT>, unless <TT>locale</ TT> * read using the default codepage for <TT>locale</TT>, unless <TT>locale</ TT>
* is NULL, in which case the system default codepage will be used. * is NULL, in which case the system default codepage will be used.
* @return A new UFILE, or NULL if an error occurred. * @return A new UFILE, or NULL if an error occurred.
* @stable ICU 3.0 * @stable ICU 3.0
*/ */
U_DRAFT UFILE* U_EXPORT2 U_DRAFT UFILE* U_EXPORT2
u_finit(FILE *f, u_finit(FILE *f,
const char *locale, const char *locale,
const char *codepage); const char *codepage);
/** /**
* Open a UFILE on top of an existing FILE* stream. The FILE* stream
* ownership is transferred to the new UFILE. It will be closed when the
* UFILE is closed.
* @param f The FILE* which this UFILE will take ownership of.
* @param locale The locale whose conventions will be used to format
* and parse output. If this parameter is NULL, the default locale will
* be used.
* @param codepage The codepage in which data will be written to and
* read from the file. If this paramter is NULL, data will be written and
* read using the default codepage for <TT>locale</TT>, unless <TT>locale</
TT>
* is NULL, in which case the system default codepage will be used.
* @return A new UFILE, or NULL if an error occurred. If an error occurs
* the ownership of the FILE* stream remains with the caller.
* @draft ICU 4.4
*/
U_DRAFT UFILE* U_EXPORT2
u_fadopt(FILE *f,
const char *locale,
const char *codepage);
/**
* Create a UFILE that can be used for localized formatting or parsing. * Create a UFILE that can be used for localized formatting or parsing.
* The u_sprintf and u_sscanf functions do not read or write numbers for a * The u_sprintf and u_sscanf functions do not read or write numbers for a
* specific locale. The ustdio.h file functions can be used on this UFILE. * specific locale. The ustdio.h file functions can be used on this UFILE.
* The string is usable once u_fclose or u_fflush has been called on the * The string is usable once u_fclose or u_fflush has been called on the
* returned UFILE. * returned UFILE.
* @param stringBuf The string used for reading or writing. * @param stringBuf The string used for reading or writing.
* @param capacity The number of code units available for use in stringBuf * @param capacity The number of code units available for use in stringBuf
* @param locale The locale whose conventions will be used to format * @param locale The locale whose conventions will be used to format
* and parse output. If this parameter is NULL, the default locale will * and parse output. If this parameter is NULL, the default locale will
* be used. * be used.
skipping to change at line 287 skipping to change at line 311
const char *locale); const char *locale);
/** /**
* Close a UFILE. * Close a UFILE.
* @param file The UFILE to close. * @param file The UFILE to close.
* @stable ICU 3.0 * @stable ICU 3.0
*/ */
U_DRAFT void U_EXPORT2 U_DRAFT void U_EXPORT2
u_fclose(UFILE *file); u_fclose(UFILE *file);
#ifdef XP_CPLUSPLUS #if U_SHOW_CPLUSPLUS_API
U_NAMESPACE_BEGIN U_NAMESPACE_BEGIN
/** /**
* \class LocalUFILEPointer * \class LocalUFILEPointer
* "Smart pointer" class, closes a UFILE via u_fclose(). * "Smart pointer" class, closes a UFILE via u_fclose().
* For most methods see the LocalPointerBase base class. * For most methods see the LocalPointerBase base class.
* *
* @see LocalPointerBase * @see LocalPointerBase
* @see LocalPointer * @see LocalPointer
 End of changes. 4 change blocks. 
4 lines changed or deleted 29 lines changed or added


 ustring.h   ustring.h 
/* /*
********************************************************************** **********************************************************************
* Copyright (C) 1998-2009, International Business Machines * Copyright (C) 1998-2010, International Business Machines
* Corporation and others. All Rights Reserved. * Corporation and others. All Rights Reserved.
********************************************************************** **********************************************************************
* *
* File ustring.h * File ustring.h
* *
* Modification History: * Modification History:
* *
* Date Name Description * Date Name Description
* 12/07/98 bertrand Creation. * 12/07/98 bertrand Creation.
*************************************************************************** *** *************************************************************************** ***
skipping to change at line 1549 skipping to change at line 1549
* @param pNumSubstitutions Output parameter receiving the number of substi tutions if subchar>=0. * @param pNumSubstitutions Output parameter receiving the number of substi tutions if subchar>=0.
* Set to 0 if no substitutions occur or subchar<0. * Set to 0 if no substitutions occur or subchar<0.
* pNumSubstitutions can be NULL. * pNumSubstitutions can be NULL.
* @param pErrorCode Pointer to a standard ICU error code. Its input val ue must * @param pErrorCode Pointer to a standard ICU error code. Its input val ue must
* pass the U_SUCCESS() test, or else the function ret urns * pass the U_SUCCESS() test, or else the function ret urns
* immediately. Check for U_FAILURE() on output or use with * immediately. Check for U_FAILURE() on output or use with
* function chaining. (See User Guide for details.) * function chaining. (See User Guide for details.)
* @return The pointer to destination buffer. * @return The pointer to destination buffer.
* @see u_strToUTF32 * @see u_strToUTF32
* @see u_strFromUTF32WithSub * @see u_strFromUTF32WithSub
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
U_DRAFT UChar32* U_EXPORT2 U_STABLE UChar32* U_EXPORT2
u_strToUTF32WithSub(UChar32 *dest, u_strToUTF32WithSub(UChar32 *dest,
int32_t destCapacity, int32_t destCapacity,
int32_t *pDestLength, int32_t *pDestLength,
const UChar *src, const UChar *src,
int32_t srcLength, int32_t srcLength,
UChar32 subchar, int32_t *pNumSubstitutions, UChar32 subchar, int32_t *pNumSubstitutions,
UErrorCode *pErrorCode); UErrorCode *pErrorCode);
/** /**
* Convert a UTF-32 string to UTF-16. * Convert a UTF-32 string to UTF-16.
skipping to change at line 1594 skipping to change at line 1594
* @param pNumSubstitutions Output parameter receiving the number of substi tutions if subchar>=0. * @param pNumSubstitutions Output parameter receiving the number of substi tutions if subchar>=0.
* Set to 0 if no substitutions occur or subchar<0. * Set to 0 if no substitutions occur or subchar<0.
* pNumSubstitutions can be NULL. * pNumSubstitutions can be NULL.
* @param pErrorCode Pointer to a standard ICU error code. Its input val ue must * @param pErrorCode Pointer to a standard ICU error code. Its input val ue must
* pass the U_SUCCESS() test, or else the function ret urns * pass the U_SUCCESS() test, or else the function ret urns
* immediately. Check for U_FAILURE() on output or use with * immediately. Check for U_FAILURE() on output or use with
* function chaining. (See User Guide for details.) * function chaining. (See User Guide for details.)
* @return The pointer to destination buffer. * @return The pointer to destination buffer.
* @see u_strFromUTF32 * @see u_strFromUTF32
* @see u_strToUTF32WithSub * @see u_strToUTF32WithSub
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
U_DRAFT UChar* U_EXPORT2 U_STABLE UChar* U_EXPORT2
u_strFromUTF32WithSub(UChar *dest, u_strFromUTF32WithSub(UChar *dest,
int32_t destCapacity, int32_t destCapacity,
int32_t *pDestLength, int32_t *pDestLength,
const UChar32 *src, const UChar32 *src,
int32_t srcLength, int32_t srcLength,
UChar32 subchar, int32_t *pNumSubstitutions, UChar32 subchar, int32_t *pNumSubstitutions,
UErrorCode *pErrorCode); UErrorCode *pErrorCode);
/**
* Convert a 16-bit Unicode string to Java Modified UTF-8.
* See http://java.sun.com/javase/6/docs/api/java/io/DataInput.html#modifie
d-utf-8
*
* This function behaves according to the documentation for Java DataOutput
.writeUTF()
* except that it does not encode the output length in the destination buff
er
* and does not have an output length restriction.
* See http://java.sun.com/javase/6/docs/api/java/io/DataOutput.html#writeU
TF(java.lang.String)
*
* The input string need not be well-formed UTF-16.
* (Therefore there is no subchar parameter.)
*
* @param dest A buffer for the result string. The result will be
zero-terminated if
* the buffer is large enough.
* @param destCapacity The size of the buffer (number of chars). If it is
0, then
* dest may be NULL and the function will only return
the length of the
* result without writing any of the result string (pr
e-flighting).
* @param pDestLength A pointer to receive the number of units written to
the destination. If
* pDestLength!=NULL then *pDestLength is always set t
o the
* number of output units corresponding to the transfo
rmation of
* all the input units, even in case of a buffer overf
low.
* @param src The original source string
* @param srcLength The length of the original string. If -1, then src
must be zero-terminated.
* @param pErrorCode Pointer to a standard ICU error code. Its input val
ue must
* pass the U_SUCCESS() test, or else the function ret
urns
* immediately. Check for U_FAILURE() on output or use
with
* function chaining. (See User Guide for details.)
* @return The pointer to destination buffer.
* @draft ICU 4.4
* @see u_strToUTF8WithSub
* @see u_strFromJavaModifiedUTF8WithSub
*/
U_DRAFT char* U_EXPORT2
u_strToJavaModifiedUTF8(
char *dest,
int32_t destCapacity,
int32_t *pDestLength,
const UChar *src,
int32_t srcLength,
UErrorCode *pErrorCode);
/**
* Convert a Java Modified UTF-8 string to a 16-bit Unicode string.
* If the input string is not well-formed, then the U_INVALID_CHAR_FOUND er
ror code is set.
*
* This function behaves according to the documentation for Java DataInput.
readUTF()
* except that it takes a length parameter rather than
* interpreting the first two input bytes as the length.
* See http://java.sun.com/javase/6/docs/api/java/io/DataInput.html#readUTF
()
*
* The output string may not be well-formed UTF-16.
*
* @param dest A buffer for the result string. The result will be
zero-terminated if
* the buffer is large enough.
* @param destCapacity The size of the buffer (number of UChars). If it is
0, then
* dest may be NULL and the function will only return
the length of the
* result without writing any of the result string (pr
e-flighting).
* @param pDestLength A pointer to receive the number of units written to
the destination. If
* pDestLength!=NULL then *pDestLength is always set t
o the
* number of output units corresponding to the transfo
rmation of
* all the input units, even in case of a buffer overf
low.
* @param src The original source string
* @param srcLength The length of the original string. If -1, then src
must be zero-terminated.
* @param subchar The substitution character to use in place of an il
legal input sequence,
* or U_SENTINEL if the function is to return with U_I
NVALID_CHAR_FOUND instead.
* A substitution character can be any valid Unicode c
ode point (up to U+10FFFF)
* except for surrogate code points (U+D800..U+DFFF).
* The recommended value is U+FFFD "REPLACEMENT CHARAC
TER".
* @param pNumSubstitutions Output parameter receiving the number of substi
tutions if subchar>=0.
* Set to 0 if no substitutions occur or subchar<0.
* pNumSubstitutions can be NULL.
* @param pErrorCode Pointer to a standard ICU error code. Its input val
ue must
* pass the U_SUCCESS() test, or else the function ret
urns
* immediately. Check for U_FAILURE() on output or use
with
* function chaining. (See User Guide for details.)
* @return The pointer to destination buffer.
* @see u_strFromUTF8WithSub
* @see u_strFromUTF8Lenient
* @see u_strToJavaModifiedUTF8
* @draft ICU 4.4
*/
U_DRAFT UChar* U_EXPORT2
u_strFromJavaModifiedUTF8WithSub(
UChar *dest,
int32_t destCapacity,
int32_t *pDestLength,
const char *src,
int32_t srcLength,
UChar32 subchar, int32_t *pNumSubstitutions,
UErrorCode *pErrorCode);
#endif #endif
 End of changes. 6 change blocks. 
5 lines changed or deleted 132 lines changed or added


 utext.h   utext.h 
skipping to change at line 137 skipping to change at line 137
* \endcode * \endcode
* *
* Any existing UText passed to an open function _must_ have been initializ ed, * Any existing UText passed to an open function _must_ have been initializ ed,
* either by the UTEXT_INITIALIZER, or by having been originally heap-alloc ated * either by the UTEXT_INITIALIZER, or by having been originally heap-alloc ated
* by an open function. Passing NULL will cause the open function to * by an open function. Passing NULL will cause the open function to
* heap-allocate and fully initialize a new UText. * heap-allocate and fully initialize a new UText.
* *
*/ */
#include "unicode/utypes.h" #include "unicode/utypes.h"
#ifdef XP_CPLUSPLUS #if U_SHOW_CPLUSPLUS_API
#include "unicode/localpointer.h" #include "unicode/localpointer.h"
#include "unicode/rep.h" #include "unicode/rep.h"
#include "unicode/unistr.h" #include "unicode/unistr.h"
#include "unicode/chariter.h" #include "unicode/chariter.h"
#endif #endif
U_CDECL_BEGIN U_CDECL_BEGIN
struct UText; struct UText;
typedef struct UText UText; /**< C typedef for struct UText. @stable ICU 3. 6 */ typedef struct UText UText; /**< C typedef for struct UText. @stable ICU 3. 6 */
skipping to change at line 178 skipping to change at line 178
* @return NULL if the UText struct was deleted by the close. If the U Text struct * @return NULL if the UText struct was deleted by the close. If the U Text struct
* was originally provided by the caller to the open function, it is * was originally provided by the caller to the open function, it is
* returned by this function, and may be safely used again in * returned by this function, and may be safely used again in
* a subsequent utext_open. * a subsequent utext_open.
* *
* @stable ICU 3.4 * @stable ICU 3.4
*/ */
U_STABLE UText * U_EXPORT2 U_STABLE UText * U_EXPORT2
utext_close(UText *ut); utext_close(UText *ut);
#ifdef XP_CPLUSPLUS #if U_SHOW_CPLUSPLUS_API
U_NAMESPACE_BEGIN U_NAMESPACE_BEGIN
/** /**
* \class LocalUTextPointer * \class LocalUTextPointer
* "Smart pointer" class, closes a UText via utext_close(). * "Smart pointer" class, closes a UText via utext_close().
* For most methods see the LocalPointerBase base class. * For most methods see the LocalPointerBase base class.
* *
* @see LocalPointerBase * @see LocalPointerBase
* @see LocalPointer * @see LocalPointer
skipping to change at line 238 skipping to change at line 238
* @param length The number of UChars in the input string, or -1 if the str ing is * @param length The number of UChars in the input string, or -1 if the str ing is
* zero terminated. * zero terminated.
* @param status Errors are returned here. * @param status Errors are returned here.
* @return A pointer to the UText. If a pre-allocated UText was prov ided, it * @return A pointer to the UText. If a pre-allocated UText was prov ided, it
* will always be used and returned. * will always be used and returned.
* @stable ICU 3.4 * @stable ICU 3.4
*/ */
U_STABLE UText * U_EXPORT2 U_STABLE UText * U_EXPORT2
utext_openUChars(UText *ut, const UChar *s, int64_t length, UErrorCode *sta tus); utext_openUChars(UText *ut, const UChar *s, int64_t length, UErrorCode *sta tus);
#ifdef XP_CPLUSPLUS #if U_SHOW_CPLUSPLUS_API
/** /**
* Open a writable UText for a non-const UnicodeString. * Open a writable UText for a non-const UnicodeString.
* *
* @param ut Pointer to a UText struct. If NULL, a new UText will be created. * @param ut Pointer to a UText struct. If NULL, a new UText will be created.
* If non-NULL, must refer to an initialized UText struct, which will then * If non-NULL, must refer to an initialized UText struct, which will then
* be reset to reference the specified input string. * be reset to reference the specified input string.
* @param s A UnicodeString. * @param s A UnicodeString.
* @param status Errors are returned here. * @param status Errors are returned here.
* @return Pointer to the UText. If a UText was supplied as input, this * @return Pointer to the UText. If a UText was supplied as input, this
* will always be used and returned. * will always be used and returned.
 End of changes. 3 change blocks. 
3 lines changed or deleted 3 lines changed or added


 utf8.h   utf8.h 
/* /*
*************************************************************************** **** *************************************************************************** ****
* *
* Copyright (C) 1999-2007, International Business Machines * Copyright (C) 1999-2009, International Business Machines
* Corporation and others. All Rights Reserved. * Corporation and others. All Rights Reserved.
* *
*************************************************************************** **** *************************************************************************** ****
* file name: utf8.h * file name: utf8.h
* encoding: US-ASCII * encoding: US-ASCII
* tab size: 8 (not used) * tab size: 8 (not used)
* indentation:4 * indentation:4
* *
* created on: 1999sep13 * created on: 1999sep13
* created by: Markus W. Scherer * created by: Markus W. Scherer
skipping to change at line 48 skipping to change at line 48
#ifndef __UTF_H__ #ifndef __UTF_H__
# include "unicode/utf.h" # include "unicode/utf.h"
#endif #endif
/* internal definitions --------------------------------------------------- -- */ /* internal definitions --------------------------------------------------- -- */
/** /**
* \var utf8_countTrailBytes * \var utf8_countTrailBytes
* Internal array with numbers of trail bytes for any given byte used in * Internal array with numbers of trail bytes for any given byte used in
* lead byte position. * lead byte position.
*
* This is internal since it is not meant to be called directly by external
clients;
* however it is called by public macros in this file and thus must remain
stable,
* and should not be hidden when other internal functions are hidden (other
wise
* public macros would fail to compile).
* @internal * @internal
*/ */
#ifdef U_UTF8_IMPL #ifdef U_UTF8_IMPL
U_EXPORT const uint8_t U_EXPORT const uint8_t
#elif defined(U_STATIC_IMPLEMENTATION) || defined(U_COMMON_IMPLEMENTATION) #elif defined(U_STATIC_IMPLEMENTATION) || defined(U_COMMON_IMPLEMENTATION)
U_CFUNC const uint8_t U_CFUNC const uint8_t
#else #else
U_CFUNC U_IMPORT const uint8_t /* U_IMPORT2? */ /*U_IMPORT*/ U_CFUNC U_IMPORT const uint8_t /* U_IMPORT2? */ /*U_IMPORT*/
#endif #endif
utf8_countTrailBytes[256]; utf8_countTrailBytes[256];
/** /**
* Count the trail bytes for a UTF-8 lead byte. * Count the trail bytes for a UTF-8 lead byte.
*
* This is internal since it is not meant to be called directly by external
clients;
* however it is called by public macros in this file and thus must remain
stable.
* @internal * @internal
*/ */
#define U8_COUNT_TRAIL_BYTES(leadByte) (utf8_countTrailBytes[(uint8_t)leadB yte]) #define U8_COUNT_TRAIL_BYTES(leadByte) (utf8_countTrailBytes[(uint8_t)leadB yte])
/** /**
* Mask a UTF-8 lead byte, leave only the lower bits that form part of the code point value. * Mask a UTF-8 lead byte, leave only the lower bits that form part of the code point value.
*
* This is internal since it is not meant to be called directly by external
clients;
* however it is called by public macros in this file and thus must remain
stable.
* @internal * @internal
*/ */
#define U8_MASK_LEAD_BYTE(leadByte, countTrailBytes) ((leadByte)&=(1<<(6-(c ountTrailBytes)))-1) #define U8_MASK_LEAD_BYTE(leadByte, countTrailBytes) ((leadByte)&=(1<<(6-(c ountTrailBytes)))-1)
/** /**
* Function for handling "next code point" with error-checking. * Function for handling "next code point" with error-checking.
*
* This is internal since it is not meant to be called directly by external
clients;
* however it is U_STABLE (not U_INTERNAL) since it is called by public mac
ros in this
* file and thus must remain stable, and should not be hidden when other in
ternal
* functions are hidden (otherwise public macros would fail to compile).
* @internal * @internal
*/ */
U_INTERNAL UChar32 U_EXPORT2 U_STABLE UChar32 U_EXPORT2
utf8_nextCharSafeBody(const uint8_t *s, int32_t *pi, int32_t length, UChar3 2 c, UBool strict); utf8_nextCharSafeBody(const uint8_t *s, int32_t *pi, int32_t length, UChar3 2 c, UBool strict);
/** /**
* Function for handling "append code point" with error-checking. * Function for handling "append code point" with error-checking.
*
* This is internal since it is not meant to be called directly by external
clients;
* however it is U_STABLE (not U_INTERNAL) since it is called by public mac
ros in this
* file and thus must remain stable, and should not be hidden when other in
ternal
* functions are hidden (otherwise public macros would fail to compile).
* @internal * @internal
*/ */
U_INTERNAL int32_t U_EXPORT2 U_STABLE int32_t U_EXPORT2
utf8_appendCharSafeBody(uint8_t *s, int32_t i, int32_t length, UChar32 c, U Bool *pIsError); utf8_appendCharSafeBody(uint8_t *s, int32_t i, int32_t length, UChar32 c, U Bool *pIsError);
/** /**
* Function for handling "previous code point" with error-checking. * Function for handling "previous code point" with error-checking.
*
* This is internal since it is not meant to be called directly by external
clients;
* however it is U_STABLE (not U_INTERNAL) since it is called by public mac
ros in this
* file and thus must remain stable, and should not be hidden when other in
ternal
* functions are hidden (otherwise public macros would fail to compile).
* @internal * @internal
*/ */
U_INTERNAL UChar32 U_EXPORT2 U_STABLE UChar32 U_EXPORT2
utf8_prevCharSafeBody(const uint8_t *s, int32_t start, int32_t *pi, UChar32 c, UBool strict); utf8_prevCharSafeBody(const uint8_t *s, int32_t start, int32_t *pi, UChar32 c, UBool strict);
/** /**
* Function for handling "skip backward one code point" with error-checking . * Function for handling "skip backward one code point" with error-checking .
*
* This is internal since it is not meant to be called directly by external
clients;
* however it is U_STABLE (not U_INTERNAL) since it is called by public mac
ros in this
* file and thus must remain stable, and should not be hidden when other in
ternal
* functions are hidden (otherwise public macros would fail to compile).
* @internal * @internal
*/ */
U_INTERNAL int32_t U_EXPORT2 U_STABLE int32_t U_EXPORT2
utf8_back1SafeBody(const uint8_t *s, int32_t start, int32_t i); utf8_back1SafeBody(const uint8_t *s, int32_t start, int32_t i);
/* single-code point definitions ------------------------------------------ -- */ /* single-code point definitions ------------------------------------------ -- */
/** /**
* Does this code unit (byte) encode a code point by itself (US-ASCII 0..0x 7f)? * Does this code unit (byte) encode a code point by itself (US-ASCII 0..0x 7f)?
* @param c 8-bit code unit (byte) * @param c 8-bit code unit (byte)
* @return TRUE or FALSE * @return TRUE or FALSE
* @stable ICU 2.4 * @stable ICU 2.4
*/ */
 End of changes. 12 change blocks. 
5 lines changed or deleted 55 lines changed or added


 utrans.h   utrans.h 
skipping to change at line 239 skipping to change at line 239
/** /**
* Close a transliterator. Any non-NULL pointer returned by * Close a transliterator. Any non-NULL pointer returned by
* utrans_openXxx() or utrans_clone() should eventually be closed. * utrans_openXxx() or utrans_clone() should eventually be closed.
* @param trans the transliterator to be closed. * @param trans the transliterator to be closed.
* @stable ICU 2.0 * @stable ICU 2.0
*/ */
U_STABLE void U_EXPORT2 U_STABLE void U_EXPORT2
utrans_close(UTransliterator* trans); utrans_close(UTransliterator* trans);
#ifdef XP_CPLUSPLUS #if U_SHOW_CPLUSPLUS_API
U_NAMESPACE_BEGIN U_NAMESPACE_BEGIN
/** /**
* \class LocalUTransliteratorPointer * \class LocalUTransliteratorPointer
* "Smart pointer" class, closes a UTransliterator via utrans_close(). * "Smart pointer" class, closes a UTransliterator via utrans_close().
* For most methods see the LocalPointerBase base class. * For most methods see the LocalPointerBase base class.
* *
* @see LocalPointerBase * @see LocalPointerBase
* @see LocalPointer * @see LocalPointer
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 utypes.h   utypes.h 
/* /*
********************************************************************** **********************************************************************
* Copyright (C) 1996-2009, International Business Machines * Copyright (C) 1996-2010, International Business Machines
* Corporation and others. All Rights Reserved. * Corporation and others. All Rights Reserved.
********************************************************************** **********************************************************************
* *
* FILE NAME : UTYPES.H (formerly ptypes.h) * FILE NAME : UTYPES.H (formerly ptypes.h)
* *
* Date Name Description * Date Name Description
* 12/11/96 helena Creation. * 12/11/96 helena Creation.
* 02/27/97 aliu Added typedefs for UClassID, int8, int16, int32 , * 02/27/97 aliu Added typedefs for UClassID, int8, int16, int32 ,
* uint8, uint16, and uint32. * uint8, uint16, and uint32.
* 04/01/97 aliu Added XP_CPLUSPLUS and modified to work under C as * 04/01/97 aliu Added XP_CPLUSPLUS and modified to work under C as
skipping to change at line 40 skipping to change at line 40
*/ */
#ifndef UTYPES_H #ifndef UTYPES_H
#define UTYPES_H #define UTYPES_H
#include "unicode/umachine.h" #include "unicode/umachine.h"
#include "unicode/utf.h" #include "unicode/utf.h"
#include "unicode/uversion.h" #include "unicode/uversion.h"
#include "unicode/uconfig.h" #include "unicode/uconfig.h"
/*!
* \file
* \brief Basic definitions for ICU, for both C and C++ APIs
*
* This file defines basic types, constants, and enumerations directly or
* indirectly by including other header files, especially utf.h for the
* basic character and string definitions and umachine.h for consistent
* integer and other types.
*/
#ifdef XP_CPLUSPLUS
# ifndef U_SHOW_CPLUSPLUS_API
# define U_SHOW_CPLUSPLUS_API 1
# endif
#else
# undef U_SHOW_CPLUSPLUS_API
# define U_SHOW_CPLUSPLUS_API 0
#endif
/** @{ API visibility control */
/** /**
* \def U_HIDE_DRAFT_API * \def U_HIDE_DRAFT_API
* Define this to 1 to request that draft API be "hidden" * Define this to 1 to request that draft API be "hidden"
*/ */
#if !U_DEFAULT_SHOW_DRAFT && !defined(U_SHOW_DRAFT_API) #if !U_DEFAULT_SHOW_DRAFT && !defined(U_SHOW_DRAFT_API)
#define U_HIDE_DRAFT_API 1 #define U_HIDE_DRAFT_API 1
#endif #endif
#if !U_DEFAULT_SHOW_DRAFT && !defined(U_SHOW_INTERNAL_API)
#define U_HIDE_INTERNAL_API 1
#endif
#ifdef U_HIDE_DRAFT_API #ifdef U_HIDE_DRAFT_API
#include "unicode/udraft.h" #include "unicode/udraft.h"
#endif #endif
#ifdef U_HIDE_DEPRECATED_API #ifdef U_HIDE_DEPRECATED_API
#include "unicode/udeprctd.h" #include "unicode/udeprctd.h"
#endif #endif
#ifdef U_HIDE_DEPRECATED_API #ifdef U_HIDE_DEPRECATED_API
skipping to change at line 68 skipping to change at line 92
#endif #endif
#ifdef U_HIDE_INTERNAL_API #ifdef U_HIDE_INTERNAL_API
#include "unicode/uintrnal.h" #include "unicode/uintrnal.h"
#endif #endif
#ifdef U_HIDE_SYSTEM_API #ifdef U_HIDE_SYSTEM_API
#include "unicode/usystem.h" #include "unicode/usystem.h"
#endif #endif
/*! /** @} */
* \file
* \brief Basic definitions for ICU, for both C and C++ APIs
*
* This file defines basic types, constants, and enumerations directly or
* indirectly by including other header files, especially utf.h for the
* basic character and string definitions and umachine.h for consistent
* integer and other types.
*/
/*========================================================================= ==*/ /*========================================================================= ==*/
/* char Character set family */ /* char Character set family */
/*========================================================================= ==*/ /*========================================================================= ==*/
/** /**
* U_CHARSET_FAMILY is equal to this value when the platform is an ASCII ba sed platform. * U_CHARSET_FAMILY is equal to this value when the platform is an ASCII ba sed platform.
* @stable ICU 2.0 * @stable ICU 2.0
*/ */
#define U_ASCII_FAMILY 0 #define U_ASCII_FAMILY 0
skipping to change at line 213 skipping to change at line 229
# define U_ICUDATA_TYPE_LITLETTER l # define U_ICUDATA_TYPE_LITLETTER l
# endif # endif
#endif #endif
/** /**
* A single string literal containing the icudata stub name. i.e. 'icudt18e ' for * A single string literal containing the icudata stub name. i.e. 'icudt18e ' for
* ICU 1.8.x on EBCDIC, etc.. * ICU 1.8.x on EBCDIC, etc..
* @stable ICU 2.0 * @stable ICU 2.0
*/ */
#define U_ICUDATA_NAME "icudt" U_ICU_VERSION_SHORT U_ICUDATA_TYPE_LETTER #define U_ICUDATA_NAME "icudt" U_ICU_VERSION_SHORT U_ICUDATA_TYPE_LETTER
#define U_USRDATA_NAME "usrdt" U_ICU_VERSION_SHORT U_ICUDATA_TYPE_LETTER
#define U_USE_USRDATA 1
/** /**
* U_ICU_ENTRY_POINT is the name of the DLL entry point to the ICU data li brary. * U_ICU_ENTRY_POINT is the name of the DLL entry point to the ICU data li brary.
* Defined as a literal, not a string. * Defined as a literal, not a string.
* Tricky Preprocessor use - ## operator replaces macro paramters with t he literal string * Tricky Preprocessor use - ## operator replaces macro paramters with t he literal string
* from the corresponding macro invocation, _b efore_ other macro substitutions. * from the corresponding macro invocation, _b efore_ other macro substitutions.
* Need a nested \#defines to get the actual v ersion numbers rather than * Need a nested \#defines to get the actual v ersion numbers rather than
* the literal text U_ICU_VERSION_MAJOR_NUM in to the name. * the literal text U_ICU_VERSION_MAJOR_NUM in to the name.
* The net result will be something of the for m * The net result will be something of the for m
* \#define U_ICU_ENTRY_POINT icudt19_dat * \#define U_ICU_ENTRY_POINT icudt19_dat
skipping to change at line 616 skipping to change at line 634
U_STATE_OLD_WARNING = -125, /**< ICU has to use compatibility l ayer to construct the service. Expect performance/memory usage degradation. Consider upgrading */ U_STATE_OLD_WARNING = -125, /**< ICU has to use compatibility l ayer to construct the service. Expect performance/memory usage degradation. Consider upgrading */
U_STRING_NOT_TERMINATED_WARNING = -124,/**< An output string could not be NUL-terminated because output length==destCapacity. */ U_STRING_NOT_TERMINATED_WARNING = -124,/**< An output string could not be NUL-terminated because output length==destCapacity. */
U_SORT_KEY_TOO_SHORT_WARNING = -123, /**< Number of levels requested in getBound is higher than the number of levels in the sort key */ U_SORT_KEY_TOO_SHORT_WARNING = -123, /**< Number of levels requested in getBound is higher than the number of levels in the sort key */
U_AMBIGUOUS_ALIAS_WARNING = -122, /**< This converter alias can go to different converter implementations */ U_AMBIGUOUS_ALIAS_WARNING = -122, /**< This converter alias can go to different converter implementations */
U_DIFFERENT_UCA_VERSION = -121, /**< ucol_open encountered a mismat ch between UCA version and collator image version, so the collator was cons tructed from rules. No impact to further function */ U_DIFFERENT_UCA_VERSION = -121, /**< ucol_open encountered a mismat ch between UCA version and collator image version, so the collator was cons tructed from rules. No impact to further function */
U_PLUGIN_CHANGED_LEVEL_WARNING = -120, /**< A plugin caused a level cha
nge. May not be an error, but later plugins may not load. */
U_ERROR_WARNING_LIMIT, /**< This must always be the last w arning value to indicate the limit for UErrorCode warnings (last warning co de +1) */ U_ERROR_WARNING_LIMIT, /**< This must always be the last w arning value to indicate the limit for UErrorCode warnings (last warning co de +1) */
U_ZERO_ERROR = 0, /**< No error, no warning. */ U_ZERO_ERROR = 0, /**< No error, no warning. */
U_ILLEGAL_ARGUMENT_ERROR = 1, /**< Start of codes indicating fail ure */ U_ILLEGAL_ARGUMENT_ERROR = 1, /**< Start of codes indicating fail ure */
U_MISSING_RESOURCE_ERROR = 2, /**< The requested resource cannot be found */ U_MISSING_RESOURCE_ERROR = 2, /**< The requested resource cannot be found */
U_INVALID_FORMAT_ERROR = 3, /**< Data format is not what is exp ected */ U_INVALID_FORMAT_ERROR = 3, /**< Data format is not what is exp ected */
U_FILE_ACCESS_ERROR = 4, /**< The requested file cannot be f ound */ U_FILE_ACCESS_ERROR = 4, /**< The requested file cannot be f ound */
U_INTERNAL_PROGRAM_ERROR = 5, /**< Indicates a bug in the library code */ U_INTERNAL_PROGRAM_ERROR = 5, /**< Indicates a bug in the library code */
U_MESSAGE_PARSE_ERROR = 6, /**< Unable to parse a message (mes sage format) */ U_MESSAGE_PARSE_ERROR = 6, /**< Unable to parse a message (mes sage format) */
skipping to change at line 784 skipping to change at line 804
U_IDNA_ZERO_LENGTH_LABEL_ERROR, U_IDNA_ZERO_LENGTH_LABEL_ERROR,
U_IDNA_DOMAIN_NAME_TOO_LONG_ERROR, U_IDNA_DOMAIN_NAME_TOO_LONG_ERROR,
U_IDNA_ERROR_LIMIT, U_IDNA_ERROR_LIMIT,
/* /*
* Aliases for StringPrep * Aliases for StringPrep
*/ */
U_STRINGPREP_PROHIBITED_ERROR = U_IDNA_PROHIBITED_ERROR, U_STRINGPREP_PROHIBITED_ERROR = U_IDNA_PROHIBITED_ERROR,
U_STRINGPREP_UNASSIGNED_ERROR = U_IDNA_UNASSIGNED_ERROR, U_STRINGPREP_UNASSIGNED_ERROR = U_IDNA_UNASSIGNED_ERROR,
U_STRINGPREP_CHECK_BIDI_ERROR = U_IDNA_CHECK_BIDI_ERROR, U_STRINGPREP_CHECK_BIDI_ERROR = U_IDNA_CHECK_BIDI_ERROR,
U_ERROR_LIMIT=U_IDNA_ERROR_LIMIT /**< This must always be the last /*
value to indicate the limit for UErrorCode (last error code +1) */ * The error code in the range 0x10500-0x105ff are reserved for Plugin
related error codes
*/
U_PLUGIN_ERROR_START=0x10500, /**< Start of codes indicating pl
ugin failures */
U_PLUGIN_TOO_HIGH=0x10500, /**< The plugin's level is too hi
gh to be loaded right now. */
U_PLUGIN_DIDNT_SET_LEVEL, /**< The plugin didn't call uplug
_setPlugLevel in response to a QUERY */
U_PLUGIN_ERROR_LIMIT, /**< This must always be the last
value to indicate the limit for plugin errors */
U_ERROR_LIMIT=U_PLUGIN_ERROR_LIMIT /**< This must always be the la
st value to indicate the limit for UErrorCode (last error code +1) */
} UErrorCode; } UErrorCode;
/* Use the following to determine if an UErrorCode represents */ /* Use the following to determine if an UErrorCode represents */
/* operational success or failure. */ /* operational success or failure. */
#ifdef XP_CPLUSPLUS #ifdef XP_CPLUSPLUS
/** /**
* Does the error code indicate success? * Does the error code indicate success?
* @stable ICU 2.0 * @stable ICU 2.0
*/ */
 End of changes. 7 change blocks. 
12 lines changed or deleted 46 lines changed or added


 uvernum.h   uvernum.h 
/* /*
*************************************************************************** **** *************************************************************************** ****
* Copyright (C) 2000-2009, International Business Machines * Copyright (C) 2000-2010, International Business Machines
* Corporation and others. All Rights Reserved. * Corporation and others. All Rights Reserved.
*************************************************************************** **** *************************************************************************** ****
* *
* file name: uvernum.h * file name: uvernum.h
* encoding: US-ASCII * encoding: US-ASCII
* tab size: 8 (not used) * tab size: 8 (not used)
* indentation:4 * indentation:4
* *
* Created by: Vladimir Weinstein * Created by: Vladimir Weinstein
* Updated by: Steven R. Loomis * Updated by: Steven R. Loomis
skipping to change at line 44 skipping to change at line 44
/** The current ICU minor version as an integer. /** The current ICU minor version as an integer.
* This value will change in the subsequent releases of ICU * This value will change in the subsequent releases of ICU
* @stable ICU 2.6 * @stable ICU 2.6
*/ */
#define U_ICU_VERSION_MINOR_NUM 3 #define U_ICU_VERSION_MINOR_NUM 3
/** The current ICU patchlevel version as an integer. /** The current ICU patchlevel version as an integer.
* This value will change in the subsequent releases of ICU * This value will change in the subsequent releases of ICU
* @stable ICU 2.4 * @stable ICU 2.4
*/ */
#define U_ICU_VERSION_PATCHLEVEL_NUM 3 #define U_ICU_VERSION_PATCHLEVEL_NUM 4
/** The current ICU build level version as an integer. /** The current ICU build level version as an integer.
* This value is for use by ICU clients. It defaults to 0. * This value is for use by ICU clients. It defaults to 0.
* @draft ICU 4.0 * @stable ICU 4.0
*/ */
#ifndef U_ICU_VERSION_BUILDLEVEL_NUM #ifndef U_ICU_VERSION_BUILDLEVEL_NUM
#define U_ICU_VERSION_BUILDLEVEL_NUM 0 #define U_ICU_VERSION_BUILDLEVEL_NUM 0
#endif #endif
/** Glued version suffix for renamers /** Glued version suffix for renamers
* This value will change in the subsequent releases of ICU * This value will change in the subsequent releases of ICU
* @stable ICU 2.6 * @stable ICU 2.6
*/ */
#define U_ICU_VERSION_SUFFIX _43 #define U_ICU_VERSION_SUFFIX _43
skipping to change at line 75 skipping to change at line 75
*/ */
#ifndef U_ICU_ENTRY_POINT_RENAME #ifndef U_ICU_ENTRY_POINT_RENAME
#define U_ICU_ENTRY_POINT_RENAME(x) x ## _43 #define U_ICU_ENTRY_POINT_RENAME(x) x ## _43
#endif #endif
/** The current ICU library version as a dotted-decimal string. The patchle vel /** The current ICU library version as a dotted-decimal string. The patchle vel
* only appears in this string if it non-zero. * only appears in this string if it non-zero.
* This value will change in the subsequent releases of ICU * This value will change in the subsequent releases of ICU
* @stable ICU 2.4 * @stable ICU 2.4
*/ */
#define U_ICU_VERSION "4.3.3" #define U_ICU_VERSION "4.3.4"
/** The current ICU library major/minor version as a string without dots, f or library name suffixes. /** The current ICU library major/minor version as a string without dots, f or library name suffixes.
* This value will change in the subsequent releases of ICU * This value will change in the subsequent releases of ICU
* @stable ICU 2.6 * @stable ICU 2.6
*/ */
#define U_ICU_VERSION_SHORT "43" #define U_ICU_VERSION_SHORT "43"
/** Data version in ICU4C. /** Data version in ICU4C.
* * @draft ICU 4.4 * @internal ICU 4.4 Internal Use Only
* */ **/
#define U_ICU_DATA_VERSION "4.3.3" #define U_ICU_DATA_VERSION "4.3.4"
/*========================================================================= == /*========================================================================= ==
* ICU collation framework version information * ICU collation framework version information
* Version info that can be obtained from a collator is affected by these * Version info that can be obtained from a collator is affected by these
* numbers in a secret and magic way. Please use collator version as whole * numbers in a secret and magic way. Please use collator version as whole
*========================================================================= == *========================================================================= ==
*/ */
/** Collation runtime version (sort key generator, strcoll). /** Collation runtime version (sort key generator, strcoll).
* If the version is different, sortkeys for the same string could be diffe rent * If the version is different, sortkeys for the same string could be diffe rent
 End of changes. 5 change blocks. 
7 lines changed or deleted 7 lines changed or added


 uversion.h   uversion.h 
/* /*
*************************************************************************** **** *************************************************************************** ****
* Copyright (C) 2000-2009, International Business Machines * Copyright (C) 2000-2010, International Business Machines
* Corporation and others. All Rights Reserved. * Corporation and others. All Rights Reserved.
*************************************************************************** **** *************************************************************************** ****
* *
* file name: uversion.h * file name: uversion.h
* encoding: US-ASCII * encoding: US-ASCII
* tab size: 8 (not used) * tab size: 8 (not used)
* indentation:4 * indentation:4
* *
* Created by: Vladimir Weinstein * Created by: Vladimir Weinstein
* *
skipping to change at line 84 skipping to change at line 84
*/ */
typedef uint8_t UVersionInfo[U_MAX_VERSION_LENGTH]; typedef uint8_t UVersionInfo[U_MAX_VERSION_LENGTH];
/*========================================================================= ==*/ /*========================================================================= ==*/
/* C++ namespace if supported. Versioned unless versioning is disabled. */ /* C++ namespace if supported. Versioned unless versioning is disabled. */
/*========================================================================= ==*/ /*========================================================================= ==*/
/** /**
* \def U_NAMESPACE_BEGIN * \def U_NAMESPACE_BEGIN
* This is used to begin a declaration of a public ICU C++ API. * This is used to begin a declaration of a public ICU C++ API.
* If the compiler doesn't support namespaces, this does nothing. * When not compiling for C++, it does nothing.
* When compiling for C++, it begins an extern "C++" linkage block (to prot
ect
* against cases in which an external client includes ICU header files insi
de
* an extern "C" linkage block).
* If the C++ compiler supports namespaces, it also begins a namespace bloc
k.
* @stable ICU 2.4 * @stable ICU 2.4
*/ */
/** /**
* \def U_NAMESPACE_END * \def U_NAMESPACE_END
* This is used to end a declaration of a public ICU C++ API * This is used to end a declaration of a public ICU C++ API.
* If the compiler doesn't support namespaces, this does nothing. * When not compiling for C++, it does nothing.
* When compiling for C++, it ends the extern "C++" block begun by
* U_NAMESPACE_BEGIN.
* If the C++ compiler supports namespaces, it also ends the namespace bloc
k
* begun by U_NAMESPACE_BEGIN.
* @stable ICU 2.4 * @stable ICU 2.4
*/ */
/** /**
* \def U_NAMESPACE_USE * \def U_NAMESPACE_USE
* This is used to specify that the rest of the code uses the * This is used to specify that the rest of the code uses the
* public ICU C++ API namespace. * public ICU C++ API namespace.
* If the compiler doesn't support namespaces, this does nothing. * If the compiler doesn't support namespaces, this does nothing.
* @stable ICU 2.4 * @stable ICU 2.4
*/ */
/** /**
* \def U_NAMESPACE_QUALIFIER * \def U_NAMESPACE_QUALIFIER
* This is used to qualify that a function or class is part of * This is used to qualify that a function or class is part of
* the public ICU C++ API namespace. * the public ICU C++ API namespace.
* If the compiler doesn't support namespaces, this does nothing. * If the compiler doesn't support namespaces, this does nothing.
* @stable ICU 2.4 * @stable ICU 2.4
*/ */
/* Define namespace symbols if the compiler supports it. */ /* Define namespace symbols if the compiler supports it. */
#if U_HAVE_NAMESPACE && defined(XP_CPLUSPLUS) #ifdef XP_CPLUSPLUS
#if U_HAVE_NAMESPACE
# if U_DISABLE_RENAMING # if U_DISABLE_RENAMING
# define U_ICU_NAMESPACE icu # define U_ICU_NAMESPACE icu
namespace U_ICU_NAMESPACE { } namespace U_ICU_NAMESPACE { }
# else # else
# define U_ICU_NAMESPACE U_ICU_ENTRY_POINT_RENAME(icu) # define U_ICU_NAMESPACE U_ICU_ENTRY_POINT_RENAME(icu)
namespace U_ICU_NAMESPACE { } namespace U_ICU_NAMESPACE { }
namespace icu = U_ICU_NAMESPACE; namespace icu = U_ICU_NAMESPACE;
# endif # endif
# define U_NAMESPACE_BEGIN namespace U_ICU_NAMESPACE { # define U_NAMESPACE_BEGIN extern "C++" { namespace U_ICU_NAMESPACE {
# define U_NAMESPACE_END } # define U_NAMESPACE_END } }
# define U_NAMESPACE_USE using namespace U_ICU_NAMESPACE; # define U_NAMESPACE_USE using namespace U_ICU_NAMESPACE;
# define U_NAMESPACE_QUALIFIER U_ICU_NAMESPACE:: # define U_NAMESPACE_QUALIFIER U_ICU_NAMESPACE::
# ifndef U_USING_ICU_NAMESPACE # ifndef U_USING_ICU_NAMESPACE
# define U_USING_ICU_NAMESPACE 1 # define U_USING_ICU_NAMESPACE 1
# endif # endif
# if U_USING_ICU_NAMESPACE # if U_USING_ICU_NAMESPACE
U_NAMESPACE_USE U_NAMESPACE_USE
# endif # endif
#else #else
# define U_NAMESPACE_BEGIN extern "C++" {
# define U_NAMESPACE_END }
# define U_NAMESPACE_USE
# define U_NAMESPACE_QUALIFIER
#endif
#else
# define U_NAMESPACE_BEGIN # define U_NAMESPACE_BEGIN
# define U_NAMESPACE_END # define U_NAMESPACE_END
# define U_NAMESPACE_USE # define U_NAMESPACE_USE
# define U_NAMESPACE_QUALIFIER # define U_NAMESPACE_QUALIFIER
#endif #endif
/*========================================================================= ==*/ /*========================================================================= ==*/
/* General version helper functions. Definitions in putil.c */ /* General version helper functions. Definitions in putil.c */
/*========================================================================= ==*/ /*========================================================================= ==*/
skipping to change at line 167 skipping to change at line 182
/** /**
* Parse a Unicode string with dotted-decimal version information and * Parse a Unicode string with dotted-decimal version information and
* fill in a UVersionInfo structure with the result. * fill in a UVersionInfo structure with the result.
* Definition of this function lives in putil.c * Definition of this function lives in putil.c
* *
* @param versionArray The destination structure for the version informatio n. * @param versionArray The destination structure for the version informatio n.
* @param versionString A Unicode string with dotted-decimal version * @param versionString A Unicode string with dotted-decimal version
* information, with up to four non-negative number * information, with up to four non-negative number
* fields with values of up to 255 each. * fields with values of up to 255 each.
* @draft ICU 4.2 * @stable ICU 4.4
*/ */
U_STABLE void U_EXPORT2 U_STABLE void U_EXPORT2
u_versionFromUString(UVersionInfo versionArray, const UChar *versionString) ; u_versionFromUString(UVersionInfo versionArray, const UChar *versionString) ;
/** /**
* Write a string with dotted-decimal version information according * Write a string with dotted-decimal version information according
* to the input UVersionInfo. * to the input UVersionInfo.
* Definition of this function lives in putil.c * Definition of this function lives in putil.c
* *
* @param versionArray The version information to be written as a string. * @param versionArray The version information to be written as a string.
 End of changes. 7 change blocks. 
8 lines changed or deleted 27 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/