21#include "nlohmann/json.hpp"
25using json = nlohmann::json;
26namespace fs = std::filesystem;
147void write_file_generic(
const fs::path& file_path,
const std::vector<std::string>& content);
184std::vector<std::string>
split_string(
const std::string& s,
char delimiter);
194std::string
hash(
const std::string& content);
222Wrapped wrapped(
const std::string& text,
size_t spaces = 1,
bool use_first_line =
true);
std::string to_uppercase(const std::string input)
const std::vector< std::string > COLOR_TOKENS_UTILS_LIGTH
ANSI color codes for light terminal backgrounds.
void write_file_generic(const fs::path &file_path, const std::vector< std::string > &content)
Writes content to a file at specified path.
std::string format_colored_message(const std::string &message, COLOR color)
Formats a message with ANSI color codes.
std::vector< std::string > split_string(const std::string &s, char delimiter)
Splits a string by a delimiter into tokens.
bool is_special_char(char c)
Checks if a character is special (non-alphanumeric and not underscore)
COLOR
Enumeration of available colors for formatted messages.
@ RESET
Reset to default color.
@ BRIGHT_YELLOW
Bright yellow color.
@ UNDERLINE
Underline text.
const std::vector< std::string > COLOR_TOKENS_UTILS_DARK
ANSI color codes for dark terminal backgrounds.
void open_folder(const std::string &path)
void ensure_file_is_open(const std::ifstream &file, const fs::path &file_name)
Ensures that a file stream is successfully opened.
json read_json(const fs::path &string_path)
Reads and parses a JSON file, uses nlohmann json library.
bool is_empty_char(char c)
Checks if a character is considered empty/whitespace.
const std::string LIMITER_PRINT
Constant string used as a visual delimiter/separator in prints.
std::string format_size(std::uintmax_t bytes)
Formats a byte size into a human-readable string.
std::uintmax_t folder_size(const fs::path &folder)
Calculates the total size of all regular files in a folder.
const int MKDIR_FLAG
Permission flags used when creating directories (rwx for owner)
std::vector< std::string > read_file_generic(const fs::path &string_path)
Reads a file line by line into a vector of strings.
std::string hash(const std::string &content)
Computes a simple hash of a string.
Wrapped wrapped(const std::string &text, size_t spaces=1, bool use_first_line=true)
std::ostream & operator<<(std::ostream &os, const Wrapped &w)