1 #ifndef HUGE_FILE_CLASS
2 #define HUGE_FILE_CLASS
47 OKAY = basis::common::OKAY,
Provides a dynamically resizable ASCII character string.
A very common template for a dynamic array of bytes.
Outcomes describe the state of completion for an operation.
Provides file managment services using the standard I/O support.
@ FROM_CURRENT
offset is from current cursor position.
Provides operations commonly needed on file names.
Supports reading and writing to very large files, > 4 gigabytes.
double length()
expensive operation accesses the file to find length.
bool truncate()
truncates the file after the current position.
basis::outcome move_to(double absolute_posn)
simpler seek just goes from current location to "absolute_posn".
bool eof() const
reports when the file pointer has reached the end of the file.
huge_file(const basis::astring &filename, const basis::astring &permissions)
opens "filename" for access, where it presumably is a very large file.
basis::outcome seek(double new_position, byte_filer::origins origin=byte_filer::FROM_CURRENT)
move the file pointer to "new_position" if possible.
double file_pointer() const
returns where we currently are in the file.
const basis::astring & name() const
returns the name of the file this operates on.
basis::outcome write(const basis::byte_array &to_write, int &size_written)
stores the array "to_write" into the file.
bool good() const
reports if the file was opened successfully.
DEFINE_CLASS_NAME("huge_file")
void flush()
forces any pending writes to actually be saved to the file.
basis::outcome read(basis::byte_array &to_fill, int desired_size, int &size_read)
reads "desired_size" into "to_fill" if possible.
A platform independent way to obtain the timestamp of a file.