MCPcopy Create free account
hub / github.com/Pagghiu/SaneCppLibraries / init

Method init

Libraries/Http/HttpAsyncFileServer.cpp:50–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48};
49
50Result HttpAsyncFileServer::init(ThreadPool& pool, AsyncEventLoop& loop, StringSpan directoryToServe)
51{
52 SC_TRY_MSG(eventLoop == nullptr, "HttpAsyncFileServer::init - already inited")
53 eventLoop = &loop;
54 threadPool = &pool;
55
56 SC_TRY_MSG(FileSystem().existsAndIsDirectory(directoryToServe), "HttpAsyncFileServer::init invalid directory");
57 SC_TRY(directory.assign(directoryToServe));
58 return Result(true);
59}
60
61Result HttpAsyncFileServer::close()
62{

Callers 3

handleRequestMethod · 0.45
getFileMethod · 0.45
putFileMethod · 0.45

Calls 3

existsAndIsDirectoryMethod · 0.80
ResultClass · 0.50
assignMethod · 0.45

Tested by

no test coverage detected