2024-12-13 23:03:12 +08:00
|
|
|
#include "file_oper.h"
|
|
|
|
|
|
|
|
CFileOpr::CFileOpr()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
CFileOpr::~CFileOpr()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
std::vector<std::string> CFileOpr::get_file_list(const std::string& input)
|
|
|
|
{
|
|
|
|
std::vector<std::string> result;
|
|
|
|
std::string backup = input;
|
|
|
|
backup.erase(0, backup.find_first_of(" "));
|
|
|
|
backup = COfStr::trim(backup);
|
|
|
|
if (backup.empty()) {
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
auto vec = COfStr::split(backup, "|");
|
|
|
|
for (const auto& item : vec) {
|
2024-12-17 08:09:58 +08:00
|
|
|
std::string ret(item);
|
2024-12-17 08:20:38 +08:00
|
|
|
#ifdef _WIN32
|
2024-12-17 08:09:58 +08:00
|
|
|
if (item.find("\"") != std::string::npos) {
|
|
|
|
ret = COfStr::replace(item, "\"", "");
|
|
|
|
}
|
2024-12-17 08:20:38 +08:00
|
|
|
#else
|
|
|
|
if (item.find(R"(')") != std::string::npos) {
|
|
|
|
ret = COfStr::replace(item, R"(')", "");
|
|
|
|
}
|
|
|
|
#endif
|
2024-12-17 08:09:58 +08:00
|
|
|
result.push_back(COfPath::to_full(ret));
|
2024-12-13 23:03:12 +08:00
|
|
|
}
|
|
|
|
return result;
|
|
|
|
}
|