2018-01-15 19:07:47 +00:00
|
|
|
#include "StringUtils.h"
|
2018-06-16 02:31:41 +00:00
|
|
|
|
2016-07-14 05:22:09 +00:00
|
|
|
|
|
|
|
namespace detail
|
|
|
|
{
|
|
|
|
|
|
|
|
bool startsWith(const std::string & s, const char * prefix, size_t prefix_size)
|
|
|
|
{
|
2017-04-01 07:20:54 +00:00
|
|
|
return s.size() >= prefix_size && 0 == memcmp(s.data(), prefix, prefix_size);
|
2016-07-14 05:22:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool endsWith(const std::string & s, const char * suffix, size_t suffix_size)
|
|
|
|
{
|
2017-04-01 07:20:54 +00:00
|
|
|
return s.size() >= suffix_size && 0 == memcmp(s.data() + s.size() - suffix_size, suffix, suffix_size);
|
2016-07-14 05:22:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|