You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
SOP/sop-sdk/sdk-c++/common/tool.h

53 lines
1.1 KiB

#ifndef SDK_CXX_TOOL_H
#define SDK_CXX_TOOL_H
#include <string>
#include <map>
using namespace std;
namespace tool {
bool endWith(const string &str, const string &tail);
bool startWith(const string &str, const string &head);
string getTime();
int parse_url(char *url, char **serverstrp, int *portp, char **pathstrp);
std::string url_encode(const std::string &szToEncode);
std::string url_decode(const std::string &SRC);
unsigned char ToHex(unsigned char x);
unsigned char FromHex(unsigned char x);
string mapToJson(std::map<string, string> m);
string getFilename(string filepath);
string getFileContent(string filepath);
/**
*
* replace
*
* pszSrc
* pszOld
* pszNew
*
*
*
* #include <string>
* ssdwujianhua 2017/08/30
*/
std::string replace(const char *pszSrc, const char *pszOld, const char *pszNew);
}
#endif //SDK_CXX_TOOL_H