1、实现目录读取功能
This commit is contained in:
1 parent
6e60886fd3
commit
fe476dff69
11 files changed
+320
-116
No files matched your search
@@ -0,0 +1,22 @@
|
||||
//
|
||||
// Created by Shell on 2026-04-13.
|
||||
//
|
||||
|
||||
#ifndef FORCAST_API_ICU_RAII_H
|
||||
#define FORCAST_API_ICU_RAII_H
|
||||
#include <unicode/ucsdet.h>
|
||||
|
||||
struct UCharsetDetectorDeleter final
|
||||
{
|
||||
void operator ()(UCharsetDetector* ptr) const
|
||||
{
|
||||
if (ptr)
|
||||
{
|
||||
ucsdet_close(ptr);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
using UCharsetDetectorPtr = std::unique_ptr<UCharsetDetector, UCharsetDetectorDeleter>;
|
||||
|
||||
#endif //FORCAST_API_ICU_RAII_H
|
||||
@@ -0,0 +1,27 @@
|
||||
//
|
||||
// Created by Shell on 2025-12-17.
|
||||
//
|
||||
|
||||
#ifndef FORCAST_API_CLIENT_STRING_UTIL_HPP
|
||||
#define FORCAST_API_CLIENT_STRING_UTIL_HPP
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace shell::util {
|
||||
class StringUtil final {
|
||||
public:
|
||||
static std::vector<std::string> split(const std::string &s, const std::string &delim);
|
||||
static std::string convert_encoding(const std::string& input,const std::string& from,const std::string& to);
|
||||
static std::string detect_encoding(const std::string& data);
|
||||
static std::string convert_encoding(const std::string& input,const std::string& to);
|
||||
#ifdef _WIN32
|
||||
static std::wstring utf8_to_utf16le(const std::string& input);
|
||||
|
||||
static std::string utf16le_to_utf8(const std::wstring& input);
|
||||
|
||||
static std::string utf16le_to_utf8(const wchar_t* input);
|
||||
};
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif //FORCAST_API_CLIENT_STRING_UTIL_HPP
|
||||
Reference in new issue
Block a user