mirror of
https://gitee.com/durcframework/SOP.git
synced 2025-08-11 21:57:56 +08:00
- 新增ISV用户平台
- 新增门户网站(portal) - 新增`C++`,`Rust`语言SDK
This commit is contained in:
52
sop-sdk/sdk-c++/common/tool.h
Normal file
52
sop-sdk/sdk-c++/common/tool.h
Normal file
@@ -0,0 +1,52 @@
|
||||
|
||||
|
||||
#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
|
Reference in New Issue
Block a user