UtilsLite
Utilities for C++ programming
Loading...
Searching...
No Matches
Utils.hxx File Reference
#include <cassert>
#include <iterator>
#include <utility>
#include <algorithm>
#include <type_traits>
#include <functional>
#include <cctype>
#include <string>
#include <string_view>
#include <vector>
#include <list>
#include <map>
#include <limits>
#include <iostream>
#include <iomanip>
#include <sstream>
#include <cstdlib>
#include <filesystem>
#include <cstddef>
#include <cmath>
#include <cstdint>
#include <stdexcept>
#include <memory>
#include <future>
#include <mutex>
#include <shared_mutex>
#include <thread>
#include <condition_variable>
#include <atomic>
#include "rang.hxx"
#include "Console.hxx"
#include "Malloc.hxx"
#include "Numbers.hxx"
#include "TicToc.hxx"
#include "Quaternion.hxx"
#include "Table.hxx"
#include "Token.hxx"
#include "ThreadUtils.hxx"
#include "ThreadPoolBase.hxx"
#include "ThreadPool0.hxx"
#include "ThreadPool1.hxx"
#include "ThreadPool2.hxx"
#include "ThreadPool3.hxx"
#include "ThreadPool4.hxx"
#include "ThreadPool5.hxx"

Go to the source code of this file.

Namespaces

namespace  Utils
 

Macros

#define UTILS_PURE_VIRTUAL   = 0
 
#define UTILS_OVERRIDE   override
 
#define UTILS_CONSTEXPR   constexpr
 

Functions

string Utils::get_basename (string_view path)
 
string Utils::get_filename (string_view path)
 
string Utils::get_extension (string_view path)
 
bool Utils::get_environment (string_view ename, string &res)
 Fetches the value of an environment variable.
 
void Utils::set_environment (string_view ename, string_view newval, bool overwrite)
 Sets the value of an environment variable.
 
void Utils::get_MAC_address (std::map< string, string > &addr)
 Retrieves the MAC addresses of network interfaces.
 
string Utils::get_host_name ()
 Retrieves the hostname of the system.
 
void Utils::get_IP_address (std::vector< string > &addr)
 Fetches the IP addresses of the system.
 
string Utils::get_user_name ()
 Retrieves the username of the current user.
 
string Utils::get_home_directory ()
 Retrieves the home directory of the current user.
 
string Utils::get_executable_path_name ()
 Retrieves the full path to the current executable.
 
bool Utils::check_if_file_exists (string_view fname)
 Checks if a file exists.
 
bool Utils::check_if_dir_exists (string_view dirname)
 Checks if a directory exists.
 
bool Utils::make_directory (string_view dirname, unsigned mode=0777)
 Creates a directory if it does not exist.
 
string Utils::get_date ()
 
string Utils::get_day_time ()
 
string Utils::get_day_time_and_date ()
 
string Utils::get_log_date_time ()
 
template<typename T_int, typename T_real>
void Utils::search_interval (T_int npts, T_real const X[], T_real &x, T_int &last_interval, bool closed, bool can_extend)
 
template<typename T_int, typename T_real>
void Utils::searchInterval (T_int npts, T_real const X[], T_real &x, T_int &last_interval, bool closed, bool can_extend)
 
string Utils::progress_bar (double const progress, int const width)
 Generates a text-based progress bar as a string.
 
void Utils::progress_bar (ostream_type &s, double const progress, int const width, string_view const msg)
 Outputs a text-based progress bar to the specified output stream.
 
void Utils::progress_bar2 (ostream_type &s, double const progress, int const width, string_view const msg)
 Outputs an enhanced text-based progress bar to the specified output stream.
 

Macro Definition Documentation

◆ UTILS_CONSTEXPR

#define UTILS_CONSTEXPR   constexpr

◆ UTILS_OVERRIDE

#define UTILS_OVERRIDE   override

◆ UTILS_PURE_VIRTUAL

#define UTILS_PURE_VIRTUAL   = 0