Ultralight  1.0.0
A fast, lightweight, HTML UI engine for native apps.
String.h
Go to the documentation of this file.
1 #pragma once
15 #include <Ultralight/Defines.h>
16 #include <Ultralight/String8.h>
17 #include <Ultralight/String16.h>
18 #include <Ultralight/String32.h>
19 
20 namespace ultralight {
21 
27 class UExport String {
28 public:
32  String();
33 
37  String(const char* str);
38 
42  String(const char* str, size_t len);
43 
47  String(const String8& str);
48 
52  String(const Char16* str, size_t len);
53 
57  String(const String16& str);
58 
62  String(const String32& str);
63 
67  String(const String& other);
68 
72  ~String();
73 
77  String& operator=(const String& other);
78 
82  String& operator+=(const String& other);
83 
87  inline friend String operator+(String lhs, const String& rhs) { lhs += rhs; return lhs; }
88 
92  String16& utf16() { return str_; }
93 
97  const String16& utf16() const { return str_; }
98 
102  String8 utf8() const;
103 
107  String32 utf32() const;
108 
112  bool empty() const { return utf16().empty(); }
113 
114 private:
115  String16 str_;
116 };
117 
118 
119 } // namespace ultralight
120 
A UTF-8 string container.
Definition: String8.h:23
const String16 & utf16() const
Get native UTF-16 string.
Definition: String.h:97
A UTF-32 string container.
Definition: String32.h:23
This is a set of common JavaScriptCore Helper functions to simplify sample code.
Definition: App.h:19
UTF-16 String container with conversions for UTF-8 and UTF-32.
Definition: String.h:27
The header for the String32 class.
friend String operator+(String lhs, const String &rhs)
Concatenation operator.
Definition: String.h:87
A UTF-16 string container.
Definition: String16.h:38
String16 & utf16()
Get native UTF-16 string.
Definition: String.h:92
bool empty() const
Check if string is empty or not.
Definition: String.h:112
The header for the String16 class.
The header for the String8 class.