Overhaul cmake configuration, add console api, fix http code that caused issues with cgi-bin

This commit is contained in:
2026-05-27 03:02:16 -05:00
parent 266ef5f830
commit 8413c67ec6
177 changed files with 20088 additions and 17948 deletions

View File

@@ -5,57 +5,50 @@ using namespace Tesses::Framework;
using namespace Tesses::Framework::Filesystem;
using namespace Tesses::Framework::Streams;
int main(int argc, char** argv)
{
if(argc < 2)
{
printf("USAGE: %s <command> <args...>\n",argv[0]);
int main(int argc, char **argv) {
if (argc < 2) {
printf("USAGE: %s <command> <args...>\n", argv[0]);
return 1;
}
std::string root = "./root";
std::string mountDemi = "./demi";
std::string mountJoelSlashJim = "./joelslashjim";
std::shared_ptr<SubdirFilesystem> rootdir = std::make_shared<SubdirFilesystem>(LocalFS,root);
std::shared_ptr<SubdirFilesystem> rootdir =
std::make_shared<SubdirFilesystem>(LocalFS, root);
std::shared_ptr<SubdirFilesystem> mountDemidir = std::make_shared<SubdirFilesystem>(LocalFS,mountDemi);
std::shared_ptr<SubdirFilesystem> mountDemidir =
std::make_shared<SubdirFilesystem>(LocalFS, mountDemi);
std::shared_ptr<SubdirFilesystem> mountjohnslashjim =
std::make_shared<SubdirFilesystem>(LocalFS, mountJoelSlashJim);
std::shared_ptr<SubdirFilesystem> mountjohnslashjim = std::make_shared<SubdirFilesystem>(LocalFS,mountJoelSlashJim);
std::shared_ptr<MountableFilesystem> fs = std::make_shared<MountableFilesystem>(rootdir);
std::shared_ptr<MountableFilesystem> fs =
std::make_shared<MountableFilesystem>(rootdir);
fs->Mount(std::string("/demi"), mountDemidir);
fs->Mount(std::string("/joel/jim"), mountjohnslashjim);
std::string command = argv[1];
if(command == "ls")
{
if (command == "ls") {
std::string dir = "/";
if(argc > 2) dir = argv[2];
for(auto item : fs->EnumeratePaths(dir))
{
if (argc > 2)
dir = argv[2];
for (auto item : fs->EnumeratePaths(dir)) {
std::cout << item.GetFileName() << std::endl;
}
}
else if(command == "cat")
{
std::shared_ptr<FileStream> strm = std::make_shared<FileStream>(stdout, false,"wb",false);
for(int a = 2; a < argc; a++)
{
} else if (command == "cat") {
std::shared_ptr<FileStream> strm =
std::make_shared<FileStream>(stdout, false, "wb", false);
for (int a = 2; a < argc; a++) {
std::string path = argv[a];
auto f = fs->OpenFile(path,"rb");
if(f != nullptr)
{
auto f = fs->OpenFile(path, "rb");
if (f != nullptr) {
f->CopyTo(strm);
}
}
}
}