Merge "Implement String8|16::empty and String16::length" into main
This commit is contained in:
commit
9578c774a9
|
@ -60,6 +60,10 @@ private:
|
||||||
static inline std::string std_string(const String16& str);
|
static inline std::string std_string(const String16& str);
|
||||||
public:
|
public:
|
||||||
size_t size() const;
|
size_t size() const;
|
||||||
|
inline bool empty() const;
|
||||||
|
|
||||||
|
inline size_t length() const;
|
||||||
|
|
||||||
void setTo(const String16& other);
|
void setTo(const String16& other);
|
||||||
status_t setTo(const char16_t* other);
|
status_t setTo(const char16_t* other);
|
||||||
status_t setTo(const char16_t* other, size_t len);
|
status_t setTo(const char16_t* other, size_t len);
|
||||||
|
@ -250,6 +254,16 @@ inline std::string String16::std_string(const String16& str)
|
||||||
return std::string(String8(str).c_str());
|
return std::string(String8(str).c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline bool String16::empty() const
|
||||||
|
{
|
||||||
|
return length() == 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline size_t String16::length() const
|
||||||
|
{
|
||||||
|
return size();
|
||||||
|
}
|
||||||
|
|
||||||
inline String16& String16::operator=(const String16& other)
|
inline String16& String16::operator=(const String16& other)
|
||||||
{
|
{
|
||||||
setTo(other);
|
setTo(other);
|
||||||
|
|
|
@ -64,6 +64,7 @@ public:
|
||||||
|
|
||||||
inline size_t size() const;
|
inline size_t size() const;
|
||||||
inline size_t bytes() const;
|
inline size_t bytes() const;
|
||||||
|
inline bool empty() const;
|
||||||
inline bool isEmpty() const;
|
inline bool isEmpty() const;
|
||||||
|
|
||||||
size_t length() const;
|
size_t length() const;
|
||||||
|
@ -248,6 +249,11 @@ inline size_t String8::size() const
|
||||||
return length();
|
return length();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline bool String8::empty() const
|
||||||
|
{
|
||||||
|
return length() == 0;
|
||||||
|
}
|
||||||
|
|
||||||
inline bool String8::isEmpty() const
|
inline bool String8::isEmpty() const
|
||||||
{
|
{
|
||||||
return length() == 0;
|
return length() == 0;
|
||||||
|
|
Loading…
Reference in New Issue