Flow123d
release_3.0.0-872-gff21c48
|
I/O functions with filename storing, able to track current line in opened file. All standard stdio functions working with files (not stdin, stdout, stderr) should be replaced by their equivalents from XIO library. More...
Go to the source code of this file.
Classes | |
struct | xfile |
XFILE structure holds additional info to generic FILE. More... | |
class | Xio |
Macros | |
#define | LINE_SIZE 65536 |
Typedefs | |
typedef struct xfile | XFILE |
XFILE structure holds additional info to generic FILE. More... | |
Functions | |
char * | xio_getfname (FILE *f) |
XIO library extensions. More... | |
char * | xio_getfmode (FILE *f) |
Get file mode from file stream. More... | |
int | xio_getlinesread (FILE *f) |
Get number of read lines from stream. More... | |
char * | xio_getfulldescription (FILE *f) |
Get pointer to string with full file description. More... | |
FILE * | xfopen (const char *fname, const char *mode) |
File access. More... | |
FILE * | xfopen (const std::string &fname, const char *mode) |
int | xfclose (FILE *stream) |
Close file (function) More... | |
int | xfflush (FILE *f) |
Flush stream (function) More... | |
FILE * | xfreopen (const char *filename, const char *mode, FILE *stream) |
Reopen stream with different file or mode. More... | |
int | xfprintf (FILE *out, const char *fmt,...) |
Formatted input/output. More... | |
int | xfscanf (FILE *in, const char *fmt,...) |
FSCANF WITH ERROR HANDLING. More... | |
char * | xfgets (char *s, int n, FILE *in) |
Character input/output. More... | |
int | xfgetc (FILE *f) |
Get character from stream (function) More... | |
int | xgetc (FILE *f) |
Get character from stream (function) More... | |
int | xungetc (int c, FILE *f) |
Unget character from stream (function) More... | |
size_t | xfread (void *ptr, size_t size, size_t count, FILE *stream) |
Direct input/output. More... | |
size_t | xfwrite (const void *ptr, size_t size, size_t count, FILE *stream) |
Write block of data to stream, handle errors. More... | |
void | xrewind (FILE *f) |
File positioning. More... | |
int | xfeof (FILE *f) |
Error-handling. More... | |
I/O functions with filename storing, able to track current line in opened file. All standard stdio functions working with files (not stdin, stdout, stderr) should be replaced by their equivalents from XIO library.
* Copyright (C) 2015 Technical University of Liberec. All rights reserved.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 3 as published by the Free Software Foundation. (http://www.gnu.org/licenses/gpl-3.0.en.html)
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
Definition in file xio.h.
int xfclose | ( | FILE * | stream | ) |
int xfeof | ( | FILE * | f | ) |
int xfflush | ( | FILE * | f | ) |
int xfgetc | ( | FILE * | f | ) |
char* xfgets | ( | char * | s, |
int | n, | ||
FILE * | in | ||
) |
Character input/output.
Get string from stream (function)
Character input/output.
[out] | s | Pointer to an array of chars where the string read is stored |
[in] | n | Maximum number of characters to be read (including the final null-character) |
[in,out] | in | Pointer to a FILE |
Definition at line 563 of file xio.cc.
FILE* xfopen | ( | const char * | fname, |
const char * | mode | ||
) |
FILE* xfopen | ( | const std::string & | fname, |
const char * | mode | ||
) |
int xfprintf | ( | FILE * | out, |
const char * | fmt, | ||
... | |||
) |
size_t xfread | ( | void * | ptr, |
size_t | size, | ||
size_t | count, | ||
FILE * | stream | ||
) |
Direct input/output.
Read block of data from stream (function)
Direct input/output.
[out] | ptr | Pointer to a block of memory with a minimum size of (size*count) bytes. |
[in] | size | Size in bytes of each element to be read. |
[in] | count | Number of elements, each one with a size of size bytes. |
[in,out] | stream | Pointer to a FILE object that specifies an input stream. |
FILE* xfreopen | ( | const char * | filename, |
const char * | mode, | ||
FILE * | stream | ||
) |
int xfscanf | ( | FILE * | in, |
const char * | fmt, | ||
... | |||
) |
size_t xfwrite | ( | const void * | ptr, |
size_t | size, | ||
size_t | count, | ||
FILE * | stream | ||
) |
Write block of data to stream, handle errors.
Write block of data to stream (function)
[in] | ptr | Pointer to a block of memory with a minimum size of (size*count) bytes. |
[in] | size | Size in bytes of each element to be written. |
[in] | count | Number of elements, each one with a size of size bytes. |
[in,out] | stream | Pointer to a FILE object that specifies an output stream. |
int xgetc | ( | FILE * | f | ) |
char* xio_getfmode | ( | FILE * | f | ) |
char* xio_getfname | ( | FILE * | f | ) |
char* xio_getfulldescription | ( | FILE * | f | ) |
int xio_getlinesread | ( | FILE * | f | ) |
void xrewind | ( | FILE * | f | ) |