Files
baidu_fanyi/bf.xlnt.h
2026-03-10 14:32:11 +08:00

32 lines
754 B
C++

#ifndef BF_XLNT_H
#define BF_XLNT_H
#include <unordered_map>
#include <xlnt/xlnt.hpp>
#include "bf.config.h"
#include "bf.request.h"
#include "bf.util.h"
class BF_Xlnt
{
public:
BF_Xlnt() = default;
public:
void Reset();
void Set(BF_Interface* request, std::shared_ptr<BF_Config> bfConfig);
bool parseXlsx(const std::string& file, std::vector<XlsxTask>& tasks, const std::string& sheetName);
private:
bool Fanyi(int i, int j, xlnt::worksheet& ws, const XlsxTask& task, std::string& out);
bool GetCell(int i, int j, xlnt::worksheet& ws, xlnt::cell_reference& out);
private:
BF_Interface* request_{};
std::shared_ptr<BF_Config> bfConfig_{};
std::unordered_map<std::string, std::string> fanyiHistory_{};
};
#endif