2026-05-11 23:06:39 +03:00
|
|
|
/*
|
|
|
|
|
* InfiniPaint
|
|
|
|
|
* Copyright (C) 2025-2026 Yousef Khadadeh
|
|
|
|
|
*
|
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
|
* (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
|
*/
|
|
|
|
|
|
2025-07-06 20:43:53 +03:00
|
|
|
#pragma once
|
2026-04-27 16:48:44 +03:00
|
|
|
#include <SDL3/SDL_filesystem.h>
|
2025-07-06 20:43:53 +03:00
|
|
|
#include <string>
|
|
|
|
|
#include <vector>
|
|
|
|
|
#include <cstdint>
|
|
|
|
|
#include <filesystem>
|
2026-04-27 16:48:44 +03:00
|
|
|
#include <functional>
|
2026-04-20 18:56:39 +03:00
|
|
|
#include <SDL3/SDL_time.h>
|
2025-07-06 20:43:53 +03:00
|
|
|
|
|
|
|
|
std::vector<std::string> split_string_by_token(std::string str, std::string token);
|
|
|
|
|
|
|
|
|
|
// Hex character must be capitalized if it is a letter
|
|
|
|
|
uint8_t ascii_hex_char_to_number_no_checks(char asciiHex);
|
|
|
|
|
std::string byte_vector_to_hex_str(const std::vector<uint8_t>& byteVec);
|
|
|
|
|
std::string read_file_to_string(const std::filesystem::path& filePath);
|
2025-10-09 16:16:39 +03:00
|
|
|
bool is_valid_http_url(const std::string& str);
|
2025-12-03 09:29:51 +03:00
|
|
|
std::string remove_carriage_returns_from_str(std::string s);
|
2026-01-18 13:39:49 +03:00
|
|
|
std::string ensure_string_unique(const std::vector<std::string>& stringList, std::string str);
|
2026-04-20 20:16:15 +03:00
|
|
|
std::string sdl_time_to_nice_access_time(const SDL_DateTime& t, SDL_DateFormat dF, SDL_TimeFormat tF);
|
2026-04-27 16:48:44 +03:00
|
|
|
std::vector<std::string> glob_path_as_string_list(const std::filesystem::path& folder, const char* globStr, SDL_GlobFlags globFlags, const std::function<std::string(const std::filesystem::path)>& pathToStr);
|
2026-06-01 15:42:33 +03:00
|
|
|
std::filesystem::path sdl_safe_copy_file(const std::filesystem::path& toPath, const std::filesystem::path& fileToCopy, const std::string& fileName, const std::string& fileExtension);
|