#include <UTIOStreams.h>
Public Member Functions | |
virtual Status_t | Position (out fileoff_t *position)=0 |
virtual Status_t | Seek (fileoff_t position)=0 |
virtual Status_t | SeekRelative (fileoff_t delta) |
virtual Status_t | Close ()=0 |
Static Public Member Functions | |
static void | SetFileUnderTest (IOStream_t *file) |
Protected Member Functions | |
virtual void | AppendStateInfo (String_t *state) const |
Static Protected Member Functions | |
static void | FunctionIn (const IOStream_t *file, bool from_thread, stringliteral *function, stringliteral *format,...) |
static void | FunctionReturnStatusCode (const IOStream_t *file, bool from_thread, int line, error_code_t status) |
static void | FunctionReturn (const IOStream_t *file, bool from_thread, int line) |
static void | FunctionLogState (const IOStream_t *file, bool from_thread, int line, stringliteral *format,...) |
static void | FunctionReadStart (const IOStream_t *file, bool from_thread, int line, fileoff_t pos, int bytes_to_read, bool force_read_all) |
static void | FunctionReadData (const IOStream_t *file, bool from_thread, int line, const byte *buffer, fileoff_t pos, int bytes_read) |
static void | FunctionWriteData (const IOStream_t *file, bool from_thread, int line, stringliteral *what, const byte *buffer, fileoff_t pos, int bytes_to_write, bool force_write_all) |
Generic input and output stream aggregate. The position for the input and output stream are synchronized, as for reading from and writing to a file. If the input and output streams need to be independent, use of IOStream_t is not appropriate.
Definition at line 258 of file UTIOStreams.h.
Redefined as pure virtual in IOStream_t to resolve ambiguity as to which base class's version is to be called. In fact, a class derived from IOStream_t will need to implement a Position function which implements Position for both base classes. See InputStream_t::Position or OutputStream_t::Position for documentation.
Implements InputStream_t.
Implemented in BufferedFile_t, File_t, and BufferIOStream_t.
Redefined as pure virtual in IOStream_t to resolve ambiguity as to which base class's version is to be called. In fact, a class derived from IOStream_t will need to implement a Seek function which implements Seek for both base classes. See InputStream_t::Seek or OutputStream_t::Seek for documentation.
Implements InputStream_t.
Implemented in BufferedFile_t, File_t, and BufferIOStream_t.
Redefined as pure virtual in IOStream_t to resolve ambiguity as to which base class's version is to be called. In fact, a class derived from IOStream_t will need to implement a SeekRelative function which implements SeekRelative for both base classes. See InputStream_t::SeekRelative or OutputStream_t::SeekRelative for documentation.
Reimplemented from InputStream_t.
Reimplemented in BufferIOStream_t.
virtual Status_t IOStream_t::Close | ( | ) | [pure virtual] |
Redefined as pure virtual in IOStream_t to resolve ambiguity as to which base class's version is to be called. In fact, a class derived from IOStream_t will need to implement a Close function which implements Close for both base classes. See InputStream_t::Close or OutputStream_t::Close for documentation.
Implements InputStream_t.
Implemented in BufferedFile_t, File_t, and BufferIOStream_t.
static void IOStream_t::SetFileUnderTest | ( | IOStream_t * | file | ) | [static] |
Sets the file under test for which logging of all file operations and call sequences will be logged using rel_debug_printf. This function and the other LOG_FILE_OPS functions are only available if LOG_FILE_OPS was defined when the UT library was built. If LOG_FILE_OPS_CALLERS was defined instead, that is the same thing as LOG_FILE_OPS, but caller information will be logged as well if it is available. See CallLogger_t for more information. This function, and all LOG_FILE_OPS functions, are for generating a debug trace during development of new IOStream_t subclasses, and should not be included in normal builds. To that end, the debug_file_func_ macros should be used so that these debug logging calls will be omitted once debugging the new IOStream_t subclass is done, but can be reenabled should a bug arise in the subclass implementation at a later time.
virtual void IOStream_t::AppendStateInfo | ( | String_t * | state | ) | const [protected, virtual] |
Allows an IOStream_t subclass to output state information for file operation logging. This function and the other LOG_FILE_OPS functions are only available if LOG_FILE_OPS was defined when the UT library was built. This function will be called whenever FunctionReturn or FunctionReturnStatusCode is called, so that a state snapshot can be appended to the log of each function exit point.
Reimplemented in BufferedFile_t, File_t, and BufferIOStream_t.
static void IOStream_t::FunctionIn | ( | const IOStream_t * | file, | |
bool | from_thread, | |||
stringliteral * | function, | |||
stringliteral * | format, | |||
... | ||||
) | [static, protected] |
Logs entry into a function for an object which may be subject to file operation logging, but the debug_file_func_in() macro should be used instead of calling this directly. This function and the other LOG_FILE_OPS functions are only available if LOG_FILE_OPS was defined when the UT library was built.
static void IOStream_t::FunctionReturnStatusCode | ( | const IOStream_t * | file, | |
bool | from_thread, | |||
int | line, | |||
error_code_t | status | |||
) | [static, protected] |
Logs return from a function for an object which may be subject to file operation logging, but the debug_file_func_return_statuscode() macro should be used instead of calling this directly. This function and the other LOG_FILE_OPS functions are only available if LOG_FILE_OPS was defined when the UT library was built.
static void IOStream_t::FunctionReturn | ( | const IOStream_t * | file, | |
bool | from_thread, | |||
int | line | |||
) | [static, protected] |
Logs return from a function for an object which may be subject to file operation logging, but the debug_file_func_return() macro should be used instead of calling this directly. This function and the other LOG_FILE_OPS functions are only available if LOG_FILE_OPS was defined when the UT library was built.
static void IOStream_t::FunctionLogState | ( | const IOStream_t * | file, | |
bool | from_thread, | |||
int | line, | |||
stringliteral * | format, | |||
... | ||||
) | [static, protected] |
Logs state in a function for an object which may be subject to file operation logging, but the debug_file_func_state1() or debug_file_func_state2() macros should be used instead of calling this directly. This function and the other LOG_FILE_OPS functions are only available if LOG_FILE_OPS was defined when the UT library was built.
static void IOStream_t::FunctionReadStart | ( | const IOStream_t * | file, | |
bool | from_thread, | |||
int | line, | |||
fileoff_t | pos, | |||
int | bytes_to_read, | |||
bool | force_read_all | |||
) | [static, protected] |
Logs initiation of a read in a function for an object which may be subject to file operation logging, but the debug_file_func_read_start() macro should be used instead of calling this directly. This function and the other LOG_FILE_OPS functions are only available if LOG_FILE_OPS was defined when the UT library was built.
static void IOStream_t::FunctionReadData | ( | const IOStream_t * | file, | |
bool | from_thread, | |||
int | line, | |||
const byte * | buffer, | |||
fileoff_t | pos, | |||
int | bytes_read | |||
) | [static, protected] |
Logs completion of a partial or full read in a function for an object which may be subject to file operation logging, but the debug_file_func_read_data() macro should be used instead of calling this directly. This function and the other LOG_FILE_OPS functions are only available if LOG_FILE_OPS was defined when the UT library was built.
static void IOStream_t::FunctionWriteData | ( | const IOStream_t * | file, | |
bool | from_thread, | |||
int | line, | |||
stringliteral * | what, | |||
const byte * | buffer, | |||
fileoff_t | pos, | |||
int | bytes_to_write, | |||
bool | force_write_all | |||
) | [static, protected] |
Logs completion of a partial or full write in a function for an object which may be subject to file operation logging, but the debug_file_func_write_data() macro should be used instead of calling this directly. This function and the other LOG_FILE_OPS functions are only available if LOG_FILE_OPS was defined when the UT library was built.