33 lines
865 B
C++
33 lines
865 B
C++
#ifndef OFEN_STRING_HEADER
|
|
#define OFEN_STRING_HEADER
|
|
|
|
#include "of_def.hpp"
|
|
#include <vector>
|
|
|
|
namespace ofen {
|
|
class COfStr
|
|
{
|
|
public:
|
|
COfStr();
|
|
~COfStr();
|
|
|
|
public:
|
|
static ofString replace(const ofString& str, const ofString& from, const ofString& to);
|
|
static std::vector<ofString> split(const ofString& input, const ofString& delimiter);
|
|
static ofString trim(const ofString& input);
|
|
|
|
/// @brief 获取一个添加当前日期后缀的字符串(到秒,如 some.txt => some_20150115151221.txt)。
|
|
/// @param name
|
|
/// @return
|
|
static ofString get_ofile_name(const ofString& name);
|
|
|
|
static std::string u8_convert(const std::wstring& source);
|
|
|
|
/// @brief
|
|
/// @param source 需要内容为UTF-8格式。
|
|
/// @return
|
|
static std::wstring u8_convert(const std::string& source);
|
|
};
|
|
}; // namespace ofen
|
|
|
|
#endif |