]>
git.saurik.com Git - apple/icu.git/blob - icuSources/tools/toolutil/filestrm.h
1 // © 2016 and later: Unicode, Inc. and others.
2 // License & terms of use: http://www.unicode.org/copyright.html
4 ******************************************************************************
6 * Copyright (C) 1997-2005, International Business Machines
7 * Corporation and others. All Rights Reserved.
9 ******************************************************************************
13 * Contains FileStream interface
17 * Modification History:
19 * Date Name Description
21 * 03/02/99 stephen Reordered params in ungetc to match stdio
24 ******************************************************************************
30 #include "unicode/utypes.h"
32 typedef struct _FileStream FileStream
;
34 U_CAPI FileStream
* U_EXPORT2
35 T_FileStream_open(const char* filename
, const char* mode
);
38 U_CAPI FileStream* U_EXPORT2
39 T_FileStream_wopen(const wchar_t* filename, const wchar_t* mode);
42 T_FileStream_close(FileStream
* fileStream
);
44 U_CAPI UBool U_EXPORT2
45 T_FileStream_file_exists(const char* filename
);
48 U_CAPI FileStream* U_EXPORT2
49 T_FileStream_tmpfile(void);
52 U_CAPI
int32_t U_EXPORT2
53 T_FileStream_read(FileStream
* fileStream
, void* addr
, int32_t len
);
55 U_CAPI
int32_t U_EXPORT2
56 T_FileStream_write(FileStream
* fileStream
, const void* addr
, int32_t len
);
59 T_FileStream_rewind(FileStream
* fileStream
);
61 /*Added by Bertrand A. D. */
62 U_CAPI
char * U_EXPORT2
63 T_FileStream_readLine(FileStream
* fileStream
, char* buffer
, int32_t length
);
65 U_CAPI
int32_t U_EXPORT2
66 T_FileStream_writeLine(FileStream
* fileStream
, const char* buffer
);
68 U_CAPI
int32_t U_EXPORT2
69 T_FileStream_putc(FileStream
* fileStream
, int32_t ch
);
72 T_FileStream_getc(FileStream
* fileStream
);
74 U_CAPI
int32_t U_EXPORT2
75 T_FileStream_ungetc(int32_t ch
, FileStream
*fileStream
);
77 U_CAPI
int32_t U_EXPORT2
78 T_FileStream_peek(FileStream
* fileStream
);
80 U_CAPI
int32_t U_EXPORT2
81 T_FileStream_size(FileStream
* fileStream
);
84 T_FileStream_eof(FileStream
* fileStream
);
87 T_FileStream_error(FileStream
* fileStream
);
91 T_FileStream_setError(FileStream* fileStream);
94 U_CAPI FileStream
* U_EXPORT2
95 T_FileStream_stdin(void);
97 U_CAPI FileStream
* U_EXPORT2
98 T_FileStream_stdout(void);
100 U_CAPI FileStream
* U_EXPORT2
101 T_FileStream_stderr(void);
103 U_CAPI UBool U_EXPORT2
104 T_FileStream_remove(const char* fileName
);
106 #endif /* _FILESTRM*/