]> git.saurik.com Git - apple/icu.git/blobdiff - icuSources/io/unicode/ustdio.h
ICU-64232.0.1.tar.gz
[apple/icu.git] / icuSources / io / unicode / ustdio.h
index 145b1f44b0a8c75e7786cf231686780ebc84a51a..a2ad3c2442765b6e697d834e3807d9cf7020f397 100644 (file)
@@ -1,7 +1,9 @@
+// © 2016 and later: Unicode, Inc. and others.
+// License & terms of use: http://www.unicode.org/copyright.html
 /*
 ******************************************************************************
 *
-*   Copyright (C) 1998-2011, International Business Machines
+*   Copyright (C) 1998-2015, International Business Machines
 *   Corporation and others.  All Rights Reserved.
 *
 ******************************************************************************
@@ -29,6 +31,9 @@
 #include "unicode/ucnv.h"
 #include "unicode/utrans.h"
 #include "unicode/localpointer.h"
+#include "unicode/unum.h"
+
+#if !UCONFIG_NO_CONVERSION
 
 /*
     TODO
@@ -240,6 +245,29 @@ u_fopen(const char    *filename,
     const char    *locale,
     const char    *codepage);
 
+/**
+ * Open a UFILE with a UChar* filename
+ * A UFILE is a wrapper around a FILE* that is locale and codepage aware.
+ * That is, data written to a UFILE will be formatted using the conventions
+ * specified by that UFILE's Locale; this data will be in the character set
+ * specified by that UFILE's codepage.
+ * @param filename The name of the file to open.
+ * @param perm The read/write permission for the UFILE; one of "r", "w", "rw"
+ * @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 the system default codepage
+ * will be used.
+ * @return A new UFILE, or NULL if an error occurred.
+ * @stable ICU 54
+ */
+U_STABLE UFILE* U_EXPORT2
+u_fopen_u(const UChar    *filename,
+    const char    *perm,
+    const char    *locale,
+    const char    *codepage);
+
 /**
  * Open a UFILE on top of an existing FILE* stream. The FILE* stream
  * ownership remains with the caller. To have the UFILE take over
@@ -327,7 +355,7 @@ U_DEFINE_LOCAL_OPEN_POINTER(LocalUFILEPointer, UFILE, u_fclose);
 
 U_NAMESPACE_END
 
-#endif
+#endif // U_SHOW_CPLUSPLUS_API
 
 /**
  * Tests if the UFILE is at the end of the file stream.
@@ -364,7 +392,7 @@ u_frewind(UFILE *file);
 /**
  * Get the FILE* associated with a UFILE.
  * @param f The UFILE
- * @return A FILE*, owned by the UFILE.  The FILE <EM>must not</EM> be closed.
+ * @return A FILE*, owned by the UFILE. (The FILE <EM>must not</EM> be modified or closed)
  * @stable ICU 3.0
  */
 U_STABLE FILE* U_EXPORT2
@@ -432,12 +460,19 @@ u_fsetcodepage(const char   *codepage,
 /**
  * Returns an alias to the converter being used for this file.
  * @param f The UFILE to get the value from
- * @return alias to the converter
+ * @return alias to the converter (The converter <EM>must not</EM> be modified or closed)
  * @stable ICU 3.0
  */
 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)
+ * @stable ICU 51
+*/
+ U_STABLE const UNumberFormat* U_EXPORT2 u_fgetNumberFormat(UFILE *f);
 
 /* Output functions */
 
@@ -446,9 +481,9 @@ U_STABLE UConverter* U_EXPORT2 u_fgetConverter(UFILE *f);
  * @param patternSpecification A pattern specifying how <TT>u_printf</TT> will
  * interpret the variable arguments received and format the data.
  * @return The number of Unicode characters written to <TT>stdout</TT>
- * @draft ICU 49
+ * @stable ICU 49
  */
-U_DRAFT int32_t U_EXPORT2
+U_STABLE int32_t U_EXPORT2
 u_printf(const char *patternSpecification,
          ... );
 
@@ -487,19 +522,19 @@ u_vfprintf(UFILE        *f,
  * @param patternSpecification A pattern specifying how <TT>u_printf_u</TT> will
  * interpret the variable arguments received and format the data.
  * @return The number of Unicode characters written to <TT>stdout</TT>
- * @draft ICU 49
+ * @stable ICU 49
  */
-U_DRAFT int32_t U_EXPORT2
+U_STABLE int32_t U_EXPORT2
 u_printf_u(const UChar *patternSpecification,
            ... );
 
 /**
  * Get a UFILE for <TT>stdout</TT>.
  * @return UFILE that writes to <TT>stdout</TT>
- * @draft ICU 49
+ * @stable ICU 49
  */
-U_DRAFT UFILE * U_EXPORT2
-u_get_stdout();
+U_STABLE UFILE * U_EXPORT2
+u_get_stdout(void);
 
 /**
  * Write formatted data to a UFILE.
@@ -975,6 +1010,8 @@ u_vsscanf_u(const UChar *buffer,
         const UChar     *patternSpecification,
         va_list         ap);
 
+
+#endif
 #endif
 #endif