#include <file.hpp>
Public Member Functions | |
file (session const &s, saga::url url, int mode=Read) | |
Creates the object. | |
file (saga::url url, int mode=Read) | |
Creates the object. | |
file (saga::object const &o) | |
Creates the object. | |
file (void) | |
Creates the object. | |
~file (void) | |
Destroys the object. | |
file & | operator= (saga::object const &o) |
Brief description starts here. | |
saga::off_t | get_size (void) |
Returns the number of bytes in the file. | |
saga::ssize_t | read (saga::mutable_buffer buffer, saga::ssize_t length=0) |
Reads up to length bytes from the file into the buffer. | |
saga::ssize_t | write (saga::const_buffer buffer, saga::ssize_t length=0) |
Writes up to length bytes from buffer into the file at the current file position. | |
saga::off_t | seek (saga::off_t offset, seek_mode mode) |
Reposition the file pointer. | |
void | read_v (std::vector< saga::filesystem::iovec > buffer_vec) |
Gather/scatter read. | |
void | write_v (std::vector< saga::filesystem::const_iovec > buffer_vec) |
Gather/scatter write. | |
saga::ssize_t | size_p (std::string pattern) |
Determine the storage size required for a pattern I/O operation. | |
saga::ssize_t | read_p (std::string pattern, saga::mutable_buffer buffer) |
Pattern-based read. | |
saga::ssize_t | write_p (std::string pattern, saga::const_buffer buffer) |
Pattern-based write. | |
std::vector< std::string > | modes_e () |
List the extended modes available in this implementation, and/or on server side. | |
saga::size_t | size_e (std::string ext_mode, std::string specification) |
determine the storage size required for an extended I/O operation | |
saga::ssize_t | read_e (std::string ext_mode, std::string specification, saga::mutable_buffer buffer) |
Extended read. | |
saga::ssize_t | write_e (std::string ext_mode, std::string specification, saga::const_buffer buffer) |
Extended write. | |
Static Public Member Functions | |
static file | create (session const &s, saga::url url, int mode=Read) |
Factory function resembling file(session, url, int) constructor. | |
static file | create (saga::url url, int mode=Read) |
Factory function resembling file(url, int) constructor. | |
template<typename Tag> | |
static saga::task | create (saga::url url, int mode=Read) |
Factory function resembling entry(url, int) constructor. |
This class represents an open file descriptor for read/write operations on a physical file. Its concept is similar to the file descriptor returned by the open (2) call in POSIX.
Example:
Creates the object.
saga::filesystem::file::file | ( | saga::object const & | o | ) | [explicit] |
Creates the object.
References saga::BadParameter, saga::object::File, and saga::object::get_type().
saga::filesystem::file::file | ( | void | ) |
Creates the object.
saga::filesystem::file::~file | ( | void | ) |
Destroys the object.
static file saga::filesystem::file::create | ( | session const & | s, | |
saga::url | url, | |||
int | mode = Read | |||
) | [inline, static] |
Factory function resembling file(session, url, int) constructor.
Reimplemented from saga::name_space::entry.
static saga::task saga::filesystem::file::create | ( | saga::url | url, | |
int | mode = Read | |||
) | [inline, static] |
Factory function resembling entry(url, int) constructor.
Reimplemented from saga::name_space::entry.
file & saga::filesystem::file::operator= | ( | saga::object const & | o | ) |
Brief description starts here.
Reimplemented from saga::name_space::entry.
References saga::name_space::entry::operator=().
saga::off_t saga::filesystem::file::get_size | ( | void | ) | [inline] |
Returns the number of bytes in the file.
saga::ssize_t saga::filesystem::file::read | ( | saga::mutable_buffer | buffer, | |
saga::ssize_t | length = 0 | |||
) | [inline] |
Reads up to length bytes from the file into the buffer.
length | Number of bytes to be read | |
buffer | Buffer to read into |
saga::ssize_t saga::filesystem::file::write | ( | saga::const_buffer | buffer, | |
saga::ssize_t | length = 0 | |||
) | [inline] |
saga::off_t saga::filesystem::file::seek | ( | saga::off_t | offset, | |
seek_mode | mode | |||
) | [inline] |
Reposition the file pointer.
offset | Offset in bytes to move pointer | |
mode | Offset is relative to mode |
void saga::filesystem::file::read_v | ( | std::vector< saga::filesystem::iovec > | buffer_vec | ) | [inline] |
Gather/scatter read.
buffer_vec | Array of buffer_vec structs defining start (offset) and length (length) of each individual read, buffer to read into, and integer to store result into. |
void saga::filesystem::file::write_v | ( | std::vector< saga::filesystem::const_iovec > | buffer_vec | ) | [inline] |
Gather/scatter write.
buffer_vec | Array of buffer_vec structs defining start (offset) and length (length) of each individual write, and buffers containing the data to write |
saga::ssize_t saga::filesystem::file::size_p | ( | std::string | pattern | ) | [inline] |
Determine the storage size required for a pattern I/O operation.
pattern | Pattern to determine size for |
saga::ssize_t saga::filesystem::file::read_p | ( | std::string | pattern, | |
saga::mutable_buffer | buffer | |||
) | [inline] |
Pattern-based read.
pattern | Pattern specification for read operation | |
buffer | Buffer to store read bytes into |
saga::ssize_t saga::filesystem::file::write_p | ( | std::string | pattern, | |
saga::const_buffer | buffer | |||
) | [inline] |
Pattern-based write.
pattern | Pattern specification for read operation | |
buffer | Buffer to store read bytes into |
std::vector<std::string> saga::filesystem::file::modes_e | ( | ) | [inline] |
List the extended modes available in this implementation, and/or on server side.
ret | Pattern to determine size for |
saga::size_t saga::filesystem::file::size_e | ( | std::string | ext_mode, | |
std::string | specification | |||
) | [inline] |
determine the storage size required for an extended I/O operation
saga::ssize_t saga::filesystem::file::read_e | ( | std::string | ext_mode, | |
std::string | specification, | |||
saga::mutable_buffer | buffer | |||
) | [inline] |
Extended read.
ext_mode | Extended mode to use | |
specification | Specification of read operation | |
buffer | Buffer to store read bytes into |
saga::ssize_t saga::filesystem::file::write_e | ( | std::string | ext_mode, | |
std::string | specification, | |||
saga::const_buffer | buffer | |||
) | [inline] |
Extended write.
ext_mode | Extended mode to use | |
specification | Specification of write operation | |
buffer | Buffer to store read bytes into |