fix: removed unnecessary function, update header file for signature change.
This commit is contained in:
@@ -2,16 +2,9 @@
|
|||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
/**
|
|
||||||
* Reads a CSS file, searches for 8-bit hex codes (#RRGGBBAA),
|
|
||||||
* and returns true if found, or false if not found.
|
|
||||||
*/
|
|
||||||
|
|
||||||
bool has_8bit_hex(std::string file_path);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reads a CSS file, searches for 8-bit hex codes (#RRGGBBAA),
|
* Reads a CSS file, searches for 8-bit hex codes (#RRGGBBAA),
|
||||||
* and transforms them into GTK-compatible rgba() syntax.
|
* and transforms them into GTK-compatible rgba() syntax.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
std::string transform_8bit_to_hex(std::string file_path);
|
std::string transform_8bit_to_hex(const std::string& file_path);
|
||||||
|
|||||||
@@ -1,15 +0,0 @@
|
|||||||
#include <filesystem>
|
|
||||||
#include <fstream>
|
|
||||||
#include <regex>
|
|
||||||
|
|
||||||
namespace fs = std::filesystem;
|
|
||||||
|
|
||||||
bool has_8bit_hex(std::string file_path) {
|
|
||||||
std::ifstream f(file_path, std::ios::in | std::ios::binary);
|
|
||||||
const auto size = fs::file_size(file_path);
|
|
||||||
std::string result(size, '\0');
|
|
||||||
f.read(result.data(), size);
|
|
||||||
std::regex pattern(
|
|
||||||
R"((?:\#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})))");
|
|
||||||
return std::regex_search(result, pattern);
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user