Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
Aleph::CA::ca_io_detail Namespace Reference

Functions

template<typename Lattice >
void require_rank2 (const char *fn)
 
std::string trim_copy (const std::string &s)
 
std::string lower_copy (std::string s)
 
bool blank (const std::string &s)
 
ca_size_t parse_size_token (const std::string &s, const char *what)
 
ca_index_t parse_index_token (const std::string &s, const char *what)
 
Array< std::string > split_comment_lines (const std::string &comment)
 
std::string json_escape (const std::string &s)
 
std::string rle_token (ca_size_t n, char glyph)
 
void append_rle_token (std::string &body, ca_size_t n, char glyph)
 
void write_wrapped_rle_body (std::ostream &out, const std::string &body, const std::size_t line_width)
 
std::string header_value (const std::string &line, const std::string &key)
 
void finalise_absolute_pattern (Binary_Cell_Pattern &pattern, const Array< Coord_Vec< 2 > > &absolute, const bool have_extent, const ca_index_t min_row, const ca_index_t min_col, const ca_index_t max_row, const ca_index_t max_col)
 
template<typename T >
T parse_scalar (const std::string &token, const char *format)
 
template<typename T >
T parse_json_number (const std::string &s, std::size_t &pos)
 
ca_size_t parse_json_size_field (const std::string &s, const std::string &key)
 
void ensure_stream_ok (const std::ostream &out, const char *fn)
 
template<typename T >
void write_text_scalar (std::ostream &out, const T &value)
 
template<class F >
auto try_parse (F &&parse, const char *context) -> expected< std::invoke_result_t< F & >, std::string >
 Invoke a parser, translating any thrown exception into the error channel of expected.
 

Function Documentation

◆ append_rle_token()

void Aleph::CA::ca_io_detail::append_rle_token ( std::string &  body,
ca_size_t  n,
char  glyph 
)
inline

Definition at line 397 of file ca-io.H.

References rle_token().

◆ blank()

bool Aleph::CA::ca_io_detail::blank ( const std::string &  s)
inline

Definition at line 288 of file ca-io.H.

References Aleph::blossom_maximum_cardinality_matching().

◆ ensure_stream_ok()

void Aleph::CA::ca_io_detail::ensure_stream_ok ( const std::ostream &  out,
const char *  fn 
)
inline

◆ finalise_absolute_pattern()

◆ header_value()

std::string Aleph::CA::ca_io_detail::header_value ( const std::string &  line,
const std::string &  key 
)
inline

◆ json_escape()

std::string Aleph::CA::ca_io_detail::json_escape ( const std::string &  s)
inline

Definition at line 351 of file ca-io.H.

References out.

◆ lower_copy()

std::string Aleph::CA::ca_io_detail::lower_copy ( std::string  s)
inline

Definition at line 281 of file ca-io.H.

Referenced by header_value().

◆ parse_index_token()

ca_index_t Aleph::CA::ca_io_detail::parse_index_token ( const std::string &  s,
const char *  what 
)
inline

◆ parse_json_number()

template<typename T >
T Aleph::CA::ca_io_detail::parse_json_number ( const std::string &  s,
std::size_t &  pos 
)
inline

◆ parse_json_size_field()

ca_size_t Aleph::CA::ca_io_detail::parse_json_size_field ( const std::string &  s,
const std::string &  key 
)
inline

◆ parse_scalar()

template<typename T >
T Aleph::CA::ca_io_detail::parse_scalar ( const std::string &  token,
const char *  format 
)
inline

◆ parse_size_token()

ca_size_t Aleph::CA::ca_io_detail::parse_size_token ( const std::string &  s,
const char *  what 
)
inline

◆ require_rank2()

template<typename Lattice >
void Aleph::CA::ca_io_detail::require_rank2 ( const char *  fn)
inline

◆ rle_token()

std::string Aleph::CA::ca_io_detail::rle_token ( ca_size_t  n,
char  glyph 
)
inline

Definition at line 386 of file ca-io.H.

Referenced by append_rle_token().

◆ split_comment_lines()

Array< std::string > Aleph::CA::ca_io_detail::split_comment_lines ( const std::string &  comment)
inline

Definition at line 339 of file ca-io.H.

References Aleph::blossom_maximum_cardinality_matching().

◆ trim_copy()

std::string Aleph::CA::ca_io_detail::trim_copy ( const std::string &  s)
inline

Definition at line 270 of file ca-io.H.

References Aleph::and.

Referenced by header_value(), parse_index_token(), parse_scalar(), and parse_size_token().

◆ try_parse()

template<class F >
auto Aleph::CA::ca_io_detail::try_parse ( F &&  parse,
const char *  context 
) -> expected<std::invoke_result_t<F &>, std::string>

Invoke a parser, translating any thrown exception into the error channel of expected.

The Aleph error macros (ah_*_error) throw types deriving from std::exception, so their message is preserved.

Definition at line 1647 of file ca-io.H.

References Aleph::blossom_maximum_cardinality_matching(), and try_parse().

Referenced by try_parse().

◆ write_text_scalar()

template<typename T >
void Aleph::CA::ca_io_detail::write_text_scalar ( std::ostream &  out,
const T &  value 
)
inline

◆ write_wrapped_rle_body()

void Aleph::CA::ca_io_detail::write_wrapped_rle_body ( std::ostream &  out,
const std::string &  body,
const std::size_t  line_width 
)
inline

Definition at line 402 of file ca-io.H.

References ah_domain_error_if, Aleph::and, col, and out.