| 1 |
/* |
| 2 |
* SPDX-FileCopyrightText: 2017-2017 CSSlayer <[email protected]> |
| 3 |
* |
| 4 |
* SPDX-License-Identifier: LGPL-2.1-or-later |
| 5 |
* |
| 6 |
*/ |
| 7 |
#ifndef _CHTTRANS_CHTTRANS_OPENCC_H_ |
| 8 |
#define _CHTTRANS_CHTTRANS_OPENCC_H_ |
| 9 |
|
| 10 |
#include "chttrans.h" |
| 11 |
#include <opencc.h> |
| 12 |
|
| 13 |
class OpenCCBackend : public ChttransBackend { |
| 14 |
public: |
| 15 |
std::string convertSimpToTrad(const std::string &) override; |
| 16 |
std::string convertTradToSimp(const std::string &) override; |
| 17 |
|
| 18 |
void updateConfig(const ChttransConfig &config) override; |
| 19 |
|
| 20 |
std::string locateProfile(const std::string &); |
| 21 |
|
| 22 |
protected: |
| 23 |
bool loadOnce(const ChttransConfig &config) override; |
| 24 |
|
| 25 |
private: |
| 26 |
std::unique_ptr<opencc::SimpleConverter> s2t_; |
| 27 |
std::unique_ptr<opencc::SimpleConverter> t2s_; |
| 28 |
}; |
| 29 |
|
| 30 |
#endif // _CHTTRANS_CHTTRANS_OPENCC_H_ |