-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathTranslator.h
39 lines (36 loc) · 951 Bytes
/
Translator.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#pragma once
#include <boost/property_tree/ptree.hpp>
#include <boost/property_tree/xml_parser.hpp>
#include "boost/algorithm/string.hpp"
#include "boost/asio.hpp"
#include "curl_wrapper.h"
#include <string>
#include <vector>
#include <fstream>
#include <string>
#include <set>
#include <exception>
#include <iostream>
#include "Locale.h"
#include <imgui.h>
namespace pt = boost::property_tree;
class Translator
{
private:
pt::ptree tree;
public:
void translate(const std::string& filepath,
const std::vector<std::string>& commands,
const Locale& input_locale,
const Locale& output_locale);
private:
void load_to_ptree(const std::string& filename, const std::string& locale_str);
void output_to_file(const std::string& filename, const std::string& locale_str);
};
struct bad_command_exception : std::exception
{
const char* what() const throw ()
{
return "Command syntax error";
}
};