saving output settings

This commit is contained in:
2025-05-17 15:43:05 +03:00
parent 33ea7ff459
commit b67d575645
7 changed files with 63 additions and 32 deletions

View File

@@ -1,3 +1,4 @@
#include "output/output_options.h"
#include <utils/utils.h>
#ifdef BUILD_OFD_BINARYEYE_SCAN
# include <arpa/inet.h>
@@ -80,11 +81,31 @@ bool areAllSizesEqual(const std::vector<T>& v1, const std::vector<T>& v2,
return (v1.size() == v2.size() && v2.size() == v3.size() && v3.size() == v4.size());
}
// template<typename K, typename V>
// K find_key_by_value(std::map<K, V> &m, V value) {
// for (auto& entry : m) {
// if (value == entry.second) {
// return entry.first;
// }
// }
// return K();
// }
std::string find_key_by_value(const std::map<std::string, ColumnType> &m, ColumnType value) {
for (auto& entry : m) {
if (value == entry.second) {
return entry.first;
}
}
return "";
}
//ужас
template bool vector_contains_element<std::string>(const std::vector<std::string>& vector, const std::string& to_find);
template bool areAllSizesEqual(const std::vector<std::string>& v1, const std::vector<std::string>& v2,
const std::vector<std::string>& v3, const std::vector<std::string>& v4);
// template std::string find_key_by_value(std::map<std::string, ColumnType> &, ColumnType);
std::vector<std::string> split(std::string s, std::string delimiter) {
std::vector<std::string> result;
size_t pos = 0;
@@ -321,3 +342,4 @@ std::vector<std::string> read_file(std::string path) {
return lines;
}
#endif // ifdef BUILD_EMAIL_MODE

View File

@@ -3,13 +3,19 @@
#include <string>
#include <vector>
#include <map>
#include "../check/check.h"
#include "output/output_options.h"
std::string to_utf8(std::wstring wide_string);
std::wstring from_utf8(std::string string);
std::string get_path_relative_to_home(std::string path);
// template <typename K, typename V>
// K find_key_by_value(std::map<K, V> &m, V value);
std::string find_key_by_value(const std::map<std::string, ColumnType> &m, ColumnType value);
template <typename T>
bool vector_contains_element(const std::vector<T> &vector, const T &to_find);
template <class T>