Movatterモバイル変換


[0]ホーム

URL:


ICU 78.1  78.1
Namespaces |Macros |Typedefs |Enumerations |Functions
ustdio.h File Reference

C API: Unicode stdio-like API.More...

#include <stdio.h>
#include <stdarg.h>
#include "unicode/utypes.h"
#include "unicode/ucnv.h"
#include "unicode/utrans.h"
#include "unicode/unum.h"
#include "unicode/localpointer.h"

Go to the source code of this file.

Namespaces

 icu
 Filecoll.h.
 

Macros

#define U_EOF   0xFFFF
 When an end of file is encountered, this value can be returned.More...
 

Typedefs

typedef structUFILE UFILE
 Forward declaration of a Unicode-aware file.More...
 

Enumerations

enum  UFileDirection {U_READ = 1,U_WRITE = 2,U_READWRITE =3 }
 Enum for which direction of stream a transliterator applies to.More...
 

Functions

U_CAPIUFILEu_fopen (const char *filename, const char *perm, const char *locale, const char *codepage)
 Open a UFILE.More...
 
U_CAPIUFILEu_fopen_u (constUChar *filename, const char *perm, 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.More...
 
U_CAPIUFILEu_finit (FILE *f, const char *locale, const char *codepage)
 Open a UFILE on top of an existing FILE* stream.More...
 
U_CAPIUFILEu_fadopt (FILE *f, const char *locale, const char *codepage)
 Open a UFILE on top of an existing FILE* stream.More...
 
U_CAPIUFILEu_fstropen (UChar *stringBuf, int32_t capacity, const char *locale)
 Create a UFILE that can be used for localized formatting or parsing.More...
 
U_CAPI void u_fclose (UFILE *file)
 Close a UFILE.More...
 
U_CAPIUBool u_feof (UFILE *f)
 Tests if the UFILE is at the end of the file stream.More...
 
U_CAPI void u_fflush (UFILE *file)
 Flush output of a UFILE.More...
 
U_CAPI void u_frewind (UFILE *file)
 Rewind the file pointer to the beginning of the file.More...
 
U_CAPI FILE * u_fgetfile (UFILE *f)
 Get the FILE* associated with a UFILE.More...
 
U_CAPI const char * u_fgetlocale (UFILE *file)
 Get the locale whose conventions are used to format and parse output.More...
 
U_CAPI int32_t u_fsetlocale (UFILE *file, const char *locale)
 Set the locale whose conventions will be used to format and parse output.More...
 
U_CAPI const char * u_fgetcodepage (UFILE *file)
 Get the codepage in which data is written to and read from the UFILE.More...
 
U_CAPI int32_t u_fsetcodepage (const char *codepage,UFILE *file)
 Set the codepage in which data will be written to and read from the UFILE.More...
 
U_CAPIUConverteru_fgetConverter (UFILE *f)
 Returns an alias to the converter being used for this file.More...
 
U_CAPI constUNumberFormatu_fgetNumberFormat (UFILE *f)
 Returns an alias to the number formatter being used for this file.More...
 
U_CAPI int32_t u_printf (const char *patternSpecification,...)
 Write formatted data tostdout.More...
 
U_CAPI int32_t u_fprintf (UFILE *f, const char *patternSpecification,...)
 Write formatted data to a UFILE.More...
 
U_CAPI int32_t u_vfprintf (UFILE *f, const char *patternSpecification, va_list ap)
 Write formatted data to a UFILE.More...
 
U_CAPI int32_t u_printf_u (constUChar *patternSpecification,...)
 Write formatted data tostdout.More...
 
U_CAPIUFILEu_get_stdout (void)
 Get a UFILE forstdout.More...
 
U_CAPI int32_t u_fprintf_u (UFILE *f, constUChar *patternSpecification,...)
 Write formatted data to a UFILE.More...
 
U_CAPI int32_t u_vfprintf_u (UFILE *f, constUChar *patternSpecification, va_list ap)
 Write formatted data to a UFILE.More...
 
U_CAPI int32_t u_fputs (constUChar *s,UFILE *f)
 Write a Unicode to a UFILE.More...
 
U_CAPIUChar32 u_fputc (UChar32 uc,UFILE *f)
 Write a UChar to a UFILE.More...
 
U_CAPI int32_t u_file_write (constUChar *ustring, int32_t count,UFILE *f)
 Write Unicode to a UFILE.More...
 
U_CAPI int32_t u_fscanf (UFILE *f, const char *patternSpecification,...)
 Read formatted data from a UFILE.More...
 
U_CAPI int32_t u_vfscanf (UFILE *f, const char *patternSpecification, va_list ap)
 Read formatted data from a UFILE.More...
 
U_CAPI int32_t u_fscanf_u (UFILE *f, constUChar *patternSpecification,...)
 Read formatted data from a UFILE.More...
 
U_CAPI int32_t u_vfscanf_u (UFILE *f, constUChar *patternSpecification, va_list ap)
 Read formatted data from a UFILE.More...
 
U_CAPIUCharu_fgets (UChar *s, int32_t n,UFILE *f)
 Read one line of text into a UChar* string from a UFILE.More...
 
U_CAPIUChar u_fgetc (UFILE *f)
 Read a UChar from a UFILE.More...
 
U_CAPIUChar32 u_fgetcx (UFILE *f)
 Read a UChar32 from a UFILE.More...
 
U_CAPIUChar32 u_fungetc (UChar32 c,UFILE *f)
 Unget a UChar from a UFILE.More...
 
U_CAPI int32_t u_file_read (UChar *chars, int32_t count,UFILE *f)
 Read Unicode from a UFILE.More...
 
U_CAPIUTransliteratoru_fsettransliterator (UFILE *file,UFileDirection direction,UTransliterator *adopt,UErrorCode *status)
 Set a transliterator on the UFILE.More...
 
U_CAPI int32_t u_sprintf (UChar *buffer, const char *patternSpecification,...)
 Write formatted data to a Unicode string.More...
 
U_CAPI int32_t u_snprintf (UChar *buffer, int32_t count, const char *patternSpecification,...)
 Write formatted data to a Unicode string.More...
 
U_CAPI int32_t u_vsprintf (UChar *buffer, const char *patternSpecification, va_list ap)
 Write formatted data to a Unicode string.More...
 
U_CAPI int32_t u_vsnprintf (UChar *buffer, int32_t count, const char *patternSpecification, va_list ap)
 Write formatted data to a Unicode string.More...
 
U_CAPI int32_t u_sprintf_u (UChar *buffer, constUChar *patternSpecification,...)
 Write formatted data to a Unicode string.More...
 
U_CAPI int32_t u_snprintf_u (UChar *buffer, int32_t count, constUChar *patternSpecification,...)
 Write formatted data to a Unicode string.More...
 
U_CAPI int32_t u_vsprintf_u (UChar *buffer, constUChar *patternSpecification, va_list ap)
 Write formatted data to a Unicode string.More...
 
U_CAPI int32_t u_vsnprintf_u (UChar *buffer, int32_t count, constUChar *patternSpecification, va_list ap)
 Write formatted data to a Unicode string.More...
 
U_CAPI int32_t u_sscanf (constUChar *buffer, const char *patternSpecification,...)
 Read formatted data from a Unicode string.More...
 
U_CAPI int32_t u_vsscanf (constUChar *buffer, const char *patternSpecification, va_list ap)
 Read formatted data from a Unicode string.More...
 
U_CAPI int32_t u_sscanf_u (constUChar *buffer, constUChar *patternSpecification,...)
 Read formatted data from a Unicode string.More...
 
U_CAPI int32_t u_vsscanf_u (constUChar *buffer, constUChar *patternSpecification, va_list ap)
 Read formatted data from a Unicode string.More...
 

Detailed Description

C API: Unicode stdio-like API.

Unicode stdio-like C API

This API provides an stdio-like API wrapper around ICU's other formatting and parsing APIs. It is meant to ease the transition of adding Unicode support to a preexisting applications using stdio. The following is a small list of noticeable differences between stdio and ICU I/O's ustdio implementation.

Formatting and Parsing Specification

General printf format:
%[format modifier][width][.precision][type modifier][format]

General scanf format:
%[*][format modifier][width][type modifier][format]

formatdefault
printf
type
default
scanf
type
description
EdoublefloatScientific with an uppercase exponent
edoublefloatScientific with a lowercase exponent
GdoublefloatUse E or f for best format
gdoublefloatUse e or f for best format
fdoublefloatSimple floating point without the exponent
Xint32_tint32_tustdio special uppercase hex radix formatting
xint32_tint32_tustdio special lowercase hex radix formatting
dint32_tint32_tDecimal format
iint32_tint32_tSame as d
nint32_tint32_tcount (write the number of UTF-16 codeunits read/written)
oint32_tint32_tustdio special octal radix formatting
uuint32_tuint32_tDecimal format
pvoid *void *Prints the pointer value
schar *char *Use default converter or specified converter from fopen
ccharcharUse default converter or specified converter from fopen
When width is specified for scanf, this acts like a non-NULL-terminated char * string.
By default, only one char is written.
SUChar *UChar *Null terminated UTF-16 string
CUCharUChar16-bit Unicode code unit
When width is specified for scanf, this acts like a non-NULL-terminated UChar * string
By default, only one codepoint is written.
%[] UChar *Null terminated UTF-16 string which contains the filtered set of characters specified by the UnicodeSet
%%  Show a percent sign

Format modifiers

modifierformatstypecomments
hd, i, o, xint16_tshort format
huuint16_tshort format
hcchar(Unimplemented) Use invariant converter
hschar *(Unimplemented) Use invariant converter
hCchar(Unimplemented) 8-bit Unicode code unit
hSchar *(Unimplemented) Null terminated UTF-8 string
ld, i, o, xint32_tlong format (no effect)
luuint32_tlong format (no effect)
lcN/A(Unimplemented) Reserved for future implementation
lsN/A(Unimplemented) Reserved for future implementation
lCUChar32(Unimplemented) 32-bit Unicode code unit
lSUChar32 *(Unimplemented) Null terminated UTF-32 string
lld, i, o, xint64_tlong long format
lluuint64_t(Unimplemented) long long format
%-allN/ALeft justify
%+d, i, o, x, e, f, g, E, GN/AAlways show the plus or minus sign. Needs data for plus sign.
%d, i, o, x, e, f, g, E, GN/AInstead of a "+" output a blank character for positive numbers.
%#d, i, o, x, e, f, g, E, GN/APrecede octal value with 0, hex with 0x and show the decimal point for floats.
%nallN/AWidth of input/output. num is an actual number from 0 to some large number.
%.ne, f, g, E, F, GN/ASignificant digits precision. num is an actual number from 0 to some large number.
If * is used in printf, then the precision is passed in as an argument before the number to be formatted.

printf modifier %* int32_t Next argument after this one specifies the width

scanf modifier %* N/A This field is scanned, but not stored

If you are using this C API instead of theustream.h API for C++, you can use one of the following u_fprintf examples to display a UnicodeString.

    UFILE *out = u_finit(stdout, NULL, NULL);    UnicodeString string1("string 1");    UnicodeString string2("string 2");    u_fprintf(out, "%S\n", string1.getTerminatedBuffer());    u_fprintf(out, "%.*S\n", string2.length(), string2.getBuffer());    u_fclose(out);

Definition in fileustdio.h.

Macro Definition Documentation

◆ U_EOF

#define U_EOF   0xFFFF

When an end of file is encountered, this value can be returned.

See also
u_fgetc
Stable:
3.0

Definition at line212 of fileustdio.h.

Typedef Documentation

◆ UFILE

typedef structUFILEUFILE

Forward declaration of a Unicode-aware file.

Stable:
3.0

Definition at line1 of fileustdio.h.

Enumeration Type Documentation

◆ UFileDirection

enumUFileDirection

Enum for which direction of stream a transliterator applies to.

See also
u_fsettransliterator
Stable:
ICU 3.0

Definition at line222 of fileustdio.h.

Function Documentation

◆ u_fadopt()

U_CAPIUFILE* u_fadopt(FILE * f,
const char * locale,
const char * codepage 
)

Open a UFILE on top of an existing FILE* stream.

The FILE* stream ownership is transferred to the new UFILE. It will be closed when the UFILE is closed.

Parameters
fThe FILE* which this UFILE will take ownership of.
localeThe locale whose conventions will be used to format and parse output. If this parameter is NULL, the default locale will be used.
codepageThe codepage in which data will be written to and read from the file. If this parameter is NULL, data will be written and read using the default codepage forlocale, unlesslocale is NULL, in which case the system default codepage will be used.
Returns
A new UFILE, or NULL if an error occurred. If an error occurs the ownership of the FILE* stream remains with the caller.
Stable:
ICU 4.4

◆ u_fclose()

U_CAPI void u_fclose(UFILEfile)

Close a UFILE.

Implies u_fflush first.

Parameters
fileThe UFILE to close.
Stable:
ICU 3.0
See also
u_fflush

◆ u_feof()

U_CAPIUBool u_feof(UFILEf)

Tests if the UFILE is at the end of the file stream.

Parameters
fThe UFILE from which to read.
Returns
Returns true after the first read operation that attempts to read past the end of the file. It returns false if the current position is not end of file.
Stable:
ICU 3.0

◆ u_fflush()

U_CAPI void u_fflush(UFILEfile)

Flush output of a UFILE.

Implies a flush of converter/transliterator state. (That is, a logical break is made in the output stream - for example if a different type of output is desired.) The underlying OS level file is also flushed. Note that for a stateful encoding, the converter may write additional bytes to return the stream to default state.

Parameters
fileThe UFILE to flush.
Stable:
ICU 3.0

◆ u_fgetc()

U_CAPIUChar u_fgetc(UFILEf)

Read a UChar from a UFILE.

It is recommended thatu_fgetcx used instead for proper parsing functions, but sometimes reading code units is needed instead of codepoints.

Parameters
fThe UFILE from which to read.
Returns
The UChar value read, or U+FFFF if no character was available.
Stable:
ICU 3.0

◆ u_fgetcodepage()

U_CAPI const char* u_fgetcodepage(UFILEfile)

Get the codepage in which data is written to and read from the UFILE.

This is the same codepage passed in the preceding call tou_fsetcodepage oru_fopen.

Parameters
fileThe UFILE to query.
Returns
The codepage in which data is written to and read from the UFILE, or NULL if an error occurred.
Stable:
ICU 3.0

◆ u_fgetConverter()

U_CAPIUConverter* u_fgetConverter(UFILEf)

Returns an alias to the converter being used for this file.

Parameters
fThe UFILE to get the value from
Returns
alias to the converter (The convertermust not be modified or closed)
Stable:
ICU 3.0

◆ u_fgetcx()

U_CAPIUChar32 u_fgetcx(UFILEf)

Read a UChar32 from a UFILE.

Parameters
fThe UFILE from which to read.
Returns
The UChar32 value read, or U_EOF if no character was available, or U+FFFD (replacement character) if an ill-formed character was encountered.
See also
u_unescape()
Stable:
ICU 3.0

◆ u_fgetfile()

U_CAPI FILE* u_fgetfile(UFILEf)

Get the FILE* associated with a UFILE.

Parameters
fThe UFILE
Returns
A FILE*, owned by the UFILE. (The FILEmust not be modified or closed)
Stable:
ICU 3.0

◆ u_fgetlocale()

U_CAPI const char* u_fgetlocale(UFILEfile)

Get the locale whose conventions are used to format and parse output.

This is the same locale passed in the preceding call tou_fsetlocale oru_fopen.

Parameters
fileThe UFILE to set.
Returns
The locale whose conventions are used to format and parse output.
Stable:
ICU 3.0

◆ u_fgetNumberFormat()

U_CAPI constUNumberFormat* u_fgetNumberFormat(UFILEf)

Returns an alias to the number formatter being used for this file.

Parameters
fThe UFILE to get the value from
Returns
alias to the number formatter (The formattermust not be modified or closed)
Stable:
ICU 51

◆ u_fgets()

U_CAPIUChar* u_fgets(UChars,
int32_t n,
UFILEf 
)

Read one line of text into a UChar* string from a UFILE.

The newline at the end of the line is read into the string. The string is always null terminated

Parameters
fThe UFILE from which to read.
nThe maximum number of characters - 1 to read.
sThe UChar* to receive the read data. Characters will be stored successively ins until a newline or EOF is reached. A null character (U+0000) will be appended tos.
Returns
A pointer tos, or NULL if no characters were available.
Stable:
ICU 3.0

◆ u_file_read()

U_CAPI int32_t u_file_read(UCharchars,
int32_t count,
UFILEf 
)

Read Unicode from a UFILE.

Bytes will be converted from the UFILE's underlying codepage, with subsequent conversion to Unicode. The data will not be NULL terminated.

Parameters
charsA pointer to receive the Unicode data.
countThe number of Unicode characters to read.
fThe UFILE from which to read.
Returns
The number of Unicode characters read.
Stable:
ICU 3.0

◆ u_file_write()

U_CAPI int32_t u_file_write(constUCharustring,
int32_t count,
UFILEf 
)

Write Unicode to a UFILE.

The ustring passed in will be converted to the UFILE's underlying codepage before it is written.

Parameters
ustringA pointer to the Unicode data to write.
countThe number of Unicode characters to write
fThe UFILE to which to write.
Returns
The number of Unicode characters written.
See also
u_fputs
Stable:
ICU 3.0

◆ u_finit()

U_CAPIUFILE* u_finit(FILE * f,
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 ownership and responsibility for the FILE* stream, use the function u_fadopt.

Parameters
fThe FILE* to which this UFILE will attach and use.
localeThe locale whose conventions will be used to format and parse output. If this parameter is NULL, the default locale will be used.
codepageThe codepage in which data will be written to and read from the file. If this parameter is NULL, data will be written and read using the default codepage forlocale, unlesslocale is NULL, in which case the system default codepage will be used.
Returns
A new UFILE, or NULL if an error occurred.
Stable:
ICU 3.0

◆ u_fopen()

U_CAPIUFILE* u_fopen(const char * filename,
const char * perm,
const char * locale,
const char * codepage 
)

Open a UFILE.

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.

Parameters
filenameThe name of the file to open. Must be 0-terminated.
permThe read/write permission for the UFILE; one of "r", "w", "rw"
localeThe locale whose conventions will be used to format and parse output. If this parameter is NULL, the default locale will be used.
codepageThe codepage in which data will be written to and read from the file. If this parameter is NULL the system default codepage will be used.
Returns
A new UFILE, or NULL if an error occurred.
Stable:
ICU 3.0

◆ u_fopen_u()

U_CAPIUFILE* u_fopen_u(constUCharfilename,
const char * perm,
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.

Parameters
filenameThe name of the file to open. Must be 0-terminated.
permThe read/write permission for the UFILE; one of "r", "w", "rw"
localeThe locale whose conventions will be used to format and parse output. If this parameter is NULL, the default locale will be used.
codepageThe codepage in which data will be written to and read from the file. If this parameter is NULL the system default codepage will be used.
Returns
A new UFILE, or NULL if an error occurred.
Stable:
ICU 54

◆ u_fprintf()

U_CAPI int32_t u_fprintf(UFILEf,
const char * patternSpecification,
 ... 
)

Write formatted data to a UFILE.

Parameters
fThe UFILE to which to write.
patternSpecificationA pattern specifying howu_fprintf will interpret the variable arguments received and format the data.
Returns
The number of Unicode characters written tof.
Stable:
ICU 3.0

◆ u_fprintf_u()

U_CAPI int32_t u_fprintf_u(UFILEf,
constUCharpatternSpecification,
 ... 
)

Write formatted data to a UFILE.

Parameters
fThe UFILE to which to write.
patternSpecificationA pattern specifying howu_fprintf will interpret the variable arguments received and format the data.
Returns
The number of Unicode characters written tof.
Stable:
ICU 3.0

◆ u_fputc()

U_CAPIUChar32 u_fputc(UChar32 uc,
UFILEf 
)

Write a UChar to a UFILE.

Parameters
ucThe UChar to write.
fThe UFILE to which to write.
Returns
The character written if successful, EOF otherwise.
Stable:
ICU 3.0

◆ u_fputs()

U_CAPI int32_t u_fputs(constUChars,
UFILEf 
)

Write a Unicode to a UFILE.

The null (U+0000) terminated UChar*s will be written tof, excluding the NULL terminator. A newline will be added tof.

Parameters
sThe UChar* to write.
fThe UFILE to which to write.
Returns
A non-negative number if successful, EOF otherwise.
See also
u_file_write
Stable:
ICU 3.0

◆ u_frewind()

U_CAPI void u_frewind(UFILEfile)

Rewind the file pointer to the beginning of the file.

Parameters
fileThe UFILE to rewind.
Stable:
ICU 3.0

◆ u_fscanf()

U_CAPI int32_t u_fscanf(UFILEf,
const char * patternSpecification,
 ... 
)

Read formatted data from a UFILE.

Parameters
fThe UFILE from which to read.
patternSpecificationA pattern specifying howu_fscanf will interpret the variable arguments received and parse the data.
Returns
The number of items successfully converted and assigned, or EOF if an error occurred.
Stable:
ICU 3.0

◆ u_fscanf_u()

U_CAPI int32_t u_fscanf_u(UFILEf,
constUCharpatternSpecification,
 ... 
)

Read formatted data from a UFILE.

Parameters
fThe UFILE from which to read.
patternSpecificationA pattern specifying howu_fscanf will interpret the variable arguments received and parse the data.
Returns
The number of items successfully converted and assigned, or EOF if an error occurred.
Stable:
ICU 3.0

◆ u_fsetcodepage()

U_CAPI int32_t u_fsetcodepage(const char * codepage,
UFILEfile 
)

Set the codepage in which data will be written to and read from the UFILE.

All Unicode data written to the UFILE will be converted to this codepage before it is written to the underlying FILE*. It it generally a bad idea to mix codepages within a file. This should only be called right after opening theUFile, or after callingu_frewind.

Parameters
codepageThe codepage in which data will be written to and read from the file. For example"latin-1" or"ibm-943". A value of NULL means the default codepage for the UFILE's current locale will be used.
fileThe UFILE to set.
Returns
0 if successful, otherwise a negative number.
See also
u_frewind
Stable:
ICU 3.0

◆ u_fsetlocale()

U_CAPI int32_t u_fsetlocale(UFILEfile,
const char * locale 
)

Set the locale whose conventions will be used to format and parse output.

Parameters
localeThe locale whose conventions will be used to format and parse output.
fileThe UFILE to query.
Returns
NULL if successful, otherwise a negative number.
Stable:
ICU 3.0

◆ u_fsettransliterator()

U_CAPIUTransliterator* u_fsettransliterator(UFILEfile,
UFileDirection direction,
UTransliteratoradopt,
UErrorCodestatus 
)

Set a transliterator on the UFILE.

The transliterator will be owned by the UFILE.

Parameters
fileThe UFILE to set transliteration on
adoptThe UTransliterator to set. Can be NULL, which will mean that no transliteration is used.
directioneither U_READ, U_WRITE, or U_READWRITE - sets which direction the transliterator is to be applied to. If U_READWRITE, the "Read" transliteration will be in the inverse direction.
statusICU error code.
Returns
The previously set transliterator, owned by the caller. If U_READWRITE is specified, only the WRITE transliterator is returned. In most cases, the caller should callutrans_close() on the result of this function.
Stable:
ICU 3.0

◆ u_fstropen()

U_CAPIUFILE* u_fstropen(UCharstringBuf,
int32_t capacity,
const char * locale 
)

Create a UFILE that can be used for localized formatting or parsing.

The u_sprintf and u_sscanf functions do not read or write numbers for a specific locale. Theustdio.h file functions can be used on this UFILE. The string is usable once u_fclose or u_fflush has been called on the returned UFILE.

Parameters
stringBufThe string used for reading or writing.
capacityThe number of code units available for use in stringBuf
localeThe locale whose conventions will be used to format and parse output. If this parameter is NULL, the default locale will be used.
Returns
A new UFILE, or NULL if an error occurred.
Stable:
ICU 3.0

◆ u_fungetc()

U_CAPIUChar32 u_fungetc(UChar32 c,
UFILEf 
)

Unget a UChar from a UFILE.

If this function is not the first to operate onf after a call tou_fgetc, the results are undefined. If this function is passed a character that was not received from the previousu_fgetc oru_fgetcx call, the results are undefined.

Parameters
cThe UChar to put back on the stream.
fThe UFILE to receivec.
Returns
The UChar32 value put back if successful, U_EOF otherwise.
Stable:
ICU 3.0

◆ u_get_stdout()

U_CAPIUFILE* u_get_stdout(void )

Get a UFILE forstdout.

Returns
UFILE that writes tostdout
Stable:
ICU 49

◆ u_printf()

U_CAPI int32_t u_printf(const char * patternSpecification,
 ... 
)

Write formatted data tostdout.

Parameters
patternSpecificationA pattern specifying howu_printf will interpret the variable arguments received and format the data.
Returns
The number of Unicode characters written tostdout
Stable:
ICU 49

◆ u_printf_u()

U_CAPI int32_t u_printf_u(constUCharpatternSpecification,
 ... 
)

Write formatted data tostdout.

Parameters
patternSpecificationA pattern specifying howu_printf_u will interpret the variable arguments received and format the data.
Returns
The number of Unicode characters written tostdout
Stable:
ICU 49

◆ u_snprintf()

U_CAPI int32_t u_snprintf(UCharbuffer,
int32_t count,
const char * patternSpecification,
 ... 
)

Write formatted data to a Unicode string.

When the number of code units required to store the data exceedscount, thencount code units of data are stored inbuffer and a negative value is returned. When the number of code units required to store the data equalscount, the string is not null terminated andcount is returned.

Parameters
bufferThe Unicode String to which to write.
countThe number of code units to read.
patternSpecificationA pattern specifying howu_sprintf will interpret the variable arguments received and format the data.
Returns
The number of Unicode characters that would have been written tobuffer had count been sufficiently large. This does not include the terminating null character.
Stable:
ICU 3.0

◆ u_snprintf_u()

U_CAPI int32_t u_snprintf_u(UCharbuffer,
int32_t count,
constUCharpatternSpecification,
 ... 
)

Write formatted data to a Unicode string.

When the number of code units required to store the data exceedscount, thencount code units of data are stored inbuffer and a negative value is returned. When the number of code units required to store the data equalscount, the string is not null terminated andcount is returned.

Parameters
bufferThe Unicode string to which to write.
countThe number of code units to read.
patternSpecificationA pattern specifying howu_sprintf will interpret the variable arguments received and format the data.
Returns
The number of Unicode characters that would have been written tobuffer had count been sufficiently large.
Stable:
ICU 3.0

◆ u_sprintf()

U_CAPI int32_t u_sprintf(UCharbuffer,
const char * patternSpecification,
 ... 
)

Write formatted data to a Unicode string.

Parameters
bufferThe Unicode String to which to write.
patternSpecificationA pattern specifying howu_sprintf will interpret the variable arguments received and format the data.
Returns
The number of Unicode code units written tobuffer. This does not include the terminating null character.
Stable:
ICU 3.0

◆ u_sprintf_u()

U_CAPI int32_t u_sprintf_u(UCharbuffer,
constUCharpatternSpecification,
 ... 
)

Write formatted data to a Unicode string.

Parameters
bufferThe Unicode string to which to write.
patternSpecificationA pattern specifying howu_sprintf will interpret the variable arguments received and format the data.
Returns
The number of Unicode characters written tobuffer.
Stable:
ICU 3.0

◆ u_sscanf()

U_CAPI int32_t u_sscanf(constUCharbuffer,
const char * patternSpecification,
 ... 
)

Read formatted data from a Unicode string.

Parameters
bufferThe Unicode string from which to read.
patternSpecificationA pattern specifying howu_sscanf will interpret the variable arguments received and parse the data.
Returns
The number of items successfully converted and assigned, or EOF if an error occurred.
Stable:
ICU 3.0

◆ u_sscanf_u()

U_CAPI int32_t u_sscanf_u(constUCharbuffer,
constUCharpatternSpecification,
 ... 
)

Read formatted data from a Unicode string.

Parameters
bufferThe Unicode string from which to read.
patternSpecificationA pattern specifying howu_sscanf will interpret the variable arguments received and parse the data.
Returns
The number of items successfully converted and assigned, or EOF if an error occurred.
Stable:
ICU 3.0

◆ u_vfprintf()

U_CAPI int32_t u_vfprintf(UFILEf,
const char * patternSpecification,
va_list ap 
)

Write formatted data to a UFILE.

This is identical tou_fprintf, except that it willnot callva_start andva_end.

Parameters
fThe UFILE to which to write.
patternSpecificationA pattern specifying howu_fprintf will interpret the variable arguments received and format the data.
apThe argument list to use.
Returns
The number of Unicode characters written tof.
See also
u_fprintf
Stable:
ICU 3.0

◆ u_vfprintf_u()

U_CAPI int32_t u_vfprintf_u(UFILEf,
constUCharpatternSpecification,
va_list ap 
)

Write formatted data to a UFILE.

This is identical tou_fprintf_u, except that it willnot callva_start andva_end.

Parameters
fThe UFILE to which to write.
patternSpecificationA pattern specifying howu_fprintf will interpret the variable arguments received and format the data.
apThe argument list to use.
Returns
The number of Unicode characters written tof.
See also
u_fprintf_u
Stable:
ICU 3.0

◆ u_vfscanf()

U_CAPI int32_t u_vfscanf(UFILEf,
const char * patternSpecification,
va_list ap 
)

Read formatted data from a UFILE.

This is identical tou_fscanf, except that it willnot callva_start andva_end.

Parameters
fThe UFILE from which to read.
patternSpecificationA pattern specifying howu_fscanf will interpret the variable arguments received and parse the data.
apThe argument list to use.
Returns
The number of items successfully converted and assigned, or EOF if an error occurred.
See also
u_fscanf
Stable:
ICU 3.0

◆ u_vfscanf_u()

U_CAPI int32_t u_vfscanf_u(UFILEf,
constUCharpatternSpecification,
va_list ap 
)

Read formatted data from a UFILE.

This is identical tou_fscanf_u, except that it willnot callva_start andva_end.

Parameters
fThe UFILE from which to read.
patternSpecificationA pattern specifying howu_fscanf will interpret the variable arguments received and parse the data.
apThe argument list to use.
Returns
The number of items successfully converted and assigned, or EOF if an error occurred.
See also
u_fscanf_u
Stable:
ICU 3.0

◆ u_vsnprintf()

U_CAPI int32_t u_vsnprintf(UCharbuffer,
int32_t count,
const char * patternSpecification,
va_list ap 
)

Write formatted data to a Unicode string.

This is identical tou_snprintf, except that it willnot callva_start andva_end.

When the number of code units required to store the data exceedscount, thencount code units of data are stored inbuffer and a negative value is returned. When the number of code units required to store the data equalscount, the string is not null terminated andcount is returned.

Parameters
bufferThe Unicode string to which to write.
countThe number of code units to read.
patternSpecificationA pattern specifying howu_sprintf will interpret the variable arguments received and format the data.
apThe argument list to use.
Returns
The number of Unicode characters that would have been written tobuffer had count been sufficiently large.
See also
u_sprintf
Stable:
ICU 3.0

◆ u_vsnprintf_u()

U_CAPI int32_t u_vsnprintf_u(UCharbuffer,
int32_t count,
constUCharpatternSpecification,
va_list ap 
)

Write formatted data to a Unicode string.

This is identical tou_snprintf_u, except that it willnot callva_start andva_end. When the number of code units required to store the data exceedscount, thencount code units of data are stored inbuffer and a negative value is returned. When the number of code units required to store the data equalscount, the string is not null terminated andcount is returned.

Parameters
bufferThe Unicode string to which to write.
countThe number of code units to read.
patternSpecificationA pattern specifying howu_sprintf will interpret the variable arguments received and format the data.
apThe argument list to use.
Returns
The number of Unicode characters that would have been written tof had count been sufficiently large.
See also
u_sprintf_u
Stable:
ICU 3.0

◆ u_vsprintf()

U_CAPI int32_t u_vsprintf(UCharbuffer,
const char * patternSpecification,
va_list ap 
)

Write formatted data to a Unicode string.

This is identical tou_sprintf, except that it willnot callva_start andva_end.

Parameters
bufferThe Unicode string to which to write.
patternSpecificationA pattern specifying howu_sprintf will interpret the variable arguments received and format the data.
apThe argument list to use.
Returns
The number of Unicode characters written tobuffer.
See also
u_sprintf
Stable:
ICU 3.0

◆ u_vsprintf_u()

U_CAPI int32_t u_vsprintf_u(UCharbuffer,
constUCharpatternSpecification,
va_list ap 
)

Write formatted data to a Unicode string.

This is identical tou_sprintf_u, except that it willnot callva_start andva_end.

Parameters
bufferThe Unicode string to which to write.
patternSpecificationA pattern specifying howu_sprintf will interpret the variable arguments received and format the data.
apThe argument list to use.
Returns
The number of Unicode characters written tof.
See also
u_sprintf_u
Stable:
ICU 3.0

◆ u_vsscanf()

U_CAPI int32_t u_vsscanf(constUCharbuffer,
const char * patternSpecification,
va_list ap 
)

Read formatted data from a Unicode string.

This is identical tou_sscanf, except that it willnot callva_start andva_end.

Parameters
bufferThe Unicode string from which to read.
patternSpecificationA pattern specifying howu_sscanf will interpret the variable arguments received and parse the data.
apThe argument list to use.
Returns
The number of items successfully converted and assigned, or EOF if an error occurred.
See also
u_sscanf
Stable:
ICU 3.0

◆ u_vsscanf_u()

U_CAPI int32_t u_vsscanf_u(constUCharbuffer,
constUCharpatternSpecification,
va_list ap 
)

Read formatted data from a Unicode string.

This is identical tou_sscanf_u, except that it willnot callva_start andva_end.

Parameters
bufferThe Unicode string from which to read.
patternSpecificationA pattern specifying howu_sscanf will interpret the variable arguments received and parse the data.
apThe argument list to use.
Returns
The number of items successfully converted and assigned, or EOF if an error occurred.
See also
u_sscanf_u
Stable:
ICU 3.0

Generated by doxygen 1.9.1
[8]ページ先頭

©2009-2025 Movatter.jp