don't use boost string algorithm

This commit is contained in:
Chunting Gu
2020-02-18 09:49:45 +08:00
parent 7e7ab1c1e8
commit 1e3c2b2604
25 changed files with 336 additions and 308 deletions
-11
View File
@@ -15,9 +15,6 @@ class path;
namespace webcc {
namespace utility {
// Get a randomly generated UUID.
std::string RandomUuid();
// Get default user agent for HTTP headers.
const std::string& UserAgent();
@@ -26,14 +23,6 @@ const std::string& UserAgent();
// See: https://tools.ietf.org/html/rfc7231#section-7.1.1.2
std::string GetTimestamp();
// Split a key-value string.
// E.g., split "Connection: Keep-Alive".
bool SplitKV(const std::string& str, char delimiter, std::string* key,
std::string* value, bool trim = true);
// Convert string to size_t.
bool ToSize(const std::string& str, int base, std::size_t* size);
// Tell the size in bytes of the given file.
// Return kInvalidLength (-1) on failure.
std::size_t TellSize(const std::filesystem::path& path);