std::string_view 的使用

This commit is contained in:
2026-06-29 09:40:55 +08:00
parent cd446b7ca8
commit 8daf67aa5d
52 changed files with 1420 additions and 1367 deletions
@@ -1,4 +1,5 @@
#pragma once
#include <string_view>
#include "Core/Base/global_include.h"
#include "Core/socket/ByteOrder.h"
@@ -10,7 +11,7 @@
class WebSocket_Manager {
public:
explicit WebSocket_Manager(std::string path);
explicit WebSocket_Manager(std::string_view path);
~WebSocket_Manager() = default;
void remove(const drogon::WebSocketConnectionPtr &conn);
void add(const drogon::WebSocketConnectionPtr &conn);
@@ -26,8 +27,8 @@ protected:
class Ws_Mgr : public Psc::Singleton<Ws_Mgr> {
public:
std::shared_ptr<WebSocket_Manager> register_ws(std::string path);
std::shared_ptr<WebSocket_Manager> get_ws(std::string path);
std::shared_ptr<WebSocket_Manager> register_ws(std::string_view path);
std::shared_ptr<WebSocket_Manager> get_ws(std::string_view path);
std::map<std::string, std::shared_ptr<WebSocket_Manager>> map;
};