Output to csv, started work on OFD module
This commit is contained in:
@@ -1,26 +1,13 @@
|
||||
#include "module.h"
|
||||
#include "../settings.h"
|
||||
#include <codecvt>
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
#include <locale>
|
||||
#include <nlohmann/json.hpp>
|
||||
#include <regex>
|
||||
#include <string>
|
||||
#include "../utils/utils.h"
|
||||
|
||||
std::string to_utf8(std::wstring wide_string) {
|
||||
static std::wstring_convert<std::codecvt_utf8<wchar_t>> utf8_conv;
|
||||
return utf8_conv.to_bytes(wide_string);
|
||||
}
|
||||
StoreModule::StoreModule() {}
|
||||
|
||||
std::wstring from_utf8(std::string string) {
|
||||
static std::wstring_convert<std::codecvt_utf8<wchar_t>> utf8_conv;
|
||||
return utf8_conv.from_bytes(string);
|
||||
}
|
||||
|
||||
Module::Module() {}
|
||||
|
||||
Module::Module(std::string path) {
|
||||
StoreModule::StoreModule(std::string path) {
|
||||
std::ifstream settings_file(path);
|
||||
nlohmann::json settings = nlohmann::json::parse(settings_file);
|
||||
|
||||
@@ -42,7 +29,7 @@ Module::Module(std::string path) {
|
||||
#endif
|
||||
}
|
||||
|
||||
std::vector<std::string> Module::parse_name(std::wstring str) {
|
||||
std::vector<std::string> StoreModule::parse_name(std::wstring str) {
|
||||
std::vector<std::string> result;
|
||||
std::wregex r(this->goods_name_regex, std::regex::collate);
|
||||
|
||||
@@ -54,7 +41,7 @@ std::vector<std::string> Module::parse_name(std::wstring str) {
|
||||
return result;
|
||||
}
|
||||
|
||||
std::vector<std::string> Module::parse_price(std::wstring str) {
|
||||
std::vector<std::string> StoreModule::parse_price(std::wstring str) {
|
||||
std::vector<std::string> result;
|
||||
std::wregex r(this->goods_price_regex, std::regex::collate);
|
||||
|
||||
@@ -66,7 +53,7 @@ std::vector<std::string> Module::parse_price(std::wstring str) {
|
||||
return result;
|
||||
}
|
||||
|
||||
std::vector<std::string> Module::parse_quantity(std::wstring str) {
|
||||
std::vector<std::string> StoreModule::parse_quantity(std::wstring str) {
|
||||
std::vector<std::string> result;
|
||||
std::wregex r(this->goods_quantity_regex, std::regex::collate);
|
||||
|
||||
@@ -77,7 +64,7 @@ std::vector<std::string> Module::parse_quantity(std::wstring str) {
|
||||
return result;
|
||||
}
|
||||
|
||||
std::wstring Module::trim_check(std::wstring& check) {
|
||||
std::wstring StoreModule::trim_check(std::wstring& check) {
|
||||
unsigned int start_pos;
|
||||
unsigned int end_pos;
|
||||
|
||||
@@ -103,4 +90,4 @@ std::wstring Module::trim_check(std::wstring& check) {
|
||||
return check;
|
||||
}
|
||||
|
||||
std::wstring Module::get_name() { return this->name; }
|
||||
std::wstring StoreModule::get_name() { return this->name; }
|
||||
|
||||
Reference in New Issue
Block a user