]>
git.saurik.com Git - apple/icu.git/blob - icuSources/tools/toolutil/filestrm.h
2 ******************************************************************************
4 * Copyright (C) 1997-2005, International Business Machines
5 * Corporation and others. All Rights Reserved.
7 ******************************************************************************
11 * Contains FileStream interface
15 * Modification History:
17 * Date Name Description
19 * 03/02/99 stephen Reordered params in ungetc to match stdio
22 ******************************************************************************
28 #include "unicode/utypes.h"
30 typedef struct _FileStream FileStream
;
32 U_CAPI FileStream
* U_EXPORT2
33 T_FileStream_open(const char* filename
, const char* mode
);
36 U_CAPI FileStream* U_EXPORT2
37 T_FileStream_wopen(const wchar_t* filename, const wchar_t* mode);
40 T_FileStream_close(FileStream
* fileStream
);
42 U_CAPI UBool U_EXPORT2
43 T_FileStream_file_exists(const char* filename
);
46 U_CAPI FileStream* U_EXPORT2
47 T_FileStream_tmpfile(void);
50 U_CAPI
int32_t U_EXPORT2
51 T_FileStream_read(FileStream
* fileStream
, void* addr
, int32_t len
);
53 U_CAPI
int32_t U_EXPORT2
54 T_FileStream_write(FileStream
* fileStream
, const void* addr
, int32_t len
);
57 T_FileStream_rewind(FileStream
* fileStream
);
59 /*Added by Bertrand A. D. */
60 U_CAPI
char * U_EXPORT2
61 T_FileStream_readLine(FileStream
* fileStream
, char* buffer
, int32_t length
);
63 U_CAPI
int32_t U_EXPORT2
64 T_FileStream_writeLine(FileStream
* fileStream
, const char* buffer
);
66 U_CAPI
int32_t U_EXPORT2
67 T_FileStream_putc(FileStream
* fileStream
, int32_t ch
);
70 T_FileStream_getc(FileStream
* fileStream
);
72 U_CAPI
int32_t U_EXPORT2
73 T_FileStream_ungetc(int32_t ch
, FileStream
*fileStream
);
75 U_CAPI
int32_t U_EXPORT2
76 T_FileStream_peek(FileStream
* fileStream
);
78 U_CAPI
int32_t U_EXPORT2
79 T_FileStream_size(FileStream
* fileStream
);
82 T_FileStream_eof(FileStream
* fileStream
);
85 T_FileStream_error(FileStream
* fileStream
);
89 T_FileStream_setError(FileStream* fileStream);
92 U_CAPI FileStream
* U_EXPORT2
93 T_FileStream_stdin(void);
95 U_CAPI FileStream
* U_EXPORT2
96 T_FileStream_stdout(void);
98 U_CAPI FileStream
* U_EXPORT2
99 T_FileStream_stderr(void);
101 U_CAPI UBool U_EXPORT2
102 T_FileStream_remove(const char* fileName
);
104 #endif /* _FILESTRM*/