Make streams and vfs and http shared_ptr

This commit is contained in:
2025-09-29 02:22:27 -05:00
parent 71d0e36a5c
commit d785508571
61 changed files with 541 additions and 951 deletions

View File

@@ -7,17 +7,14 @@ namespace Tesses::Framework::Http
{
class MountableServer : public IHttpServer
{
IHttpServer* root;
bool owns;
std::vector<std::pair<std::string,std::pair<bool,IHttpServer*>>> servers;
std::shared_ptr<IHttpServer> root;
std::vector<std::pair<std::string,std::shared_ptr<IHttpServer>>> servers;
std::string Subpath(Filesystem::VFSPath fullPath, Filesystem::VFSPath offsetPath);
bool StartsWith(Filesystem::VFSPath fullPath, Filesystem::VFSPath offsetPath);
public:
MountableServer();
MountableServer(IHttpServer* root, bool owns);
MountableServer(IHttpServer& root);
void Mount(std::string path, IHttpServer* server, bool owns);
void Mount(std::string path, IHttpServer& server);
MountableServer(std::shared_ptr<IHttpServer> root);
void Mount(std::string path, std::shared_ptr<IHttpServer> server);
void Unmount(std::string path);
bool Handle(ServerContext& ctx);
~MountableServer();