53 lines
1.6 KiB
C++
53 lines
1.6 KiB
C++
#ifndef UTILS_H
|
|
#define UTILS_H
|
|
|
|
#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);
|
|
|
|
const std::map<std::string, ColumnType> column_names = {
|
|
{"date", ColumnType::date},
|
|
{"goods_name", ColumnType::goods_name},
|
|
{"goods_price_per_unit", ColumnType::goods_price_per_unit},
|
|
{"goods_quantity", ColumnType::goods_quantity},
|
|
{"goods_net_weight", ColumnType::goods_net_weight},
|
|
{"goods_total", ColumnType::goods_total}
|
|
};
|
|
|
|
// 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>
|
|
bool areAllSizesEqual(const std::vector<T>& v1, const std::vector<T>& v2,
|
|
const std::vector<T>& v3, const std::vector<T>& v4);
|
|
|
|
std::vector<std::string> split(std::string, std::string);
|
|
std::vector<std::wstring> split(std::wstring s, std::wstring delimiter);
|
|
|
|
#ifdef BUILD_OFD_MODE
|
|
Check parseOfdRuAnswer(std::string);
|
|
|
|
std::wstring trim_html_response(std::wstring& check);
|
|
#endif
|
|
|
|
#ifdef BUILD_OFD_BINARYEYE_SCAN
|
|
void generate_qr_code(std::string data);
|
|
std::string get_local_ip_address();
|
|
#endif
|
|
|
|
void fetch_and_download_modules();
|
|
#ifdef BUILD_EMAIL_MODE
|
|
std::vector<std::string> read_file(std::string path);
|
|
#endif
|
|
#endif // UTILS_H
|