Grassroots Infrastructure
The Grassroots Infrastructure is a suite of computing tools to help users and developers use scientific data infrastructure that can easily be interconnected.
|
An OutputStream that writes to user-specified files. More...
#include <file_output_stream.h>
Public Member Functions | |
OutputStream * | AllocateFileOutputStream (const char *const filename_s) |
Allocate a FileOutputStream. More... | |
Public Member Functions inherited from OutputStream | |
void | FreeDefaultOutputStream (void) |
Free the default OutputStreams. More... | |
void | SetDefaultErrorStream (OutputStream *stream_p) |
Set the Server-side OutputStream for printing error messages to. More... | |
void | SetDefaultLogStream (OutputStream *stream_p) |
Set the Server-side OutputStream for printing error messages to. More... | |
void | FreeOutputStream (struct OutputStream *stream_p) |
Free an OutputStream. More... | |
int | PrintToOutputStream (OutputStream *stream_p, const char *const filename_s, const int line_number, const char *message_s,...) |
Print to a given error OutputStream. More... | |
int | PrintErrors (const uint32 level, const char *const filename_s, const int line_number, const char *message,...) |
Print to the error OutputStream. More... | |
int | PrintLog (const uint32 level, const char *const filename_s, const int line_number, const char *message_s,...) |
Print to the log OutputStream. More... | |
int | PrintErrorsVarArgs (const uint32 level, const char *const filename_s, const int line_number, const char *message_s, va_list args) |
Print to the error OutputStream. More... | |
int | PrintLogVarArgs (const uint32 level, const char *const filename_s, const int line_number, const char *message_s, va_list args) |
Print to the log OutputStream. More... | |
OutputStream * | GetLogOutput (void) |
Get where logging messages will be sent. More... | |
OutputStream * | GetErrorsOutput (void) |
Get where error messages will be sent. More... | |
bool | FlushOutputStream (OutputStream *stream_p) |
Flush an OutputStream. More... | |
bool | FlushLog (void) |
Flush the logging OutputStream. More... | |
bool | FlushErrors (void) |
Flush the errors OutputStream. More... | |
Data Fields | |
OutputStream | fos_stream |
The base OutputStream. More... | |
char * | fos_filename_s |
The filename that this OutputStream will write to. More... | |
FILE * | fos_out_f |
The FILE for this OutputStream. More... | |
bool | fos_close_on_exit_flag |
true if the fos_out_f will be closed on exit, false otherwise. More... | |
Data Fields inherited from OutputStream | |
int(* | st_print_fn )(struct OutputStream *stream_p, const uint32 level, const char *const filename_s, const int line_number, const char *message_s, va_list args) |
Print to an OutputStream. More... | |
bool(* | st_flush_fn )(struct OutputStream *stream_p) |
Flush any pending writes to an OutputStream. More... | |
void(* | st_free_stream_fn )(struct OutputStream *stream_p) |
Callback function to free the OutputStream if it needs any custom behaviour. More... | |
An OutputStream that writes to user-specified files.
OutputStream * AllocateFileOutputStream | ( | const char *const | filename_s | ) |
Allocate a FileOutputStream.
filename_s | The filename to write to. If this is NULL or cannot be opened for writing, the FileOutputStream will write to stdout instead. |
NULL
on error.OutputStream fos_stream |
The base OutputStream.
char* fos_filename_s |
The filename that this OutputStream will write to.
FILE* fos_out_f |
The FILE for this OutputStream.
bool fos_close_on_exit_flag |
true
if the fos_out_f will be closed on exit, false
otherwise.