| 217 | }; |
| 218 | |
| 219 | struct CefStr : CefStrBase |
| 220 | { |
| 221 | CefStr(); |
| 222 | ~CefStr(); |
| 223 | |
| 224 | CefStr(const char *s, size_t len); |
| 225 | CefStr(const char16_t *s, size_t len); |
| 226 | CefStr(const std::string &s); |
| 227 | CefStr(const std::u16string &s); |
| 228 | |
| 229 | /// |
| 230 | /// Forward the underlying string value. |
| 231 | /// The current dtor() is set to null. |
| 232 | /// |
| 233 | cef_string_t forward(); |
| 234 | |
| 235 | /// |
| 236 | /// Get reference to base string from const pointer. |
| 237 | /// |
| 238 | static const CefStrBase &borrow(const cef_string_t *s); |
| 239 | |
| 240 | /// |
| 241 | /// Convert fs path to string. |
| 242 | /// |
| 243 | static CefStr from_path(const path &path); |
| 244 | |
| 245 | /// |
| 246 | /// Wrap u16string in cef_string_t on stack. |
| 247 | /// |
| 248 | static cef_string_t wrap(const std::u16string &utf16) { |
| 249 | return cef_string_t{ |
| 250 | (char16 *)utf16.data(), |
| 251 | utf16.length(), |
| 252 | nullptr |
| 253 | }; |
| 254 | } |
| 255 | }; |
| 256 | |
| 257 | /// |
| 258 | /// A wrapper of `cef_string_userfree_t` to auto-free. |
no outgoing calls
no test coverage detected