35 lines
1.8 KiB
C++
35 lines
1.8 KiB
C++
#pragma once
|
|
|
|
namespace a8
|
|
{
|
|
|
|
std::string Bin2Hex(const std::string& binstr);
|
|
const char* GetValidStr1(const char* szLine, char **pp, int& iLen, const char* szIngore);
|
|
std::string GetValidStr(const std::string& strLine, std::string& strVal, const char* szIngore = " \t");
|
|
std::string Trim(const std::string& str);
|
|
std::string FormatEx(const char* fmt, std::initializer_list<a8::XValue>& args);
|
|
std::string Format(const char* fmt, std::initializer_list<a8::XValue> args);
|
|
std::string FormatEx2(const char* fmt, std::vector<a8::XValue>& args);
|
|
std::string Format2(const char* fmt, std::vector<a8::XValue> args);
|
|
void Split(const std::string& str, std::vector<std::string>& list, char separator=',');
|
|
unsigned char FromHex(unsigned char x);
|
|
unsigned char ToHex(unsigned char x);
|
|
std::string HexEncode(const std::string& str);
|
|
bool HexDecode(const std::string& str, std::string& outstr);
|
|
std::string UrlEncode(const std::string& str);
|
|
std::string UrlDecode(const std::string &sIn);
|
|
void ParserQueryStr(char* buf, std::string& url, std::string& querystr);
|
|
void ParserUrlQueryString(const char* querystring, std::map<std::string, a8::XValue>& query);
|
|
void ReplaceString(std::string& basestr, const std::string& srcstr, const std::string& deststr);
|
|
std::string HttpResponse(const std::string& response);
|
|
std::string HttpResponse(int code, const std::string& response);
|
|
std::string JsonEscapeString(const std::string& str);
|
|
std::string IntToFixedString(int val, int n);
|
|
bool ReadStringFromFile(const std::string& filename, std::string& data);
|
|
int SafeStrCmp(const char* s1, const char* s2);
|
|
size_t GetUtf8Length(const char *str);
|
|
std::string CopyString(const std::string& str);
|
|
std::string CopyString(const char* str);
|
|
|
|
}
|