Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Unified Diff: source/i18n/significantdigitinterval.h

Issue 1621843002: ICU 56 update step 1 (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/icu.git@561
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « source/i18n/shareddateformatsymbols.h ('k') | source/i18n/smallintformatter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: source/i18n/significantdigitinterval.h
diff --git a/source/i18n/significantdigitinterval.h b/source/i18n/significantdigitinterval.h
new file mode 100644
index 0000000000000000000000000000000000000000..a3d86f1c8fe2801d9385f6c50a0e05603bfb0dec
--- /dev/null
+++ b/source/i18n/significantdigitinterval.h
@@ -0,0 +1,90 @@
+/*
+*******************************************************************************
+* Copyright (C) 2015, International Business Machines
+* Corporation and others. All Rights Reserved.
+*******************************************************************************
+* significantdigitinterval.h
+*
+* created on: 2015jan6
+* created by: Travis Keep
+*/
+
+#ifndef __SIGNIFICANTDIGITINTERVAL_H__
+#define __SIGNIFICANTDIGITINTERVAL_H__
+
+#include "unicode/uobject.h"
+#include "unicode/utypes.h"
+
+U_NAMESPACE_BEGIN
+
+/**
+ * An interval of allowed significant digit counts.
+ */
+class U_I18N_API SignificantDigitInterval : public UMemory {
+public:
+
+ /**
+ * No limits on significant digits.
+ */
+ SignificantDigitInterval()
+ : fMax(INT32_MAX), fMin(0) { }
+
+ /**
+ * Make this instance have no limit on significant digits.
+ */
+ void clear() {
+ fMin = 0;
+ fMax = INT32_MAX;
+ }
+
+ /**
+ * Returns TRUE if this object is equal to rhs.
+ */
+ UBool equals(const SignificantDigitInterval &rhs) const {
+ return ((fMax == rhs.fMax) && (fMin == rhs.fMin));
+ }
+
+ /**
+ * Sets maximum significant digits. 0 or negative means no maximum.
+ */
+ void setMax(int32_t count) {
+ fMax = count <= 0 ? INT32_MAX : count;
+ }
+
+ /**
+ * Get maximum significant digits. INT32_MAX means no maximum.
+ */
+ int32_t getMax() const {
+ return fMax;
+ }
+
+ /**
+ * Sets minimum significant digits. 0 or negative means no minimum.
+ */
+ void setMin(int32_t count) {
+ fMin = count <= 0 ? 0 : count;
+ }
+
+ /**
+ * Get maximum significant digits. 0 means no minimum.
+ */
+ int32_t getMin() const {
+ return fMin;
+ }
+
+ /**
+ * Returns TRUE if this instance represents no constraints on significant
+ * digits.
+ */
+ UBool isNoConstraints() const {
+ return fMin == 0 && fMax == INT32_MAX;
+ }
+
+private:
+ int32_t fMax;
+ int32_t fMin;
+};
+
+U_NAMESPACE_END
+
+#endif // __SIGNIFICANTDIGITINTERVAL_H__
« no previous file with comments | « source/i18n/shareddateformatsymbols.h ('k') | source/i18n/smallintformatter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698