2
*******************************************************************************
4
* Copyright (C) 1998-1999, International Business Machines
5
* Corporation and others. All Rights Reserved.
7
*******************************************************************************
11
* Modification History:
13
* Date Name Description
14
* 12/01/98 stephen Creation.
15
* 03/12/99 stephen Modified for new C API.
16
*******************************************************************************
22
#include "unicode/utypes.h"
23
#include "unicode/ucnv.h"
24
#include "unicode/utrans.h"
27
/* The buffer size for fromUnicode calls */
28
#define UFILE_CHARBUFFER_SIZE 1024
30
/* The buffer size for toUnicode calls */
31
#define UFILE_UCHARBUFFER_SIZE 1024
36
UTransliterator *fTranslit;
37
UChar *buffer; /* Beginning of buffer */
38
int32_t capacity; /* Capacity of buffer */
39
int32_t pos; /* Beginning of untranslitted data */
40
int32_t length; /* Length *from beginning of buffer* of untranslitted data */
41
UTransliterator *translit;
42
} UFILETranslitBuffer;
45
FILE *fFile; /* the actual fs interface */
46
UBool fOwnFile; /* TRUE if fFile should be closed */
48
ULocaleBundle *fBundle; /* formatters */
49
UBool fOwnBundle; /* TRUE if fBundle should be deleted */
51
UConverter *fConverter; /* for codeset conversion */
53
/* buffer used for fromUnicode */
54
char fCharBuffer [UFILE_CHARBUFFER_SIZE];
56
/* buffer used for toUnicode */
57
UChar fUCBuffer [UFILE_UCHARBUFFER_SIZE];
59
UChar *fUCLimit; /* data limit in fUCBuffer */
60
UChar *fUCPos; /* current pos in fUCBuffer */
62
UFILETranslitBuffer *fTranslit;
66
* Like u_file_write but takes a flush parameter
68
U_CAPI int32_t U_EXPORT2
69
u_file_write_flush( const UChar *chars,
75
* Fill a UFILE's buffer with converted codepage data.
76
* @param f The UFILE containing the buffer to fill.
79
ufile_fill_uchar_buffer(UFILE *f);
82
* Close out the transliterator and flush any data therein.
86
ufile_close_translit(UFILE *f);
89
* Flush the buffer in the transliterator
90
* @param f UFile to flush
93
ufile_flush_translit(UFILE *f);