整理命名空间 (#1409)

* feat: remove using namespace mediakit in header files.

(cherry picked from commit d44aeb339a8a0e1f0455be82b21fe4b1b536299f)

* feat: remove using namespace mediakit in FFmpegSource.h

* feat: remove using namespace mediakit in RtpExt.h

* feat: remove using namespace mediakit in header files.

* feat: remove using namespace std in header files.

* feat: remove using namespace std in header files when zltoolkit remove std in header

* 补充命名空间

* 整理命名空间

* 整理命名空间2

* 修复macos ci

* 修复编译问题

* 修复编译问题2

* 修复编译问题3

Co-authored-by: Johnny <hellojinqiang@gmail.com>
Co-authored-by: Xiaofeng Wang <wasphin@gmail.com>
This commit is contained in:
夏楚
2022-02-02 20:34:50 +08:00
committed by GitHub
parent 80a0e27d8c
commit c72cf4cbcc
239 changed files with 1887 additions and 1766 deletions

View File

@@ -22,20 +22,20 @@ namespace mediakit {
class HttpResponseInvokerImp{
public:
typedef std::function<void(int code, const StrCaseMap &headerOut, const HttpBody::Ptr &body)> HttpResponseInvokerLambda0;
typedef std::function<void(int code, const StrCaseMap &headerOut, const string &body)> HttpResponseInvokerLambda1;
typedef std::function<void(int code, const StrCaseMap &headerOut, const std::string &body)> HttpResponseInvokerLambda1;
HttpResponseInvokerImp(){}
~HttpResponseInvokerImp(){}
template<typename C>
HttpResponseInvokerImp(const C &c):HttpResponseInvokerImp(typename function_traits<C>::stl_function_type(c)) {}
HttpResponseInvokerImp(const C &c):HttpResponseInvokerImp(typename toolkit::function_traits<C>::stl_function_type(c)) {}
HttpResponseInvokerImp(const HttpResponseInvokerLambda0 &lambda);
HttpResponseInvokerImp(const HttpResponseInvokerLambda1 &lambda);
void operator()(int code, const StrCaseMap &headerOut, const Buffer::Ptr &body) const;
void operator()(int code, const StrCaseMap &headerOut, const toolkit::Buffer::Ptr &body) const;
void operator()(int code, const StrCaseMap &headerOut, const HttpBody::Ptr &body) const;
void operator()(int code, const StrCaseMap &headerOut, const string &body) const;
void operator()(int code, const StrCaseMap &headerOut, const std::string &body) const;
void responseFile(const StrCaseMap &requestHeader,const StrCaseMap &responseHeader,const string &filePath, bool use_mmap = true) const;
void responseFile(const StrCaseMap &requestHeader,const StrCaseMap &responseHeader,const std::string &filePath, bool use_mmap = true) const;
operator bool();
private:
HttpResponseInvokerLambda0 _lambad;
@@ -46,7 +46,7 @@ private:
*/
class HttpFileManager {
public:
typedef function<void(int code, const string &content_type, const StrCaseMap &responseHeader, const HttpBody::Ptr &body)> invoker;
typedef std::function<void(int code, const std::string &content_type, const StrCaseMap &responseHeader, const HttpBody::Ptr &body)> invoker;
/**
* 访问文件或文件夹
@@ -54,14 +54,14 @@ public:
* @param parser http请求
* @param cb 回调对象
*/
static void onAccessPath(TcpSession &sender, Parser &parser, const invoker &cb);
static void onAccessPath(toolkit::TcpSession &sender, Parser &parser, const invoker &cb);
/**
* 获取mime值
* @param name 文件后缀
* @return mime值
*/
static const string &getContentType(const char *name);
static const std::string &getContentType(const char *name);
private:
HttpFileManager() = delete;
~HttpFileManager() = delete;