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.
FileOutputStream Struct Reference

An OutputStream that writes to user-specified files. More...

#include <file_output_stream.h>

Inheritance diagram for FileOutputStream:
[legend]
Collaboration diagram for FileOutputStream:
[legend]

Public Member Functions

OutputStreamAllocateFileOutputStream (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...
 
OutputStreamGetLogOutput (void)
 Get where logging messages will be sent. More...
 
OutputStreamGetErrorsOutput (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...
 

Detailed Description

An OutputStream that writes to user-specified files.

Member Function Documentation

◆ AllocateFileOutputStream()

OutputStream * AllocateFileOutputStream ( const char *const  filename_s)

Allocate a FileOutputStream.

Parameters
filename_sThe filename to write to. If this is NULL or cannot be opened for writing, the FileOutputStream will write to stdout instead.
Returns
A newly-allocated FileOutputStream or NULL on error.
See also
DeallocateFileOutputStream

Field Documentation

◆ fos_stream

OutputStream fos_stream

The base OutputStream.

◆ fos_filename_s

char* fos_filename_s

The filename that this OutputStream will write to.

◆ fos_out_f

FILE* fos_out_f

The FILE for this OutputStream.

◆ fos_close_on_exit_flag

bool fos_close_on_exit_flag

true if the fos_out_f will be closed on exit, false otherwise.


The documentation for this struct was generated from the following file: