Unified code style (#2137)

This commit is contained in:
老衲不出家
2022-12-02 14:43:06 +08:00
committed by GitHub
parent a12b7c8021
commit f05a9501fa
62 changed files with 166 additions and 149 deletions

View File

@@ -111,7 +111,7 @@ private:
class HlsPlayerImp : public PlayerImp<HlsPlayer, PlayerBase>, private TrackListener {
public:
typedef std::shared_ptr<HlsPlayerImp> Ptr;
using Ptr = std::shared_ptr<HlsPlayerImp>;
HlsPlayerImp(const toolkit::EventPoller::Ptr &poller = nullptr);
~HlsPlayerImp() override = default;

View File

@@ -183,7 +183,7 @@ int HttpFileBody::sendFile(int fd) {
class BufferMmap : public Buffer {
public:
typedef std::shared_ptr<BufferMmap> Ptr;
using Ptr = std::shared_ptr<BufferMmap>;
BufferMmap(const std::shared_ptr<char> &map_addr, size_t offset, size_t size) {
_map_addr = map_addr;
_data = map_addr.get() + offset;

View File

@@ -29,7 +29,7 @@ namespace mediakit {
*/
class HttpBody : public std::enable_shared_from_this<HttpBody>{
public:
typedef std::shared_ptr<HttpBody> Ptr;
using Ptr = std::shared_ptr<HttpBody>;
HttpBody(){}
virtual ~HttpBody(){}
@@ -73,7 +73,7 @@ public:
*/
class HttpStringBody : public HttpBody{
public:
typedef std::shared_ptr<HttpStringBody> Ptr;
using Ptr = std::shared_ptr<HttpStringBody>;
HttpStringBody(std::string str);
~HttpStringBody() override = default;
@@ -90,7 +90,7 @@ private:
*/
class HttpBufferBody : public HttpBody{
public:
typedef std::shared_ptr<HttpBufferBody> Ptr;
using Ptr = std::shared_ptr<HttpBufferBody>;
HttpBufferBody(toolkit::Buffer::Ptr buffer);
~HttpBufferBody() override = default;
@@ -106,7 +106,7 @@ private:
*/
class HttpFileBody : public HttpBody {
public:
typedef std::shared_ptr<HttpFileBody> Ptr;
using Ptr = std::shared_ptr<HttpFileBody>;
/**
* 构造函数
@@ -142,7 +142,7 @@ class HttpArgs;
*/
class HttpMultiFormBody : public HttpBody {
public:
typedef std::shared_ptr<HttpMultiFormBody> Ptr;
using Ptr = std::shared_ptr<HttpMultiFormBody>;
/**
* 构造函数

View File

@@ -25,7 +25,7 @@ namespace mediakit {
*/
class HttpCookie {
public:
typedef std::shared_ptr<HttpCookie> Ptr;
using Ptr = std::shared_ptr<HttpCookie>;
friend class HttpCookieStorage;
HttpCookie(){}
~HttpCookie(){}

View File

@@ -198,7 +198,7 @@ static bool emitHlsPlayed(const Parser &parser, const MediaInfo &media_info, con
class SockInfoImp : public SockInfo{
public:
typedef std::shared_ptr<SockInfoImp> Ptr;
using Ptr = std::shared_ptr<SockInfoImp>;
SockInfoImp() = default;
~SockInfoImp() override = default;

View File

@@ -439,7 +439,7 @@ static string dateStr() {
class AsyncSenderData {
public:
friend class AsyncSender;
typedef std::shared_ptr<AsyncSenderData> Ptr;
using Ptr = std::shared_ptr<AsyncSenderData>;
AsyncSenderData(const Session::Ptr &session, const HttpBody::Ptr &body, bool close_when_complete) {
_session = dynamic_pointer_cast<HttpSession>(session);
_body = body;
@@ -455,7 +455,7 @@ private:
class AsyncSender {
public:
typedef std::shared_ptr<AsyncSender> Ptr;
using Ptr = std::shared_ptr<AsyncSender>;
static bool onSocketFlushed(const AsyncSenderData::Ptr &data) {
if (data->_read_complete) {
if (data->_close_when_complete) {

View File

@@ -70,7 +70,7 @@ private:
template <typename ClientType,WebSocketHeader::Type DataType = WebSocketHeader::TEXT>
class HttpWsClient : public HttpClientImp , public WebSocketSplitter{
public:
typedef std::shared_ptr<HttpWsClient> Ptr;
using Ptr = std::shared_ptr<HttpWsClient>;
HttpWsClient(const std::shared_ptr<ClientTypeImp<ClientType, DataType> > &delegate) : _weak_delegate(delegate),
_delegate(*delegate) {
@@ -361,7 +361,7 @@ private:
template <typename ClientType,WebSocketHeader::Type DataType = WebSocketHeader::TEXT,bool useWSS = false >
class WebSocketClient : public ClientTypeImp<ClientType,DataType>{
public:
typedef std::shared_ptr<WebSocketClient> Ptr;
using Ptr = std::shared_ptr<WebSocketClient>;
template<typename ...ArgsType>
WebSocketClient(ArgsType &&...args) : ClientTypeImp<ClientType,DataType>(std::forward<ArgsType>(args)...){

View File

@@ -24,7 +24,7 @@ namespace mediakit {
class WebSocketHeader {
public:
typedef std::shared_ptr<WebSocketHeader> Ptr;
using Ptr = std::shared_ptr<WebSocketHeader>;
typedef enum {
CONTINUATION = 0x0,
TEXT = 0x1,
@@ -65,7 +65,7 @@ public:
//websocket协议收到的字符串类型缓存用户协议层获取该数据传输的方式
class WebSocketBuffer : public toolkit::BufferString {
public:
typedef std::shared_ptr<WebSocketBuffer> Ptr;
using Ptr = std::shared_ptr<WebSocketBuffer>;
template<typename ...ARGS>
WebSocketBuffer(WebSocketHeader::Type headType, bool fin, ARGS &&...args)