25 lines
697 B
C++
25 lines
697 B
C++
//SPDX-FileCopyrightText: 2023 Yury Gubich <blue@macaw.me>
|
|
//SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
#pragma once
|
|
|
|
#include <filesystem>
|
|
#include <string>
|
|
|
|
#define UNUSED(variable) (void)variable
|
|
|
|
void initPaths(const char* programPath);
|
|
const std::filesystem::path& sharedPath();
|
|
bool endsWith(const std::string& string, const std::string& query);
|
|
void ltrim(std::string& string);
|
|
void rtrim(std::string& string);
|
|
void trim(std::string& string);
|
|
std::string extract(std::string& string, std::string::size_type begin, std::string::size_type end);
|
|
|
|
template <class T>
|
|
struct FirstGreater {
|
|
bool operator () (T left, T right) {
|
|
return std::get<0>(left) > std::get<0>(right);
|
|
}
|
|
};
|