summaryrefslogtreecommitdiff
path: root/icu4c/source/i18n/digitaffix.h
diff options
context:
space:
mode:
authorFredrik Roubert <roubert@google.com>2015-09-28 19:31:03 +0200
committerFredrik Roubert <roubert@google.com>2015-09-29 18:37:47 +0200
commitc14898b482f76ecab9026615e2e4c6fe78358bdc (patch)
tree69ff4fc83cf047f885f3e6cebeac951189331b5b /icu4c/source/i18n/digitaffix.h
parente12db398e69399b64d2a1019f33fde0bd96532c9 (diff)
downloadicu-c14898b482f76ecab9026615e2e4c6fe78358bdc.tar.gz
Copy ICU4C 56 RC from icu-project.org to aosp/icu56.
These files were exported from the ICU Subversion repository by running the following command: svn export \ http://source.icu-project.org/repos/icu/icu/tags/release-56-rc/ icu4c (Previously, only the subdirectory "source" and the files in the root directory were exported to Android, as the other subdirectories only contain files that are not relevant when using ICU4C in Android. Now these are included anyway, to simplify the export process.) Change-Id: I5457d90c5b3ec6d3ef966e2921fe7d2bb75d76cd
Diffstat (limited to 'icu4c/source/i18n/digitaffix.h')
-rw-r--r--icu4c/source/i18n/digitaffix.h102
1 files changed, 102 insertions, 0 deletions
diff --git a/icu4c/source/i18n/digitaffix.h b/icu4c/source/i18n/digitaffix.h
new file mode 100644
index 000000000..d5b545a3d
--- /dev/null
+++ b/icu4c/source/i18n/digitaffix.h
@@ -0,0 +1,102 @@
+/*
+*******************************************************************************
+* Copyright (C) 2015, International Business Machines
+* Corporation and others. All Rights Reserved.
+*******************************************************************************
+* digitaffix.h
+*
+* created on: 2015jan06
+* created by: Travis Keep
+*/
+
+#ifndef __DIGITAFFIX_H__
+#define __DIGITAFFIX_H__
+
+#include "unicode/uobject.h"
+
+#if !UCONFIG_NO_FORMATTING
+
+#include "unicode/unistr.h"
+#include "unicode/unum.h"
+#include "unicode/utypes.h"
+
+U_NAMESPACE_BEGIN
+
+class FieldPositionHandler;
+
+/**
+ * A prefix or suffix of a formatted number.
+ */
+class U_I18N_API DigitAffix : public UMemory {
+public:
+
+ /**
+ * Creates an empty DigitAffix.
+ */
+ DigitAffix();
+
+ /**
+ * Creates a DigitAffix containing given UChars where all of it has
+ * a field type of fieldId.
+ */
+ DigitAffix(
+ const UChar *value,
+ int32_t charCount,
+ int32_t fieldId=UNUM_FIELD_COUNT);
+
+ /**
+ * Makes this affix be the empty string.
+ */
+ void remove();
+
+ /**
+ * Append value to this affix. If fieldId is present, the appended
+ * string is considered to be the type fieldId.
+ */
+ void appendUChar(UChar value, int32_t fieldId=UNUM_FIELD_COUNT);
+
+ /**
+ * Append value to this affix. If fieldId is present, the appended
+ * string is considered to be the type fieldId.
+ */
+ void append(const UnicodeString &value, int32_t fieldId=UNUM_FIELD_COUNT);
+
+ /**
+ * Sets this affix to given string. The entire string
+ * is considered to be the type fieldId.
+ */
+ void setTo(const UnicodeString &value, int32_t fieldId=UNUM_FIELD_COUNT);
+
+ /**
+ * Append value to this affix. If fieldId is present, the appended
+ * string is considered to be the type fieldId.
+ */
+ void append(const UChar *value, int32_t charCount, int32_t fieldId=UNUM_FIELD_COUNT);
+
+ /**
+ * Formats this affix.
+ */
+ UnicodeString &format(
+ FieldPositionHandler &handler, UnicodeString &appendTo) const;
+ int32_t countChar32() const { return fAffix.countChar32(); }
+
+ /**
+ * Returns this affix as a unicode string.
+ */
+ const UnicodeString & toString() const { return fAffix; }
+
+ /**
+ * Returns TRUE if this object equals rhs.
+ */
+ UBool equals(const DigitAffix &rhs) const {
+ return ((fAffix == rhs.fAffix) && (fAnnotations == rhs.fAnnotations));
+ }
+private:
+ UnicodeString fAffix;
+ UnicodeString fAnnotations;
+};
+
+
+U_NAMESPACE_END
+#endif // #if !UCONFIG_NO_FORMATTING
+#endif // __DIGITAFFIX_H__