rgw: add str_startswith()

useful util

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
This commit is contained in:
Yehuda Sadeh 2013-06-25 11:03:12 -07:00
parent 8db289f2e2
commit 422bb6d0ac

View File

@ -1105,6 +1105,11 @@ inline ostream& operator<<(ostream& out, const rgw_obj &o) {
return out << o.bucket.name << ":" << o.object;
}
static inline bool str_startswith(const string& str, const string& prefix)
{
return (str.compare(0, prefix.size(), prefix) == 0);
}
static inline void buf_to_hex(const unsigned char *buf, int len, char *str)
{
int i;