8#include "webcface/common/webcface-config.h"
13struct SharedStringData;
68 std::shared_ptr<internal::SharedStringData> data;
73 explicit SharedString(std::shared_ptr<internal::SharedStringData> &&data);
78 encode(std::wstring_view ws, std::string_view s = std::string_view());
80 const std::string &u8String()
const;
81 std::string_view u8StringView()
const;
82 const std::string &decode()
const;
83 const std::wstring &decodeW()
const;
85 static const std::string &emptyStr();
86 static const std::wstring &emptyStrW();
89 bool startsWith(std::string_view str)
const;
90 bool startsWith(
char str)
const;
92 std::size_t len = std::string::npos)
const;
93 std::size_t find(
char c, std::size_t pos = 0)
const;
102 struct Hash : std::hash<std::string> {
105 return this->std::hash<std::string>::operator()(ss.
u8String());
110namespace [[deprecated(
"symbols in webcface::encoding namespace are "
111 "now directly in webcface namespace")]] encoding {
114inline std::wstring
toWide(std::string_view name_ref) {
117inline std::string
toNarrow(std::wstring_view name) {
u8stringとstringとwstringをshared_ptrで持ち共有する
Definition encoding.h:67
const std::string & u8String() const
Definition encoding.cc:104
SharedString()
Definition encoding.h:71
SharedString(std::nullptr_t)
Definition encoding.h:72
std::string toNarrow(std::wstring_view name_ref)
wstringをstringに変換する
Definition encoding.cc:140
void usingUTF8(bool flag)
webcfaceが使用するエンコーディングを設定する
Definition encoding.cc:30
bool operator==(const T &other, const InputRef &ref)
Definition text.h:574
std::wstring toWide(std::string_view name_ref)
stringをwstringに変換する
Definition encoding.cc:194
bool usingUTF8()
webcfaceが使用するエンコーディングを取得する
Definition encoding.cc:31
bool operator!=(const T &other, const InputRef &ref)
Definition text.h:580
Definition encoding.h:102
auto operator()(const SharedString &ss) const
Definition encoding.h:104
#define WEBCFACE_DLL
Definition webcface-config.h:69
#define WEBCFACE_CALL
Definition webcface-config.h:106
#define WEBCFACE_NS_END
Definition webcface-config.h:118
#define WEBCFACE_NS_BEGIN
Definition webcface-config.h:117