]> git.saurik.com Git - apple/icu.git/blobdiff - icuSources/i18n/nfrs.h
ICU-461.12.tar.gz
[apple/icu.git] / icuSources / i18n / nfrs.h
index fcfe06be89257547879b566174fc639f94c506d2..b4822075f05322737bdf82fb8bd65f131b7ec61a 100644 (file)
@@ -1,6 +1,6 @@
 /*
 ******************************************************************************
-*   Copyright (C) 1997-2004, International Business Machines
+*   Copyright (C) 1997-2009, International Business Machines
 *   Corporation and others.  All Rights Reserved.
 ******************************************************************************
 *   file name:  nfrs.h
@@ -40,6 +40,22 @@ class NFRuleSet : public UMemory {
   UBool operator!=(const NFRuleSet& rhs) const { return !operator==(rhs); }
 
   UBool isPublic() const { return fIsPublic; }
+
+  UBool isParseable() const { 
+      UnicodeString prefixpart = UNICODE_STRING_SIMPLE("-prefixpart");
+      UnicodeString postfix = UNICODE_STRING_SIMPLE("-postfix");
+      UnicodeString postfx = UNICODE_STRING_SIMPLE("-postfx");
+
+      return ( name.indexOf(prefixpart) == -1 && name.indexOf(postfix) == -1 && name.indexOf(postfx) == -1 );
+  }
+
+  UBool isDecimalFormatRuleParseable() const { 
+      UnicodeString numberingYear = UNICODE_STRING_SIMPLE("spellout-numbering-year");
+      UnicodeString ordinal = UNICODE_STRING_SIMPLE("spellout-ordinal");
+
+      return ( name.indexOf(numberingYear) == -1 && name.indexOf(ordinal) == -1 );
+  }
+
   UBool isFractionRuleSet() const { return fIsFractionRuleSet; }
 
   void  getName(UnicodeString& result) const { result.setTo(name); }
@@ -48,7 +64,7 @@ class NFRuleSet : public UMemory {
   void  format(int64_t number, UnicodeString& toAppendTo, int32_t pos) const;
   void  format(double number, UnicodeString& toAppendTo, int32_t pos) const;
 
-  UBool parse(const UnicodeString& text, ParsePosition& pos, double upperBound, Formattable& result) const;
+  UBool parse(const UnicodeString& text, ParsePosition& pos, double upperBound, Formattable& result, UBool lenient=FALSE) const;
 
   void appendRules(UnicodeString& result) const; // toString