sources/headers/aux_sys.h file

declares File class, i/o functions and string operations

Classes

class File
consists of a list of strings that specify a file path when concatenated along file_sep
struct max_gr_str
consists of three integers, one for each grading (quantum, homological, δ), specifying the number of characters that should be reserved for this grading in text output. This is used to align the gradings in string representations of objects (BNObj,CobObj).

Typedefs

using Grading = int
grading
using IndexL = std::vector<unsigned int>
list of indices
using IndexLL = std::vector<IndexL>
list of lists of indices

Functions

void conditional_append(const std::string& filename, const std::string& line)
append line to the text file filename, unless this line already exists in the file
auto file_to_string(const std::string& fname) -> std::string
reads in a file as a string
auto fill_front(const std::string& s, const std::string& max) -> std::string
adds whitespace to the front of a string s such that its length becomes equal to max
auto html_header(const File& file) -> std::string
defines header of html files
auto html_navigation_title(const File& file) -> std::string
main heading of the html pages allowing to navigate in the file structure
void html_summary(const File& file)
recompiles all html files linking to the file file
auto my_alpha_num(const std::string& s) -> bool
true if all characters are alphanumeric or _ or -
void replace_all(std::string& input, const std::string& s_old, const std::string& s_new)
replaces all occurences of s_old in input as s_new.
auto spin(const size_t& counter) -> std::string
status indicator (working)
template<typename T>
auto stringL(const T& List) -> std::string
string representative of a list of elements
template<typename T>
auto stringLL(const T& LList) -> std::string
string representative of a list of list of elements
auto time_to_string(const std::chrono::milliseconds& duration) -> std::string
convert time to a string indicating ms, s, min, h, as appropriate
void to_html(const File& file)
compiles a html file of all information that has ever been computed for the file file
auto to_percentage(const size_t& p, const size_t& q) -> std::string
converts fraction p/q with $0\leq p<q$ to percentage
auto to_string(const bool& b) -> std::string
converts boolean value into string
auto version_compare(const std::string& s1, const std::string& s2) -> bool
comparison operator that interprets substrings of consecutive digits as integers before doing the comparison;
auto yes_no_dialogue(const std::string& message) -> bool
prints message in terminal and accepts a yes/no no answer from the user

Variables

const std::string file_sep
file separator (depends on operating system)

Function documentation

bool version_compare(const std::string& s1, const std::string& s2)

comparison operator that interprets substrings of consecutive digits as integers before doing the comparison;

Inspired by the command line tool sort --version-sort.