Skip to content
This repository has been archived by the owner on Jun 16, 2024. It is now read-only.
/ fcheck-cpp Public archive

C «header-only» library for controlling the status of fstream objects.

License

LGPL-3.0, GPL-3.0 licenses found

Licenses found

LGPL-3.0
COPYING.LESSER
GPL-3.0
COPYING
Notifications You must be signed in to change notification settings

Dolfost/fcheck-cpp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fcheck

This C library simplifies monitoring of fstream objects.

Usage

Functions

bool is_open(ifstream& inFile, char *filenmae, bool exit_if_closed);
bool is_open(ofstream& inFile, char *filename, bool exit_if_closed);

inFile: main object,
filename: filename of file,
exit if closed: exit if file is closed,
<return>bool: true - opened, false - closed;

bool is_open(void (*funpt)(const char*), ifstream& inFile, char *filenmae, bool exit_if_closed);
bool is_open(void (*funpt)(const char*), ofstream& inFile, char *filename, bool exit_if_closed);

funpt: function pointer. must describe the error.
see readme/run/is_open_ifstream_example.cpp for details,
inFile: main object,
filename: filename of file,
exit if closed: exit if file is closed,
<return>bool: true - opened, false - closed;

short ifstrm_status(ifstream& inFile, const char *filename, bool exit_if_fail, bool eof_react, bool slient);

inFile: main object,
filename: file name,
exit_if_fail: exit if something bad,
eof_react: react to eof (if true, function returns true on eof),
slient: true - print messages, false - dont print messages,
<return>short: 0 - all ok, 1 - eof (if eof_react is true), 2 - data missmatch, 3 - unknown reason;

short ifstrm_status(void (*funpt[3])(const char*), ifstream& inFile, const char *filename, bool exit_if_fail, bool eof_react, bool slient);

funpt: pointer to array of 3 functions, [0] - eof, [1] - data missmatch, [2] - unknown reason. see readme/run/ifstream_status_example.cpp for details,
inFile: main object,
filename: file name,
exit_if_fail: exit if something bad,
eof_react: react to eof (if true, function returns true on eof),
slient: 1 - print messages (call funclions by passed pointers), 2 - dont print messages (call funclions by passed pointers),
<return>short: 0 - all ok, 1 - eof (if eof_react is true, else 0), 2 - data missmatch, 3 - unknown reason;

Examples

ifstream_status_example.cpp,
is_open_ifstream_example.cpp.

libinfo: libinfo.txt.


License: LGPL-3.0

GNU General Public License v3.0

Coffe...? PayPal

About

C «header-only» library for controlling the status of fstream objects.

Resources

License

LGPL-3.0, GPL-3.0 licenses found

Licenses found

LGPL-3.0
COPYING.LESSER
GPL-3.0
COPYING

Stars

Watchers

Forks

Languages