Skip to content

Commit dd7cbdf

Browse files
Yurii ZubrytskyiGerrit Code Review
Yurii Zubrytskyi
authored and
Gerrit Code Review
committed
Merge "[Emulib] Add a convenience ctor to StringView" into emu-master-dev
2 parents d3761a0 + 51012af commit dd7cbdf

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

android/base/StringView.h

+5-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,11 @@ class StringView {
7878
StringView(const std::string& str) :
7979
mString(str.c_str()), mSize(str.size()) {}
8080

81-
StringView(const char* str, size_t len) : mString(str ? str : ""), mSize(len) {}
81+
StringView(const char* str, size_t len)
82+
: mString(str ? str : ""), mSize(len) {}
83+
84+
StringView(const char* begin, const char* end)
85+
: mString(begin ? begin : ""), mSize(begin ? end - begin : 0) {}
8286

8387
const char* c_str() const { return mString; }
8488
const char* str() const { return mString; }

0 commit comments

Comments
 (0)