HAL
utils.h File Reference
#include "hal_core/defines.h"
#include "hal_core/utilities/result.h"
#include <algorithm>
#include <functional>
#include <set>
#include <sstream>
#include <string>
#include <unordered_set>
#include <vector>
Include dependency graph for utils.h:

Go to the source code of this file.

Classes

class  hal::utils::RecursiveDirectoryRange
 
class  hal::utils::DirectoryRange
 
struct  hal::utils::Color
 

Namespaces

 hal
 
 hal::utils
 

Functions

template<typename T >
CORE_API bool hal::utils::unordered_vector_erase (std::vector< T > &vec, T element)
 
template<typename T >
bool hal::utils::vectors_have_same_content (std::vector< T > vec_1, std::vector< T > vec_2)
 
CORE_API u64 hal::utils::get_bit (const u64 value, const u64 index)
 
CORE_API u64 hal::utils::set_bit (const u64 value, const u64 index)
 
CORE_API u64 hal::utils::clear_bit (const u64 value, const u64 index)
 
CORE_API u64 hal::utils::toggle_bit (const u64 value, const u64 index)
 
template<typename T >
CORE_API bool hal::utils::ends_with (const T &s, const T &end)
 
template<typename T >
CORE_API bool hal::utils::starts_with (const T &s, const T &start)
 
template<typename T >
CORE_API bool hal::utils::is_digits (const T &s)
 
template<typename T >
CORE_API bool hal::utils::is_integer (const T &s)
 
template<typename T >
CORE_API bool hal::utils::is_floating_point (const T &s)
 
template<typename T >
CORE_API std::vector< T > hal::utils::split (const T &s, const char delim, bool obey_brackets=false)
 
template<typename T >
CORE_APIhal::utils::ltrim (const T &s, const char *to_remove=" \t\r\n")
 
template<typename T >
CORE_APIhal::utils::rtrim (const T &s, const char *to_remove=" \t\r\n")
 
template<typename T >
CORE_APIhal::utils::trim (const T &s, const char *to_remove=" \t\r\n")
 
template<typename T >
CORE_APIhal::utils::replace (const T &str, const T &search, const T &replace)
 
template<typename Iterator , class Transform >
CORE_API std::string hal::utils::join (const std::string &joiner, const Iterator &begin, const Iterator &end, const Transform &transform)
 
template<typename T , class Transform >
CORE_API std::string hal::utils::join (const std::string &joiner, const T &items, const Transform &transform)
 
template<typename T >
CORE_API std::string hal::utils::join (const std::string &joiner, const T &items)
 
template<typename T >
CORE_APIhal::utils::to_upper (const T &s)
 
template<typename T >
CORE_APIhal::utils::to_lower (const T &s)
 
template<typename T >
CORE_API u32 hal::utils::num_of_occurrences (const T &s, const T &substr)
 
template<typename T , template< typename, typename... > class Container, typename... Args>
CORE_API std::vector< T > hal::utils::to_vector (const Container< T, Args... > &container)
 
template<typename T , template< typename, typename... > class Container, typename... Args>
CORE_API std::set< T > hal::utils::to_set (const Container< T, Args... > &container)
 
template<typename T1 , typename T2 >
CORE_API bool hal::utils::is_subset (const T1 &subset, const T2 &superset)
 
bool hal::utils::file_exists (const std::string &filename)
 
bool hal::utils::folder_exists_and_is_accessible (const std::filesystem::path &folder)
 
std::filesystem::path hal::utils::which (const std::string &name, const std::string &path)
 
std::filesystem::path hal::utils::get_binary_directory ()
 
std::filesystem::path hal::utils::get_base_directory ()
 
std::filesystem::path hal::utils::get_library_directory ()
 
std::filesystem::path hal::utils::get_share_directory ()
 
std::filesystem::path hal::utils::get_user_share_directory ()
 
std::filesystem::path hal::utils::get_config_directory ()
 
std::filesystem::path hal::utils::get_user_config_directory ()
 
std::filesystem::path hal::utils::get_default_log_directory (std::filesystem::path source_file)
 
std::vector< std::filesystem::path > hal::utils::get_gate_library_directories ()
 
std::vector< std::filesystem::path > hal::utils::get_plugin_directories ()
 
std::filesystem::path hal::utils::get_first_directory_exists (std::vector< std::filesystem::path > path_hints)
 
std::filesystem::path hal::utils::get_file (std::string file_name, std::vector< std::filesystem::path > path_hints)
 
Result< std::filesystem::path > hal::utils::get_unique_temp_directory (const std::string &prefix, const u32 max_attmeps)
 
std::string hal::utils::get_open_source_licenses ()
 
Result< u64hal::utils::wrapped_stoull (const std::string &s, const u32 base)
 
Result< u32hal::utils::wrapped_stoul (const std::string &s, const u32 base)