10#include "webcface/common/webcface-config.h"
15struct SharedStringData;
70 std::shared_ptr<internal::SharedStringData> data;
75 explicit SharedString(std::shared_ptr<internal::SharedStringData> &&data);
80 encode(std::wstring_view ws, std::string_view s = std::string_view());
82 const std::string &u8String()
const;
83 std::string_view u8StringView()
const;
84 const std::string &decode()
const;
85 const std::wstring &decodeW()
const;
87 static const std::string &emptyStr();
88 static const std::wstring &emptyStrW();
91 bool startsWith(std::string_view str)
const;
92 bool startsWith(
char str)
const;
101 struct Hash : std::hash<std::string> {
104 return this->std::hash<std::string>::operator()(ss.
u8String());
116namespace [[deprecated(
"symbols in webcface::encoding namespace are "
117 "now directly in webcface namespace")]] encoding {
120inline std::wstring
toWide(std::string_view name_ref) {
123inline std::string
toNarrow(std::wstring_view name) {
u8stringとstringとwstringをshared_ptrで持ち共有する
Definition encoding.h:69
const std::string & u8String() const
Definition encoding.cc:104
SharedString()
Definition encoding.h:73
SharedString(std::nullptr_t)
Definition encoding.h:74
webcface::StrMap2< T > StrMap2
Definition encoding.h:132
webcface::StrSet2 StrSet2
Definition encoding.h:134
webcface::StrMap1< T > StrMap1
Definition encoding.h:130
webcface::StrSet1 StrSet1
Definition encoding.h:133
std::string toNarrow(std::wstring_view name_ref)
wstringをstringに変換する
Definition encoding.cc:126
void usingUTF8(bool flag)
webcfaceが使用するエンコーディングを設定する
Definition encoding.cc:30
bool operator==(const T &other, const InputRef &ref)
Definition text.h:566
std::wstring toWide(std::string_view name_ref)
stringをwstringに変換する
Definition encoding.cc:180
std::map< SharedString, T > StrMap1
Definition encoding.h:110
StrMap1< StrSet1 > StrSet2
Definition encoding.h:114
StrMap1< StrMap1< T > > StrMap2
Definition encoding.h:112
std::set< SharedString > StrSet1
Definition encoding.h:113
bool usingUTF8()
webcfaceが使用するエンコーディングを取得する
Definition encoding.cc:31
bool operator!=(const T &other, const InputRef &ref)
Definition text.h:572
Definition encoding.h:101
auto operator()(const SharedString &ss) const
Definition encoding.h:103
#define WEBCFACE_DLL
Definition webcface-config.h:60
#define WEBCFACE_CALL
Definition webcface-config.h:97
#define WEBCFACE_NS_END
Definition webcface-config.h:104
#define WEBCFACE_NS_BEGIN
Definition webcface-config.h:103