SDSL
3.0.0
Succinct Data Structure Library
|
io.hpp contains some methods for reading/writing sdsl structures. More...
#include <algorithm>
#include <cctype>
#include <iostream>
#include <string>
#include <vector>
#include <sdsl/cereal.hpp>
#include <sdsl/platform.hpp>
#include <sdsl/sdsl_concepts.hpp>
#include <sdsl/structure_tree.hpp>
#include <sdsl/util.hpp>
Go to the source code of this file.
Classes | |
struct | sdsl::has_serialize< X > |
struct | sdsl::has_load< X > |
struct | sdsl::nullstream |
struct | sdsl::nullstream::nullbuf |
struct | sdsl::default_sentinel< t_csx, t_alph > |
struct | sdsl::default_sentinel< t_csx, byte_alphabet_tag > |
struct | sdsl::default_sentinel< t_csx, int_alphabet_tag > |
Namespaces | |
sdsl | |
Namespace for the succinct data structure library. | |
Functions | |
int | sdsl::remove (const std::string &file) |
Remove a file. More... | |
template<typename T > | |
void | sdsl::load_vector (std::vector< T > &vec, std::istream &in) |
Load all elements of a vector from a input stream. More... | |
template<typename T > | |
uint64_t | sdsl::serialize_vector (const std::vector< T > &vec, std::ostream &out, sdsl::structure_tree_node *v, std::string name) |
Serialize each element of an std::vector. More... | |
template<typename T > | |
size_t | sdsl::write_member (const T &t, std::ostream &out, sdsl::structure_tree_node *v=nullptr, std::string name="") |
template<> | |
size_t | sdsl::write_member< std::string > (const std::string &t, std::ostream &out, sdsl::structure_tree_node *v, std::string name) |
template<typename T > | |
void | sdsl::read_member (T &t, std::istream &in) |
template<> | |
void | sdsl::read_member< std::string > (std::string &t, std::istream &in) |
template<typename X > | |
std::enable_if< has_serialize< X >::value, typename X::size_type >::type | sdsl::serialize (const X &x, std::ostream &out, structure_tree_node *v=nullptr, std::string name="") |
template<typename X > | |
std::enable_if< std::is_standard_layout< X >::value &&std::is_trivial< X >::value, uint64_t >::type | sdsl::serialize (const X &x, std::ostream &out, structure_tree_node *v=nullptr, std::string name="") |
template<typename X > | |
uint64_t | sdsl::serialize (const std::vector< X > &x, std::ostream &out, structure_tree_node *v=nullptr, std::string name="") |
template<typename X > | |
std::enable_if< has_load< X >::value, void >::type | sdsl::load (X &x, std::istream &in) |
template<typename X > | |
std::enable_if< std::is_standard_layout< X >::value &&std::is_trivial< X >::value, void >::type | sdsl::load (X &x, std::istream &in) |
template<typename X > | |
void | sdsl::load (std::vector< X > &x, std::istream &in) |
template<typename T > | |
bool | sdsl::load_from_file (T &v, const std::string &file) |
Load sdsl-object v from a file. More... | |
template<typename t_int_vec > | |
bool | sdsl::load_vector_from_file (t_int_vec &v, const std::string &file, uint8_t num_bytes=1, uint8_t max_int_width=64) |
from disk. More... | |
template<typename T > | |
bool | sdsl::store_to_file (const T &v, const std::string &file) |
Store a data structure to a file. More... | |
bool | sdsl::store_to_file (const char *v, const std::string &file) |
Specialization of store_to_file for a char array. More... | |
template<uint8_t t_width> | |
bool | sdsl::store_to_file (const int_vector< t_width > &v, const std::string &file) |
Specialization of store_to_file for int_vector. More... | |
template<typename int_type , typename t_int_vec > | |
bool | sdsl::store_to_plain_array (t_int_vec &v, const std::string &file) |
Store an int_vector as plain int_type array to disk. More... | |
template<typename T > | |
size_t | sdsl::serialize_empty_object (std::ostream &, structure_tree_node *v=nullptr, std::string name="", const T *t=nullptr) |
template<typename T > | |
T::size_type | sdsl::size_in_bytes (const T &t) |
Get the size of a data structure in bytes. More... | |
template<typename T > | |
double | sdsl::size_in_mega_bytes (const T &t) |
Get the size of a data structure in mega bytes (MiB). More... | |
template<format_type F, typename X > | |
void | sdsl::write_structure (const X &x, std::ostream &out) |
template<format_type F, typename X > | |
void | sdsl::write_structure (const X &x, std::string file) |
template<format_type F, typename... Xs> | |
void | sdsl::write_structure (std::ostream &out, Xs... xs) |
template<typename X , typename... Xs> | |
void | sdsl::_write_structure (std::unique_ptr< structure_tree_node > &st_node, X x, Xs... xs) |
void | sdsl::_write_structure (std::unique_ptr< structure_tree_node > &) |
uint64_t | sdsl::_parse_number (std::string::const_iterator &c, const std::string::const_iterator &end) |
Internal function used by csXprintf. More... | |
template<typename t_csa > | |
const t_csa & | sdsl::_idx_csa (const t_csa &t, csa_tag) |
Internal function used by csXprintf. More... | |
template<typename t_cst > | |
const t_cst::csa_type & | sdsl::_idx_csa (const t_cst &t, cst_tag) |
Internal function used by csXprintf. More... | |
template<typename t_csa > | |
std::string | sdsl::_idx_lcp_val (const t_csa &, uint64_t, uint64_t, csa_tag) |
Internal function used by csXprintf. More... | |
template<typename t_cst > | |
std::string | sdsl::_idx_lcp_val (const t_cst &t, uint64_t i, uint64_t w, cst_tag) |
Internal function used by csXprintf. More... | |
template<typename t_idx > | |
void | sdsl::csXprintf (std::ostream &out, const std::string &format, const t_idx &idx, char sentinel=default_sentinel< t_idx >::value) |
Prints members of CSAs and CSTs. More... | |
std::string | sdsl::cache_file_name (const std::string &key, const cache_config &config) |
Returns the file name of the resource. More... | |
void | sdsl::register_cache_file (const std::string &key, cache_config &config) |
Register the existing resource specified by the key to the cache. More... | |
bool | sdsl::cache_file_exists (const std::string &key, const cache_config &config) |
Checks if the resource specified by the key exists in the cache. More... | |
std::string | sdsl::tmp_file (const cache_config &config, std::string name_part="") |
Returns a name for a temporary file. I.e. the name was not used before. More... | |
std::string | sdsl::tmp_file (const std::string &filename, std::string name_part="") |
Returns a name for a temporary file. I.e. the name was not used before. More... | |
template<typename T > | |
bool | sdsl::load_from_cache (T &v, const std::string &key, const cache_config &config, bool add_type_hash=false) |
template<typename T > | |
bool | sdsl::store_to_cache (const T &v, const std::string &key, cache_config &config, bool add_type_hash=false) |
Stores the object v as a resource in the cache. More... | |
template<typename T > | |
bool | sdsl::remove_from_cache (const std::string &key, cache_config &config, bool add_type_hash=false) |
template<typename T > | |
void | sdsl::add_hash (const T &t, std::ostream &out) |
template<typename T > | |
bool | sdsl::store_to_checked_file (const T &t, const std::string &file) |
bool | sdsl::store_to_checked_file (const char *v, const std::string &file) |
bool | sdsl::store_to_file (const std::string &v, const std::string &file) |
template<uint8_t t_width> | |
bool | sdsl::store_to_checked_file (const int_vector< t_width > &v, const std::string &file) |
template<typename T > | |
bool | sdsl::load_from_checked_file (T &v, const std::string &file) |
template<typename t_iv > | |
std::enable_if< std::is_same< typename t_iv::index_category, iv_tag >::value or std::is_same< typename t_iv::index_category, csa_tag >::value or std::is_same< typename t_iv::index_category, lcp_tag >::value, std::ostream & >::type | sdsl::operator<< (std::ostream &os, const t_iv &v) |
template<typename t_iv > | |
std::enable_if< std::is_same< typename t_iv::index_category, wt_tag >::value, std::ostream & >::type | sdsl::operator<< (std::ostream &os, const t_iv &v) |
template<typename t_int > | |
std::enable_if< std::is_integral< t_int >::value, std::ostream & >::type | sdsl::operator<< (std::ostream &os, const std::vector< t_int > &v) |
template<typename t_iv > | |
std::enable_if< std::is_same< typename t_iv::category, csa_member_tag >::value, std::ostream & >::type | sdsl::operator<< (std::ostream &os, const t_iv &v) |