acl/lib_acl_cpp/include/acl_cpp/http/http_utils.hpp

34 lines
854 B
C++
Raw Normal View History

2014-11-19 00:25:21 +08:00
#pragma once
2017-06-02 14:47:24 +08:00
#include "../acl_cpp_define.hpp"
2014-11-19 00:25:21 +08:00
namespace acl {
class ACL_CPP_API http_utils
{
public:
http_utils() {}
~http_utils() {}
/**
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> url <EFBFBD>л<EFBFBD><EFBFBD><EFBFBD> WEB <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ<EFBFBD><EFBFBD>domain:port
* @param url {const char*} HTTP url<EFBFBD><EFBFBD><EFBFBD>ǿ<EFBFBD>
* @param addr {char*} <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ<EFBFBD><EFBFBD>domain:port
* @param size {size_t} out <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>С
* @return {bool} <EFBFBD>Ƿ<EFBFBD><EFBFBD>ɹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
*/
static bool get_addr(const char* url, char* addr, size_t size);
/**
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> url <EFBFBD>л<EFBFBD><EFBFBD><EFBFBD> WEB <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> IP <EFBFBD><EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD>˿ں<EFBFBD>
* @param url {const char*} HTTP url<EFBFBD><EFBFBD><EFBFBD>ǿ<EFBFBD>
* @param domain {char*} <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* @param size {size_t} domain <EFBFBD>ڴ<EFBFBD><EFBFBD><EFBFBD>С
* @param port {unsigned short*} <EFBFBD><EFBFBD>˿ںŴ<EFBFBD>С
* @return {bool} <EFBFBD>Ƿ<EFBFBD><EFBFBD>ɹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
*/
static bool get_addr(const char* url, char* domain, size_t size,
unsigned short* port);
};
} // namespace acl