]> granicus.if.org Git - icu/commitdiff
ICU-9803 Add API to get number formatter from UFile
authorMichael Ow <mow@svn.icu-project.org>
Thu, 31 Jan 2013 16:54:46 +0000 (16:54 +0000)
committerMichael Ow <mow@svn.icu-project.org>
Thu, 31 Jan 2013 16:54:46 +0000 (16:54 +0000)
X-SVN-Rev: 33101

icu4c/source/io/ufile.c
icu4c/source/io/unicode/ustdio.h

index 57476f22f9233afbcffa2e700e600c49c5353018..038ae5184595228b6ebab5730d2dd26e7c64df8d 100644 (file)
@@ -1,7 +1,7 @@
 /*
 ******************************************************************************
 *
-*   Copyright (C) 1998-2012, International Business Machines
+*   Copyright (C) 1998-2013, International Business Machines
 *   Corporation and others.  All Rights Reserved.
 *
 ******************************************************************************
@@ -299,4 +299,10 @@ u_fgetConverter(UFILE *file)
 {
     return file->fConverter;
 }
+#if !UCONFIG_NO_FORMATTING
+U_CAPI const UNumberFormat* U_EXPORT2 u_fgetNumberFormat(const UFILE *file)
+{
+    return u_locbund_getNumberFormat(&file->str.fBundle, UNUM_DECIMAL);
+}
+#endif
 
index 5732a7ec2bd78ed3549b4c4505265ca4bab8764b..b220198a106630403ed5463db1bf4fa52db5df93 100644 (file)
@@ -1,7 +1,7 @@
 /*
 ******************************************************************************
 *
-*   Copyright (C) 1998-2012, International Business Machines
+*   Copyright (C) 1998-2013, International Business Machines
 *   Corporation and others.  All Rights Reserved.
 *
 ******************************************************************************
@@ -29,6 +29,7 @@
 #include "unicode/ucnv.h"
 #include "unicode/utrans.h"
 #include "unicode/localpointer.h"
+#include "unicode/unum.h"
 
 /*
     TODO
@@ -438,6 +439,13 @@ u_fsetcodepage(const char   *codepage,
 U_STABLE UConverter* U_EXPORT2 u_fgetConverter(UFILE *f);
 
 #if !UCONFIG_NO_FORMATTING
+/**
+ * Returns an alias to the number formatter being used for this file.
+ * @param f The UFILE to get the value from
+ * @return alias to the number formatter (The formatter <EM>must not</EM> be modified or closed)
+ * @draft ICU 51
+*/
+ U_DRAFT const UNumberFormat* U_EXPORT2 u_fgetNumberFormat(const UFILE *f);
 
 /* Output functions */