From 11dcb55027ef4cc12b69759efb9587924f7353f4 Mon Sep 17 00:00:00 2001 From: Gabriele Contini <contini.mailing@gmail.com> Date: 周六, 01 2月 2020 03:25:18 +0800 Subject: [PATCH] add google verification --- src/library/base/StringUtils.h | 28 +++++++++++++++++++++++----- 1 files changed, 23 insertions(+), 5 deletions(-) diff --git a/src/library/base/StringUtils.h b/src/library/base/StringUtils.h index 9bfe3f8..02a679d 100644 --- a/src/library/base/StringUtils.h +++ b/src/library/base/StringUtils.h @@ -2,15 +2,16 @@ * StringUtils.h * * Created on: Apr 8, 2014 - * Author: devel + * */ #ifndef STRINGUTILS_H_ #define STRINGUTILS_H_ + #include <string> +#include <vector> namespace license { -using namespace std; /** * Eliminate whitespace from both sides of a string and returns a copy @@ -18,10 +19,27 @@ * @param string_to_trim * @return the trimmed string */ -string trim_copy(const string& string_to_trim); +std::string trim_copy(const std::string& string_to_trim); -string toupper_copy(const string& lowercase); +std::string toupper_copy(const std::string& lowercase); -} /* namespace license */ +time_t seconds_from_epoch(const std::string& timeString); + +/** + * Split a string on a given character + */ +const std::vector<std::string> split_string(const std::string& stringToBeSplit, const char splitchar); + +// strnln_s is not well supported and strlen is marked unsafe.. +size_t mstrnlen_s(const char* szptr, size_t maxsize); + +typedef enum { + INI, BASE64, UNKNOWN +} FILE_FORMAT; + +FILE_FORMAT identify_format(const std::string& license); +} + +/* namespace license */ #endif /* STRINGUTILS_H_ */ -- Gitblit v1.9.1