summaryrefslogtreecommitdiffstats
path: root/src/string_piece.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/string_piece.h')
-rw-r--r--src/string_piece.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/string_piece.h b/src/string_piece.h
index 353b24e..031bda4 100644
--- a/src/string_piece.h
+++ b/src/string_piece.h
@@ -56,6 +56,14 @@ struct StringPiece {
return str_ + len_;
}
+ char operator[](size_t pos) const {
+ return str_[pos];
+ }
+
+ size_t size() const {
+ return len_;
+ }
+
const char* str_;
size_t len_;
};