yat
0.21pre
|
Some useful functions are placed here. More...
#include "config_public.h"
#include "concept_check.h"
#include "deprecate.h"
#include "Exception.h"
#include "iterator_traits.h"
#include "WeightIterator.h"
#include "yat_assert.h"
#include <boost/iterator/iterator_concepts.hpp>
#include <boost/concept_check.hpp>
#include <algorithm>
#include <cctype>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <limits>
#include <locale>
#include <istream>
#include <iostream>
#include <numeric>
#include <string>
#include <stdexcept>
#include <sstream>
#include <utility>
#include <vector>
Go to the source code of this file.
Namespaces | |
theplu | |
The Department of Theoretical Physics namespace as we define it. | |
theplu::yat | |
yat project namespace. | |
theplu::yat::utility | |
Miscellaneous functionality. | |
Macros | |
#define | YAT_MOVE(arg) std::move(arg) |
#define | YAT_MOVE_IF_NOEXCEPT(arg) std::move_if_noexcept(arg) |
likewise for std::move_if_noexcept | |
Functions | |
std::string | theplu::yat::utility::basename (const std::string &fn) |
template<typename T > | |
std::istream & | theplu::yat::utility::binary_read (std::istream &is, T &x) |
template<typename T > | |
void | theplu::yat::utility::binary_write (std::ostream &os, T x) |
template<typename InputIterator , typename OutputIterator > | |
bool | theplu::yat::utility::binary_weight (InputIterator first, InputIterator last, OutputIterator result) |
void | theplu::yat::utility::chdir (const std::string &dir) |
void | theplu::yat::utility::chmod (const std::string &filename, mode_t mode) |
template<typename charT , class Traits , class Allocator > | |
bool | theplu::yat::utility::contains (const std::basic_string< charT, Traits, Allocator > &str, const std::basic_string< charT, Traits, Allocator > &substr) |
template<typename charT , class Traits , class Allocator > | |
bool | theplu::yat::utility::contains (const std::basic_string< charT, Traits, Allocator > &str, charT substr) |
since New in yat 0.20 | |
template<typename charT , class Traits , class Allocator > | |
bool | theplu::yat::utility::contains (const std::basic_string< charT, Traits, Allocator > &str, const charT *substr) |
since New in yat 0.20 | |
template<typename T > | |
std::string | theplu::yat::utility::convert (T input) |
convert T to a string More... | |
template<typename T > | |
T | theplu::yat::utility::convert (const std::string &s) |
convert string to (numerical) type More... | |
template<typename T > | |
bool | theplu::yat::utility::convert_try (const std::string &s, T &t) |
try to convert More... | |
void | theplu::yat::utility::copy_file (const std::string &source, const std::string &target) |
Copy file source to target. More... | |
std::string | theplu::yat::utility::dirname (const std::string &fn) |
template<typename charT , class Traits , class Allocator > | |
bool | theplu::yat::utility::ends_with (const std::basic_string< charT, Traits, Allocator > &str, const std::basic_string< charT, Traits, Allocator > &suffix) |
template<typename charT , class Traits , class Allocator > | |
bool | theplu::yat::utility::ends_with (const std::basic_string< charT, Traits, Allocator > &str, charT suffix) |
since New in yat 0.20 | |
template<typename charT , class Traits , class Allocator > | |
bool | theplu::yat::utility::ends_with (const std::basic_string< charT, Traits, Allocator > &str, const charT *suffix) |
since New in yat 0.20 | |
bool | theplu::yat::utility::fnmatch (const std::string &pattern, const std::string &str, int flags=0) |
std::string | theplu::yat::utility::getcwd (void) |
current directory More... | |
void | theplu::yat::utility::gsl_error_handler (const char *reason, const char *file, int line, int gsl_errno) |
template<typename T > | |
bool | theplu::yat::utility::is (const std::string &s) |
check if string is convertible to (numerical) type T More... | |
bool | theplu::yat::utility::is_double (const std::string &) |
bool | theplu::yat::utility::is_equal (std::string s, std::string other) |
bool | theplu::yat::utility::is_float (const std::string &) |
bool | theplu::yat::utility::is_int (const std::string &) |
bool | theplu::yat::utility::is_nan (const std::string &s) |
template<typename T > | |
void | theplu::yat::utility::load (std::istream &is, std::vector< std::vector< T > > &vec, char sep='\0', char line_sep='\n', bool ignore_empty=false, bool rectangle=true) |
template<typename T > | |
void | theplu::yat::utility::load (std::istream &is, std::vector< T > &vec, char sep='\0') |
Fill a vector<T> with elements from istream. More... | |
template<typename T > | |
T | theplu::yat::utility::log2 (T x) |
void | theplu::yat::utility::mkdir (const std::string &dir, mode_t mode=0777) |
create a directory dir More... | |
void | theplu::yat::utility::mkdir_p (const std::string &dir, mode_t mode=0777) |
void | theplu::yat::utility::print_what (const std::exception &error, std::ostream &out=std::cerr) |
recursively print exception what More... | |
void | theplu::yat::utility::remove (const std::string &fn) |
void | theplu::yat::utility::rename (const std::string &from, const std::string &to) |
void | theplu::yat::utility::replace (std::string &full_str, const std::string &old_str, const std::string &new_str) |
template<typename charT , class Traits , class Allocator > | |
bool | theplu::yat::utility::starts_with (const std::basic_string< charT, Traits, Allocator > &str, const std::basic_string< charT, Traits, Allocator > &prefix) |
template<typename charT , class Traits , class Allocator > | |
bool | theplu::yat::utility::starts_with (const std::basic_string< charT, Traits, Allocator > &str, charT prefix) |
since New in yat 0.20 | |
template<typename charT , class Traits , class Allocator > | |
bool | theplu::yat::utility::starts_with (const std::basic_string< charT, Traits, Allocator > &str, const charT *prefix) |
since New in yat 0.20 | |
template<typename Iterator > | |
double | theplu::yat::utility::sum_weight (Iterator first, Iterator last) |
void | theplu::yat::utility::symlink (const std::string &path1, const std::string &path2) |
Some useful functions are placed here.
#define YAT_MOVE | ( | arg | ) | std::move(arg) |
Preprocessor macro that works like std::move, but also works when rvalue is not available (in which case arg is returned).