### Compile Example with Installed Libraries Source: https://ned14.github.io/llfio/md__build.html Compile an example C++ file, linking against the installed llfio libraries. Ensure the include path matches your CMAKE_INSTALL_PREFIX. ```cpp cd example g++ -std=c++17 -o test map_file.cpp -I/Users/ned/testinstall/inst/include ``` -------------------------------- ### Install Dependencies and llfio Source: https://ned14.github.io/llfio/md__build.html Install quickcpplib, outcome, and llfio to a specified prefix. This involves cloning each repository, building, and then installing. ```bash git config --system core.longpaths true git clone --recursive https://github.com/ned14/quickcpplib.git cd quickcpplib mkdir build cd build cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local cmake --build . --parallel cmake --build . --target install cd ../.. git clone --recursive https://github.com/ned14/outcome.git cd outcome mkdir build cd build cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local cmake --build . --parallel cmake --build . --target install cd ../.. git clone --recursive https://github.com/ned14/llfio.git cd llfio mkdir build cd build cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local cmake --build . --parallel -- _dl _sl _hl cmake --build . --target install cd ../.. ``` -------------------------------- ### starting_working_directory() Source: https://ned14.github.io/llfio/namespacemembers_func.html Gets the starting working directory. ```APIDOC ## starting_working_directory() ### Description Gets the starting working directory. ### Signature `starting_working_directory() : llfio_v2_xxx::path_discovery` ``` -------------------------------- ### Get starting working directory handle Source: https://ned14.github.io/llfio/namespacellfio__v2__xxx_1_1path__discovery.html Returns a handle to the directory that was the working directory at static initialization time, before main() was called. If the directory was unreadable then, a default handle is returned. The result is undefined if the working directory was changed during static initialization. ```cpp const path_handle & llfio_v2_xxx::path_discovery::starting_working_directory ( ) ``` -------------------------------- ### begin() Source: https://ned14.github.io/llfio/classllfio__v2__xxx_1_1path__view.html Returns a const_iterator pointing to the first path component. This is the starting point for iterating over the components of a path. ```APIDOC ## begin() ### Description Returns an iterator to the first path component. ### Method `constexpr const_iterator begin() const noexcept` ### Returns A `const_iterator` to the beginning of the path components. ``` -------------------------------- ### starting_working_directory() Source: https://ned14.github.io/llfio/namespacemembers.html Determines the starting working directory. This is a path discovery utility within llfio_v2_xxx::path_discovery. ```APIDOC ## starting_working_directory() ### Description Determines the starting working directory. ### Signature `starting_working_directory() : llfio_v2_xxx::path_discovery` ``` -------------------------------- ### begin Source: https://ned14.github.io/llfio/classllfio__v2__xxx_1_1algorithm_1_1trivial__vector-members.html Returns an iterator to the beginning of the vector. This iterator can be used to traverse the elements from the start. ```APIDOC ## begin ### Description Returns an iterator pointing to the first element in the vector. ### Overloads - `begin() noexcept` - `begin() const noexcept` ``` -------------------------------- ### Get file extension with llfio_v2_xxx::path_view_component::extension Source: https://ned14.github.io/llfio/classllfio__v2__xxx_1_1path__view.html Returns a view of the file extension. It handles cases where there is no extension, or the extension starts with a dot. ```cpp constexpr path_view_component llfio_v2_xxx::path_view_component::extension() const noexcept inherited { auto self = _filename(); return self._invoke( [this](const auto &v) { auto dot_idx = v.rfind('.'); if(_npos == dot_idx || dot_idx == 0 || (dot_idx == 1 && v[dot_idx - 1] == '.')) { return path_view_component(); } return path_view_component(v.data() + dot_idx, v.size() - dot_idx, termination()); }); } ``` -------------------------------- ### begin() Source: https://ned14.github.io/llfio/classllfio__v2__xxx_1_1path__view__component_1_1rendered__path.html Returns an iterator to the beginning of the path. ```APIDOC ## begin() ### Description Begin iteration. ### Method `begin` ### Endpoint `llfio_v2_xxx::path_view_component::_rendered_path_base_::begin` ``` -------------------------------- ### Get mapped file starting offset Source: https://ned14.github.io/llfio/classllfio__v2__xxx_1_1mapped__file__handle.html Retrieves the offset into the backing file where this mapped file begins. This is useful for understanding the segment of the file being accessed. ```cpp 551{ return _offset; } ``` -------------------------------- ### create Source: https://ned14.github.io/llfio/structkvstore__v1__xxx_1_1basic__key__value__store__info.html Constructs a store implementation based on the provided URI and configuration options. ```APIDOC ## Function: create ### Description Construct a store implementation. ### Signature `result< basic_key_value_store >(* kvstore_v1_xxx::basic_key_value_store_info::create)(const basic_key_value_store::uri_type &uri, size_type key_size, features _features, mode _mode, creation _creation, caching _caching)` ``` -------------------------------- ### KVSTORE_V1_NAMESPACE_BEGIN Source: https://ned14.github.io/llfio/kvstore_8hpp.html Macro to enter the kv store v1 namespace. ```APIDOC #define KVSTORE_V1_NAMESPACE_BEGIN ### Description Expands into the appropriate namespace markup to enter the kv store v1 namespace. ``` -------------------------------- ### begin() Source: https://ned14.github.io/llfio/classllfio__v2__xxx_1_1path__view.html Returns an iterator to the first path component. This is a non-const member function. ```APIDOC ## begin() [2/2] | constexpr path_view::iterator llfio_v2_xxx::path_view::begin | ( | | ) | ---|---|---|---|--- inlineconstexprnoexcept Returns an iterator to the first path component. 2998{ 2999 return cbegin(); 3000} ``` -------------------------------- ### Functions starting with 'v' Source: https://ned14.github.io/llfio/functions_func_v.html Lists functions that start with the letter 'v'. ```APIDOC ## v ### Description Functions starting with the letter 'v'. ### Functions - **value()** : `llfio_v2_xxx::error_info` - **value_size()** : `kvstore_v1_xxx::basic_key_value_store` ``` -------------------------------- ### Functions starting with 'd' Source: https://ned14.github.io/llfio/functions_func_d.html This section details functions in LLFIO v2.00 that start with the letter 'd'. Each function includes its signature and the classes it belongs to. ```APIDOC ## d ### data() **Description**: Retrieves data. **Signature**: `data() : llfio_v2_xxx::algorithm::impl::trivial_vector_impl< has_default_construction, T >, llfio_v2_xxx::byte_io_handle::buffer_type, llfio_v2_xxx::byte_io_handle::const_buffer_type` ### decommit() **Description**: Decommits memory or resources. **Signature**: `decommit() : llfio_v2_xxx::map_handle` ### default_metadata() **Description**: Returns the default metadata. **Signature**: `default_metadata() : llfio_v2_xxx::algorithm::traversal_summary` ### deleter() **Description**: Provides a deleter for resource management. **Signature**: `deleter() : llfio_v2_xxx::path_view_component::rendered_path< ZeroTermination, T, AllocatorOrDeleter, _internal_buffer_size, type >` ### dependencies() **Description**: Lists dependencies. **Signature**: `dependencies() : kvstore_v1_xxx::basic_key_value_store::transaction` ### directory() **Description**: Accesses the directory handle. **Signature**: `directory() : llfio_v2_xxx::directory_handle` ### directory_handle() **Description**: Constructs a directory handle. **Signature**: `directory_handle() : llfio_v2_xxx::directory_handle` ### directory_open_failed() **Description**: Handles directory open failures. **Signature**: `directory_open_failed() : llfio_v2_xxx::algorithm::reduce_visitor, llfio_v2_xxx::algorithm::summarize_visitor, llfio_v2_xxx::algorithm::traverse_visitor` ### do_not_store() **Description**: Indicates that data should not be stored. **Signature**: `do_not_store() : llfio_v2_xxx::map_handle` ### done() **Description**: Signals completion. **Signature**: `done() : llfio_v2_xxx::directory_handle::buffers_type` ``` -------------------------------- ### launch_process Source: https://ned14.github.io/llfio/functions_func_l.html Launches a new process and returns a handle to it. ```APIDOC ## launch_process() ### Description Launches a new process. ### Signature `llfio_v2_xxx::process_handle launch_process()` ``` -------------------------------- ### Launch process with default environment Source: https://ned14.github.io/llfio/classllfio__v2__xxx_1_1process__handle.html Launches a new process using the provided path, arguments, and flags. It defaults to using the current process's environment. This is a convenience overload. ```cpp 232{ return launch_process(path, args, *current().environment(), flags); } ``` -------------------------------- ### Get reverse_iterator to before the first element Source: https://ned14.github.io/llfio/classllfio__v2__xxx_1_1algorithm_1_1trivial__vector.html Use `rend()` to get a `reverse_iterator` pointing to the element before the first element of the vector. This is typically used in reverse iteration loops. ```cpp reverse_iterator rend() noexcept { return reverse_iterator(begin()); } ``` -------------------------------- ### launch_process Source: https://ned14.github.io/llfio/classllfio__v2__xxx_1_1process__handle-members.html Launches a new process with the specified path, arguments, and environment. Optionally waits for the process to close. ```APIDOC ## launch_process ### Description Launches a new process with the specified path, arguments, and environment. Optionally waits for the process to close. ### Method static ### Parameters #### Path Parameters - **path** (path_view) - Required - The path to the executable. - **args** (span< path_view_component >) - Required - The arguments for the process. - **env** (span< path_view_component >) - Optional - The environment variables for the process. Defaults to the current environment. - **flags** (flag) - Optional - Flags to control process behavior. Defaults to `flag::wait_on_close`. ### Request Example ```cpp llfio_v2_xxx::process_handle::launch_process( "/path/to/executable", {"arg1", "arg2"}, *llfio_v2_xxx::process_handle::current().environment(), llfio_v2_xxx::flag::none ); ``` ### Response #### Success Response (process_handle) Returns a `process_handle` object representing the launched process. ``` ```APIDOC ## launch_process ### Description Launches a new process with the specified path and arguments. Optionally waits for the process to close. ### Method static inline ### Parameters #### Path Parameters - **path** (path_view) - Required - The path to the executable. - **args** (span< path_view_component >) - Required - The arguments for the process. - **flags** (flag) - Optional - Flags to control process behavior. Defaults to `flag::wait_on_close`. ### Request Example ```cpp llfio_v2_xxx::process_handle::launch_process( "/path/to/executable", {"arg1", "arg2"}, llfio_v2_xxx::flag::none ); ``` ### Response #### Success Response (process_handle) Returns a `process_handle` object representing the launched process. ``` -------------------------------- ### Get const_reverse_iterator to before the first element Source: https://ned14.github.io/llfio/classllfio__v2__xxx_1_1algorithm_1_1trivial__vector.html Use `rend()` to get a `const_reverse_iterator` pointing to the element before the first element of the vector. This is typically used in reverse iteration loops. ```cpp const_reverse_iterator rend() const noexcept { return const_reverse_iterator(begin()); } ``` -------------------------------- ### LLFIO Functions Starting with 'e' Source: https://ned14.github.io/llfio/functions_func_e.html This section details functions within the LLFIO library that start with the letter 'e'. Each entry includes the function name and the class it belongs to. ```APIDOC ## Functions starting with 'e' ### emplace() * **Description**: Inserts an element into the vector. * **Class**: `llfio_v2_xxx::algorithm::impl::trivial_vector_impl< has_default_construction, T >` ### emplace_back() * **Description**: Inserts an element at the end of the vector. * **Class**: `llfio_v2_xxx::algorithm::impl::trivial_vector_impl< has_default_construction, T >` ### empty() * **Description**: Checks if the container is empty. * **Classes**: `kvstore_v1_xxx::basic_key_value_store`, `llfio_v2_xxx::algorithm::impl::trivial_vector_impl< has_default_construction, T >`, `llfio_v2_xxx::byte_io_handle::buffer_type`, `llfio_v2_xxx::byte_io_handle::const_buffer_type`, `llfio_v2_xxx::path_view_component`, `llfio_v2_xxx::storage_profile::storage_profile` ### end() * **Description**: Returns an iterator to the end of the container. * **Classes**: `llfio_v2_xxx::algorithm::impl::trivial_vector_impl< has_default_construction, T >`, `llfio_v2_xxx::byte_io_handle::buffer_type`, `llfio_v2_xxx::byte_io_handle::const_buffer_type`, `llfio_v2_xxx::path_view`, `llfio_v2_xxx::storage_profile::storage_profile`, `llfio_v2_xxx::symlink_handle::buffers_type`, `llfio_v2_xxx::symlink_handle::const_buffers_type` ### entity_from_buffer() * **Description**: Creates an entity from a buffer. * **Class**: `llfio_v2_xxx::algorithm::shared_fs_mutex::shared_fs_mutex` ### entity_from_string() * **Description**: Creates an entity from a string. * **Class**: `llfio_v2_xxx::algorithm::shared_fs_mutex::shared_fs_mutex` ### entity_type() * **Description**: Gets the type of the entity. * **Class**: `llfio_v2_xxx::algorithm::shared_fs_mutex::shared_fs_mutex::entity_type` ### environment() * **Description**: Retrieves the environment variables. * **Class**: `llfio_v2_xxx::process_handle` ### erase() * **Description**: Removes elements from the vector. * **Class**: `llfio_v2_xxx::algorithm::impl::trivial_vector_impl< has_default_construction, T >` ### error() * **Description**: Returns the error code. * **Class**: `llfio_v2_xxx::error` ### error_info() * **Description**: Retrieves detailed error information. * **Class**: `llfio_v2_xxx::error_info` ### error_pipe() * **Description**: Gets the error pipe for the process. * **Class**: `llfio_v2_xxx::process_handle` ### exists() * **Description**: Checks if a path exists. * **Class**: `llfio_v2_xxx::path_handle` ### extension() * **Description**: Gets the file extension. * **Class**: `llfio_v2_xxx::path_view_component` ### extent() * **Description**: Returns the extent of the lock. * **Class**: `llfio_v2_xxx::lockable_byte_io_handle::extent_guard` ### extent_guard() * **Description**: Constructs an extent guard. * **Class**: `llfio_v2_xxx::lockable_byte_io_handle::extent_guard` ### extents() * **Description**: Returns the extents of the file. * **Classes**: `llfio_v2_xxx::fast_random_file_handle`, `llfio_v2_xxx::file_handle` ``` -------------------------------- ### Launch a new process Source: https://ned14.github.io/llfio/classllfio__v2__xxx_1_1process__handle.html Creates and launches a new process. Requires an absolute path to the binary. Note that process launching is inherently racy with respect to filesystem modifications. ```cpp static result< process_handle > launch_process(path_view path, span< path_view_component > args, span< path_view_component > env= *current().environment(), flag flags=flag::wait_on_close) noexcept; ``` -------------------------------- ### Functions starting with 'h' Source: https://ned14.github.io/llfio/functions_func_h.html This section lists all documented functions in LLFIO v2.00 whose names start with the letter 'h'. It also indicates the classes where these functions are defined or used. ```APIDOC ## Functions starting with 'h' ### Description This section lists all documented functions in LLFIO v2.00 whose names start with the letter 'h'. It also indicates the classes where these functions are defined or used. ### Functions - **handle()** : llfio_v2_xxx::algorithm::shared_fs_mutex::atomic_append, llfio_v2_xxx::algorithm::shared_fs_mutex::byte_ranges, llfio_v2_xxx::algorithm::shared_fs_mutex::memory_map< Hasher, HashIndexSize, SpinlockType >, llfio_v2_xxx::handle, llfio_v2_xxx::lockable_byte_io_handle::extent_guard - **has_extension()** : llfio_v2_xxx::path_view_component - **has_filename()** : llfio_v2_xxx::path_view - **has_null_termination()** : llfio_v2_xxx::path_view_component - **has_parent_path()** : llfio_v2_xxx::path_view - **has_relative_path()** : llfio_v2_xxx::path_view - **has_root_directory()** : llfio_v2_xxx::path_view - **has_root_name()** : llfio_v2_xxx::path_view - **has_root_path()** : llfio_v2_xxx::path_view - **has_stem()** : llfio_v2_xxx::path_view_component ``` -------------------------------- ### open_kvstore Source: https://ned14.github.io/llfio/namespacekvstore__v1__xxx.html Opens an existing key-value store. This is a convenience overload for create_kvstore(). ```APIDOC ## open_kvstore ### Description Open an existing key value store. A convenience overload for `create_kvstore()`. ### Method result< basic_key_value_store > ### Parameters - **uri** (const basic_key_value_store::uri_type &) - Required - The URI of the key-value store to open. - **_mode** (basic_key_value_store::mode) - Optional - The mode to open the store in (defaults to write). - **_caching** (basic_key_value_store::caching) - Optional - The caching mode (defaults to all). ### Response #### Success Response - **basic_key_value_store** - A handle to the opened key-value store. ``` -------------------------------- ### temp_directory() Source: https://ned14.github.io/llfio/namespacemembers_func.html Gets a temporary directory. ```APIDOC ## temp_directory() ### Description Gets a temporary directory. ### Signature `temp_directory() : llfio_v2_xxx` ``` -------------------------------- ### kvstore_v1_xxx::open_kvstore Source: https://ned14.github.io/llfio/kvstore_8hpp.html Opens an existing key-value store. This is a convenience overload for `create_kvstore()`. ```APIDOC ## open_kvstore ### Description Open an existing key value store. A convenience overload for `create_kvstore()`. ### Signature ```cpp result< basic_key_value_store > kvstore_v1_xxx::open_kvstore ( const basic_key_value_store::uri_type &uri, basic_key_value_store::mode _mode = basic_key_value_store::mode::write, basic_key_value_store::caching _caching = basic_key_value_store::caching::all ) ``` ### Parameters * **uri** (const basic_key_value_store::uri_type &) - The URI of the key-value store to open. * **_mode** (basic_key_value_store::mode) - The mode to open the store in (default: write). * **_caching** (basic_key_value_store::caching) - The caching mode (default: all). ``` -------------------------------- ### length Source: https://ned14.github.io/llfio/namespacemembers_func.html Gets the length of a file. ```APIDOC ## length() ### Description Gets the length of a file. ### Namespace llfio_v2_xxx ``` -------------------------------- ### length Source: https://ned14.github.io/llfio/namespacemembers.html Gets the length of a resource. ```APIDOC ## length() ### Description Gets the length of a resource. ### Namespace llfio_v2_xxx ``` -------------------------------- ### begin() Source: https://ned14.github.io/llfio/structllfio__v2__xxx_1_1algorithm_1_1impl_1_1trivial__vector__impl.html Returns an iterator to the first element of the container. Overloaded for const and non-const access. ```APIDOC ## begin() [1/2] ### Description Iterator to the first item. ### Method `const_iterator begin() const noexcept` ### Return Value `const_iterator` pointing to the first element. ``` ```APIDOC ## begin() [2/2] ### Description Iterator to the first item. ### Method `iterator begin() noexcept` ### Return Value `iterator` pointing to the first element. ``` -------------------------------- ### create_kvstore Source: https://ned14.github.io/llfio/namespacekvstore__v1__xxx.html Creates a new key-value store, or opens or truncates an existing one, using the provided URI. ```APIDOC ## create_kvstore ### Description Create a new key value store, or open or truncate an existing key value store, using the given URI. ### Method result< basic_key_value_store > ### Parameters - **uri** (const basic_key_value_store::uri_type &) - Required - The URI for the key-value store. - **key_size** (basic_key_value_store::size_type) - Required - The size of the keys. - **_features** (basic_key_value_store::features) - Required - The features to enable. - **_mode** (basic_key_value_store::mode) - Optional - The mode to open the store in (defaults to write). - **_creation** (basic_key_value_store::creation) - Optional - The creation mode (defaults to if_needed). - **_caching** (basic_key_value_store::caching) - Optional - The caching mode (defaults to all). ### Response #### Success Response - **basic_key_value_store** - A handle to the created or opened key-value store. ``` -------------------------------- ### section() Source: https://ned14.github.io/llfio/namespacemembers_func.html Gets a section of a file or data. ```APIDOC ## section() ### Description Gets a section of a file or data. ### Signature `section() : llfio_v2_xxx` ``` -------------------------------- ### starting_working_directory Source: https://ned14.github.io/llfio/path__discovery_8hpp.html Returns a reference to an open handle of the verified directory that was the working directory during the process's static data initialization, before main() was invoked. ```APIDOC ## starting_working_directory ### Description Returns a reference to an open handle to a verified directory which was the working directory during static data init of the process before `main()` was invoked. ### Signature const path_handle & starting_working_directory () noexcept ### Returns - **const path_handle &** - A reference to an open handle to the starting working directory. ``` -------------------------------- ### page_size Source: https://ned14.github.io/llfio/namespacemembers_func.html Gets the page size of a file. ```APIDOC ## page_size() ### Description Gets the page size of a file. ### Namespace llfio_v2_xxx::utils ``` -------------------------------- ### QUICKCPPLIB_BITFIELD_BEGIN_T for llfio_v2_xxx::handle::mapped_file_handle Source: https://ned14.github.io/llfio/classllfio__v2__xxx_1_1mapped__file__handle.html Defines the beginning of a bitfield for flags. The 'none' flag indicates no flags are set. ```cpp none = uint16_t(0), //!< No flags ``` -------------------------------- ### maximum_extent Source: https://ned14.github.io/llfio/namespacemembers.html Gets the maximum extent of a resource. ```APIDOC ## maximum_extent() ### Description Gets the maximum extent of a resource. ### Namespace llfio_v2_xxx ``` -------------------------------- ### begin() [2/2] Source: https://ned14.github.io/llfio/structllfio__v2__xxx_1_1algorithm_1_1impl_1_1trivial__vector__impl_3_01true_00_01_t_01_4.html Returns an iterator to the first element. ```APIDOC ## begin() [2/2] | iterator llfio_v2_xxx::algorithm::impl::trivial_vector_impl< has_default_construction, T >::begin | ( | | ) | |---|---|---|---| inlinenoexceptinherited | Iterator to first item. 282{ return iterator(_begin); } ``` -------------------------------- ### size() Source: https://ned14.github.io/llfio/classllfio__v2__xxx_1_1path__view__component_1_1rendered__path.html Get the size of the rendered path. ```APIDOC ## size() ### Description Size. ### Method `constexpr size_type size() const` ### Return Value The size of the rendered path. ``` -------------------------------- ### z - Functions Source: https://ned14.github.io/llfio/functions_func_z.html Functions starting with the letter 'z'. ```APIDOC ## z - Functions ### Description Functions starting with the letter 'z'. ### Functions - **zero()** : llfio_v2_xxx::fast_random_file_handle, llfio_v2_xxx::file_handle, llfio_v2_xxx::mapped_file_handle * Description: Returns a file handle representing a zero-filled region. - **zero_memory()** : llfio_v2_xxx::map_handle * Description: Returns a map handle representing a zero-filled memory region. ``` -------------------------------- ### llfio_v2_xxx::construct< file_handle > Source: https://ned14.github.io/llfio/file__handle_8hpp.html Constructor for file_handle. ```APIDOC ## struct llfio_v2_xxx::construct< file_handle > ### Description Constructor for `file_handle`. ``` -------------------------------- ### starting_offset() Source: https://ned14.github.io/llfio/classllfio__v2__xxx_1_1mapped__file__handle.html Retrieves the offset into the backing file from which this mapped file begins. ```APIDOC ## starting_offset() ### Description The offset into the backing file from which this mapped file begins. ### Method const ### Endpoint llfio_v2_xxx::mapped_file_handle::starting_offset() ``` -------------------------------- ### starting_offset Source: https://ned14.github.io/llfio/classllfio__v2__xxx_1_1mapped__file__handle-members.html Returns the starting offset of the mapped file. ```APIDOC ## starting_offset() const noexcept ### Description Returns the starting offset of the mapped file. ### Method `const noexcept` ``` -------------------------------- ### create_kvstore Source: https://ned14.github.io/llfio/namespacemembers_func.html Creates a new key-value store. ```APIDOC ## create_kvstore() ### Description Creates a new key-value store. ### Namespace kvstore_v1_xxx ``` -------------------------------- ### temporary_named_pipes_directory() Source: https://ned14.github.io/llfio/namespacemembers_func.html Gets the directory for temporary named pipes. ```APIDOC ## temporary_named_pipes_directory() ### Description Gets the directory for temporary named pipes. ### Signature `temporary_named_pipes_directory() : llfio_v2_xxx::path_discovery` ``` -------------------------------- ### storage_backed_temporary_files_directory() Source: https://ned14.github.io/llfio/namespacemembers_func.html Gets the directory for storage-backed temporary files. ```APIDOC ## storage_backed_temporary_files_directory() ### Description Gets the directory for storage-backed temporary files. ### Signature `storage_backed_temporary_files_directory() : llfio_v2_xxx::path_discovery` ``` -------------------------------- ### KVSTORE V1 Namespace Entry Example Source: https://ned14.github.io/llfio/group__config.html Expands into the appropriate namespace markup to enter the kv store v1 namespace. This is typically used at the beginning of a scope that requires access to kv store v1. ```c #define KVSTORE_V1_NAMESPACE_BEGIN namespace kvstore_v1_xxx \ { ``` -------------------------------- ### page_sizes Source: https://ned14.github.io/llfio/namespacemembers_func.html Gets the available page sizes for a file. ```APIDOC ## page_sizes() ### Description Gets the available page sizes for a file. ### Namespace llfio_v2_xxx::utils ``` -------------------------------- ### KVSTORE_V1_NAMESPACE_EXPORT_BEGIN Source: https://ned14.github.io/llfio/kvstore_8hpp.html Macro to enter the exported kv store v1 namespace. ```APIDOC #define KVSTORE_V1_NAMESPACE_EXPORT_BEGIN ### Description Expands into the appropriate namespace markup to enter the C++ module exported kv store v1 namespace. ``` -------------------------------- ### file_buffer_default_size Source: https://ned14.github.io/llfio/namespacemembers_func.html Gets the default buffer size for files. ```APIDOC ## file_buffer_default_size() ### Description Gets the default buffer size for files. ### Namespace llfio_v2_xxx::utils ``` -------------------------------- ### Opening and Creating Files Source: https://ned14.github.io/llfio/classllfio__v2__xxx_1_1file__handle.html These static methods allow users to open existing files or create new ones with specified modes, creation options, caching, and flags. ```APIDOC ## Static Public Member Functions --- static result< file_handle > | file (const path_handle &base, path_view_type path, mode _mode=mode::read, creation _creation=creation::open_existing, caching _caching=caching::all, flag flags=flag::none) noexcept --- static result< file_handle > | uniquely_named_file (const path_handle &dirpath, mode _mode=mode::write, caching _caching=caching::temporary, flag flags=flag::none) noexcept --- static result< file_handle > | temp_file (path_view_type name=path_view_type(), mode _mode=mode::write, creation _creation=creation::if_needed, caching _caching=caching::temporary, flag flags=flag::unlink_on_first_close) noexcept --- static result< file_handle > | temp_inode (const path_handle &dirh=path_discovery::storage_backed_temporary_files_directory(), mode _mode=mode::write, caching _caching=caching::temporary, flag flags=flag::none) noexcept ``` -------------------------------- ### current_process_memory_usage Source: https://ned14.github.io/llfio/namespacemembers_func.html Gets the current memory usage of the process. ```APIDOC ## current_process_memory_usage() ### Description Gets the current memory usage of the process. ### Namespace llfio_v2_xxx::utils ``` -------------------------------- ### begin() [1/2] Source: https://ned14.github.io/llfio/structllfio__v2__xxx_1_1algorithm_1_1impl_1_1trivial__vector__impl_3_01true_00_01_t_01_4.html Returns a const iterator to the first element. ```APIDOC ## begin() [1/2] | const_iterator llfio_v2_xxx::algorithm::impl::trivial_vector_impl< has_default_construction, T >::begin | ( | | ) | const |---|---|---|---|---| inlinenoexceptinherited | Iterator to first item. 284{ return const_iterator(_begin); } ``` -------------------------------- ### current_process_cpu_usage Source: https://ned14.github.io/llfio/namespacemembers_func.html Gets the current CPU usage of the process. ```APIDOC ## current_process_cpu_usage() ### Description Gets the current CPU usage of the process. ### Namespace llfio_v2_xxx::utils ``` -------------------------------- ### Create Directory Source: https://ned14.github.io/llfio/directory__handle_8hpp.html Creates or opens a directory with specified parameters. ```APIDOC ## directory ### Description Creates or opens a directory with specified parameters. ### Signature result< directory_handle > directory(const path_handle &base, directory_handle::path_view_type path, directory_handle::mode _mode=directory_handle::mode::read, directory_handle::creation _creation=directory_handle::creation::open_existing, directory_handle::caching _caching=directory_handle::caching::all, directory_handle::flag flags=directory_handle::flag::none) noexcept ``` -------------------------------- ### termination() Source: https://ned14.github.io/llfio/classllfio__v2__xxx_1_1path__view__component_1_1rendered__path.html Get the zero termination of this rendered path. ```APIDOC ## termination() ### Description The zero termination of this rendered path. ### Method `static constexpr enum termination termination()` ### Return Value The enum value representing the termination type. ``` -------------------------------- ### native_size() Source: https://ned14.github.io/llfio/classllfio__v2__xxx_1_1path__view__component.html Gets the size of the path view in characters. ```APIDOC ## native_size() ### Description Returns the size of the path view in characters. ### Signature `constexpr size_t llfio_v2_xxx::path_view_component::native_size() const noexcept` ### Return Value The number of characters in the path view. ``` -------------------------------- ### kvstore_v1_xxx::create_kvstore Source: https://ned14.github.io/llfio/kvstore_8hpp.html Creates a new key-value store or opens/truncates an existing one using the provided URI and configuration. ```APIDOC ## create_kvstore ### Description Create a new key value store, or open or truncate an existing key value store, using the given URI. ### Signature ```cpp template result< basic_key_value_store > kvstore_v1_xxx::create_kvstore ( const basic_key_value_store::uri_type &uri, basic_key_value_store::size_type key_size, basic_key_value_store::features _features, basic_key_value_store::mode _mode = basic_key_value_store::mode::write, basic_key_value_store::creation _creation = basic_key_value_store::creation::if_needed, basic_key_value_store::caching _caching = basic_key_value_store::caching::all ) ``` ### Parameters * **uri** (const basic_key_value_store::uri_type &) - The URI for the key-value store. * **key_size** (basic_key_value_store::size_type) - The size of the keys. * **_features** (basic_key_value_store::features) - The features to enable for the store. * **_mode** (basic_key_value_store::mode) - The mode to open the store in (default: write). * **_creation** (basic_key_value_store::creation) - The creation mode (default: if_needed). * **_caching** (basic_key_value_store::caching) - The caching mode (default: all). ``` -------------------------------- ### maximum_extent Source: https://ned14.github.io/llfio/namespacellfio__v2__xxx.html Gets the maximum extent (size) of a file handle. ```APIDOC ## maximum_extent ### Description Gets the maximum extent of a file handle. ### Signature result< file_handle::extent_type > | maximum_extent (const file_handle &self) noexcept ``` -------------------------------- ### Construct process_handle using operator() Source: https://ned14.github.io/llfio/structllfio__v2__xxx_1_1construct_3_01process__handle_01_4.html This snippet shows the implementation of the operator() for construct< process_handle >, which delegates to launch_process to start a new process. It requires the path, arguments, environment, and flags for the process. ```cpp { return process_handle::launch_process(_path, _args, _env, _flags); } ``` -------------------------------- ### Get Handle Flags Source: https://ned14.github.io/llfio/classllfio__v2__xxx_1_1pipe__handle.html Retrieves the flags with which the handle was opened. ```APIDOC ## flags ### Description The flags this handle was opened with. ### Method flag flags () const noexcept ``` -------------------------------- ### Process Handle Launching Source: https://ned14.github.io/llfio/classllfio__v2__xxx_1_1process__handle.html Functions for launching new processes. ```APIDOC ## ◆ launch_process() [1/2] ### Description This is an overloaded member function, provided for convenience. It differs from the other `launch_process` function only in what argument(s) it accepts. ### Method `static result< process_handle > llfio_v2_xxx::process_handle::launch_process(path_view path, span< path_view_component > args, flag flags = flag::wait_on_close) noexcept` ``` ```APIDOC ## ◆ launch_process() [2/2] ### Description Creates a new process launching the binary at the specified `path`. This is the only handle creation function in LLFIO which requires an absolute path due to platform limitations in non-intrusively emulating race-free process launch. ### Method `static result< process_handle > llfio_v2_xxx::process_handle::launch_process(path_view path, span< path_view_component > args, span< path_view_component > env = *current().environment(), flag flags = flag::wait_on_close) noexcept` ### Parameters #### Path Parameter - **path** (path_view) - The absolute path to the binary to launch. #### Arguments - **args** (span< path_view_component >) - An array of arguments to pass to the process. - **env** (span< path_view_component >) - An array of environment variables to set for the process, defaults to the current process' environment. - **flags** (flag) - Any additional custom behaviors, defaults to `flag::wait_on_close`. ### Errors Returns any of the values POSIX `posix_spawn()` or `CreateProcess()` can return. ``` -------------------------------- ### open Source: https://ned14.github.io/llfio/classkvstore__v1__xxx_1_1basic__key__value__store-members.html Opens a key-value store entry. Supports read mode by default. ```APIDOC ## open ### Description Opens a key-value store entry. ### Method virtual int open(key_type key, mode _mode = mode::read) noexcept = 0 ### Parameters #### Path Parameters - **key** (key_type) - Description of the key to open. - **_mode** (mode) - Optional. The mode to open the store in, defaults to mode::read. ### Response #### Success Response (0) Indicates successful opening of the store entry. #### Error Response Non-zero value indicates an error. ``` -------------------------------- ### parent_path_handle Source: https://ned14.github.io/llfio/functions_func_p.html Gets the file system handle for the parent path. ```APIDOC ## parent_path_handle() ### Description Returns a file system handle to the parent directory. ### Method N/A (Function Signature) ### Endpoint N/A ### Parameters None ### Request Example None ### Response #### Success Response - **return value** (llfio_v2_xxx::fs_handle) - An fs_handle to the parent path. ``` -------------------------------- ### Directory Creation and Access Source: https://ned14.github.io/llfio/classllfio__v2__xxx_1_1directory__handle.html Static methods for creating and accessing directories. ```APIDOC ## Static Public Member Functions ### `directory(const path_handle &base, path_view_type path, mode _mode=mode::read, creation _creation=creation::open_existing, caching _caching=caching::all, flag flags=flag::none) noexcept` Creates or opens a directory handle. ### `uniquely_named_directory(const path_handle &dirpath, mode _mode=mode::write, caching _caching=caching::temporary, flag flags=flag::none) noexcept` Creates a uniquely named directory. ### `temp_directory(path_view_type name=path_view_type(), mode _mode=mode::write, creation _creation=creation::if_needed, caching _caching=caching::all, flag flags=flag::none) noexcept` Creates a temporary directory. ### `exists(const path_handle &base, path_view_type path) noexcept` Checks if a path exists. ### `path(const path_handle &base, path_view_type path) noexcept` Gets the path handle for a given path. ### `path(path_view_type _path) noexcept` Gets the path handle for a given path view. ``` -------------------------------- ### llfio_v2_xxx::maximum_extent Source: https://ned14.github.io/llfio/file__handle_8hpp.html Gets the maximum extent (size) of a file. ```APIDOC ## llfio_v2_xxx::maximum_extent ### Description Gets the maximum extent (size) of a file. ### Signature `result maximum_extent(const file_handle &self) noexcept` ``` -------------------------------- ### try_parent_path_handle Source: https://ned14.github.io/llfio/classllfio__v2__xxx_1_1fast__random__file__handle-members.html Attempts to non-blockingly get a handle to the parent directory. ```APIDOC ## try_parent_path_handle ### Description Attempts to non-blockingly get a handle to the parent directory of the current file handle. This operation is part of the `fs_handle` interface. ### Method `try_parent_path_handle` ### Parameters This method accepts a variable number of arguments (`Args &&... args`). ### Returns Returns a `llfio_v2_xxx::fs_handle` representing the parent directory if successful. ``` -------------------------------- ### enumerate_kvstores Source: https://ned14.github.io/llfio/namespacekvstore__v1__xxx.html Fills an array with information about all available key-value stores for the current process. ```APIDOC ## enumerate_kvstores ### Description Fill an array with information about all the key value stores available to this process. ### Method result< span< basic_key_value_store_info > > ### Parameters - **lst** (span< basic_key_value_store_info >) - Required - The span to fill with store information. ### Response #### Success Response - **span< basic_key_value_store_info >** - The span filled with information about available key-value stores. ``` -------------------------------- ### path_view::begin() Source: https://ned14.github.io/llfio/classllfio__v2__xxx_1_1path__view-members.html Returns an iterator to the beginning of the path view. ```APIDOC ## begin() ### Description Returns an iterator to the beginning of the path view. ### Method inline ### Endpoint N/A (Method) ``` -------------------------------- ### deallocate Source: https://ned14.github.io/llfio/classllfio__v2__xxx_1_1utils_1_1page__allocator-members.html Deallocates storage for n elements starting at pointer p. ```APIDOC ## deallocate(pointer p, size_type n) ### Description Deallocates storage for n elements starting at pointer p. ### Method inline ### Parameters - **p** (pointer) - Pointer to the memory to deallocate. - **n** (size_type) - The number of elements to deallocate. ``` -------------------------------- ### QUICKCPPLIB_BITFIELD_BEGIN_T() Source: https://ned14.github.io/llfio/functions_func_q.html This macro is used for defining bitfields. It is associated with directory_handle, handle, and native_handle_type. ```APIDOC ## QUICKCPPLIB_BITFIELD_BEGIN_T() ### Description Defines the beginning of a bitfield. This macro is used in conjunction with other bitfield macros to define bitfields within classes. ### Associated Types - llfio_v2_xxx::directory_handle - llfio_v2_xxx::handle - llfio_v2_xxx::native_handle_type ``` -------------------------------- ### Get Native Handle Source: https://ned14.github.io/llfio/classllfio__v2__xxx_1_1pipe__handle.html Retrieves the native handle used by this handle. ```APIDOC ## native_handle ### Description The native handle used by this handle. ### Method native_handle_type native_handle () const noexcept ``` -------------------------------- ### page_size() Source: https://ned14.github.io/llfio/classllfio__v2__xxx_1_1map__handle.html Gets the page size of the map in bytes. This is a const method. ```APIDOC ## page_size() ### Description Returns the page size used by the map, in bytes. ### Method const ### Returns size_type: The page size in bytes. ``` -------------------------------- ### Create Directory Handle (llfio_v2_xxx::directory) Source: https://ned14.github.io/llfio/namespacellfio__v2__xxx.html Creates a handle for accessing a directory at the specified path. Supports various options for mode, creation, caching, and flags. Errors are returnable from POSIX open() or CreateFile(). ```cpp return directory_handle::directory(std::forward(base), std::forward(path), std::forward(_mode), std::forward(_creation), std::forward(_caching), std::forward(flags)); ``` -------------------------------- ### pre_enumeration Source: https://ned14.github.io/llfio/structllfio__v2__xxx_1_1algorithm_1_1traverse__visitor-members.html Called before the contents of a directory are enumerated. Allows for pre-processing or setup. ```APIDOC ## pre_enumeration ### Description Called before the contents of a directory are enumerated. Allows for pre-processing or setup. ### Signature `virtual void pre_enumeration(void *data, const directory_handle &dirh, size_t depth) noexcept` ### Parameters - **data** (void *) - User-provided data. - **dirh** (const directory_handle &) - The directory handle. - **depth** (size_t) - The current depth of the traversal. ``` -------------------------------- ### Default Constructor for llfio_v2_xxx::file_handle Source: https://ned14.github.io/llfio/classllfio__v2__xxx_1_1file__handle.html Provides a default constructor for llfio_v2_xxx::file_handle. This is a simple default initialization. ```cpp constexpr llfio_v2_xxx::file_handle::file_handle() noexcept = default; ``` -------------------------------- ### Functions starting with 'a' Source: https://ned14.github.io/llfio/functions_func_a.html This section details functions in LLFIO v2.00 that begin with the letter 'a'. ```APIDOC ## a ### address() - **Description**: Returns the address of the mapped memory. - **Returns**: `llfio_v2_xxx::map_handle`, `llfio_v2_xxx::mapped_file_handle` ### allocator() - **Description**: Returns the allocator used by the path view component. - **Returns**: `kvstore_v1_xxx::basic_key_value_store`, `llfio_v2_xxx::path_view_component::rendered_path< ZeroTermination, T, AllocatorOrDeleter, _internal_buffer_size, type >` ### anonymous_pipe() - **Description**: Creates an anonymous pipe. - **Returns**: `llfio_v2_xxx::pipe_handle` ### are_reads_from_cache() - **Description**: Checks if reads are served from cache. - **Returns**: `bool` (from `llfio_v2_xxx::handle`) ### are_safety_barriers_issued() - **Description**: Checks if safety barriers have been issued. - **Returns**: `bool` (from `llfio_v2_xxx::handle`) ### are_writes_durable() - **Description**: Checks if writes are durable. - **Returns**: `bool` (from `llfio_v2_xxx::handle`) ### as_span() - **Description**: Converts the mapped object to a span. - **Returns**: `llfio_v2_xxx::map_handle`, `llfio_v2_xxx::mapped< T >` ### assign() - **Description**: Assigns a new value to the vector. - **Returns**: `void` (from `llfio_v2_xxx::algorithm::impl::trivial_vector_impl< has_default_construction, T >`) ### at() - **Description**: Accesses an element at a specific index. - **Returns**: `T&` (from `llfio_v2_xxx::algorithm::impl::trivial_vector_impl< has_default_construction, T >`) ### atomic_append() - **Description**: Atomically appends data to a file. - **Returns**: `void` (from `llfio_v2_xxx::algorithm::shared_fs_mutex`) ``` -------------------------------- ### Create Path Handle (with base) Source: https://ned14.github.io/llfio/namespacellfio__v2__xxx.html Creates a path handle for accessing a file system location. Uses an efficient OS-specific method if available, otherwise opens a directory with read-only permissions. Errors can be any POSIX open() or CreateFile() error. ```cpp | result< path_handle > llfio_v2_xxx::path | ( | const path_handle & | _base_ , | path_handle::path_view_type | _path_ ) inlinenoexcept 172{ 173 return path_handle::path(std::forward(base), std::forward(path)); 174} ``` -------------------------------- ### try_parent_path_handle_until Source: https://ned14.github.io/llfio/classllfio__v2__xxx_1_1fs__handle-members.html Attempts to get the parent path handle until a specified time point. ```APIDOC ## try_parent_path_handle_until ### Description Attempts to get the parent path handle until a specified time point. ### Method inline ### Parameters - **Args &&... args** - Forwarded arguments for getting the parent path handle. - **timeout** (const std::chrono::time_point< Clock, Duration > &) - The time point until which the operation can proceed. ### Endpoint N/A (This is a class method, not an HTTP endpoint) ### Request Example N/A ### Response N/A ``` -------------------------------- ### try_parent_path_handle_for Source: https://ned14.github.io/llfio/classllfio__v2__xxx_1_1fs__handle-members.html Attempts to get the parent path handle within a specified duration. ```APIDOC ## try_parent_path_handle_for ### Description Attempts to get the parent path handle within a specified duration. ### Method inline ### Parameters - **Args &&... args** - Forwarded arguments for getting the parent path handle. - **duration** (const std::chrono::duration< Rep, Period > &) - The duration within which the operation must complete. ### Endpoint N/A (This is a class method, not an HTTP endpoint) ### Request Example N/A ### Response N/A ``` -------------------------------- ### mapped_file_handle::mapped_file_handle (conversion from file_handle with mapping) Source: https://ned14.github.io/llfio/classllfio__v2__xxx_1_1mapped__file__handle.html This constructor allows for explicit conversion from a file_handle and attempts to map the file. It takes a file_handle, reservation size, section flags, and an offset. It initializes the base file_handle, offset, and section handle, and then attempts to reserve and map the file. ```APIDOC ## mapped_file_handle() [conversion from file_handle with mapping] ### Description Explicit conversion from file_handle permitted, this overload also attempts to map the file. ### Method Signature `template mapped_file_handle::mapped_file_handle(file_handle &&o, size_type _reservation_, SHF _sflags_, extent_type _offset_)` ### Parameters - `o` (file_handle &&): The file handle to move from. - `_reservation_` (size_type): The reservation size for mapping. - `_sflags_` (SHF): Section flags. - `_offset_` (extent_type): The offset within the file. ### Notes - Attempts to reserve and map the file. If mapping fails and the file length is not zero, an exception is thrown. If the file length is zero, the error is sunk. - Performs assertions to check consistency of native handles if the mapped handle is valid. ```