...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
The file type when rebound to the specified executor.
typedef basic_random_access_file< Executor1 > other;
Name |
Description |
---|---|
Rebinds the file type to another executor. |
|
The type of the executor associated with the object. |
|
A bitmask type (C++ Std [lib.bitmask.types]). |
|
The native representation of a file. |
|
Basis for seeking in a file. |
Name |
Description |
---|---|
Assign an existing native file to the file. |
|
Start an asynchronous read at the specified offset. |
|
Start an asynchronous write at the specified offset. |
|
basic_random_access_file [constructor] |
Construct a basic_random_access_file without opening it. |
Cancel all asynchronous operations associated with the file. |
|
Close the file. |
|
Get the executor associated with the object. |
|
Determine whether the file is open. |
|
Get the native file representation. |
|
Open the file using the specified path. |
|
Move-assign a basic_random_access_file from another. |
|
Read some data from the handle at the specified offset. |
|
Release ownership of the underlying native file. |
|
Alter the size of the file. |
|
Get the size of the file. |
|
Synchronise the file to disk. |
|
Synchronise the file data to disk. |
|
Write some data to the handle at the specified offset. |
|
~basic_random_access_file [destructor] |
Destroys the file. |
Name |
Description |
---|---|
append [static] |
Open the file in append mode. |
create [static] |
Create the file if it does not exist. |
exclusive [static] |
Ensure a new file is created. Must be combined with create. |
read_only [static] |
Open the file for reading. |
read_write [static] |
Open the file for reading and writing. |
sync_all_on_write [static] |
Open the file so that write operations automatically synchronise the file data and metadata to disk. |
truncate [static] |
Open the file with any existing contents truncated. |
write_only [static] |
Open the file for writing. |
The basic_random_access_file
class
template provides asynchronous and blocking random-access file functionality.
Distinct objects: Safe.
Shared objects: Unsafe.
Synchronous read_some_at
and write_some_at
operations
are thread safe with respect to each other, if the underlying operating
system calls are also thread safe. This means that it is permitted to perform
concurrent calls to these synchronous operations on a single file object.
Other synchronous operations, such as open
or close
, are not thread
safe.
Header: boost/asio/basic_random_access_file.hpp
Convenience header: boost/asio.hpp