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

@@ -1,51 +1,69 @@
/*
TessesFramework a library to make C++ easier for me, used in CrossLang:
https://git.tesses.org/tesses50/crosslang Copyright (C) 2026 Mike Nolan
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#pragma once
#include "TessesFramework/Filesystem/VFSFix.hpp"
#include "TessesFramework/Filesystem/LocalFS.hpp"
#include "TessesFramework/Filesystem/VFSFix.hpp"
#include <optional>
namespace Tesses::Framework::Platform::Environment
{
extern const char EnvPathSeperator;
namespace Tesses::Framework::Platform::Environment {
extern const char EnvPathSeperator;
struct PortableAppConfig {
std::optional<Tesses::Framework::Filesystem::VFSPath> desktop;
std::optional<Tesses::Framework::Filesystem::VFSPath> documents;
std::optional<Tesses::Framework::Filesystem::VFSPath> music;
std::optional<Tesses::Framework::Filesystem::VFSPath> pictures;
std::optional<Tesses::Framework::Filesystem::VFSPath> videos;
std::optional<Tesses::Framework::Filesystem::VFSPath> downloads;
std::optional<Tesses::Framework::Filesystem::VFSPath> user;
std::optional<Tesses::Framework::Filesystem::VFSPath> config;
std::optional<Tesses::Framework::Filesystem::VFSPath> state;
std::optional<Tesses::Framework::Filesystem::VFSPath> data;
std::optional<Tesses::Framework::Filesystem::VFSPath> cache;
std::optional<Tesses::Framework::Filesystem::VFSPath> temp;
};
struct PortableAppConfig {
extern PortableAppConfig portable_config;
std::optional<Tesses::Framework::Filesystem::VFSPath> desktop;
std::optional<Tesses::Framework::Filesystem::VFSPath> documents;
std::optional<Tesses::Framework::Filesystem::VFSPath> music;
std::optional<Tesses::Framework::Filesystem::VFSPath> pictures;
std::optional<Tesses::Framework::Filesystem::VFSPath> videos;
std::optional<Tesses::Framework::Filesystem::VFSPath> downloads;
std::optional<Tesses::Framework::Filesystem::VFSPath> user;
std::optional<Tesses::Framework::Filesystem::VFSPath> config;
std::optional<Tesses::Framework::Filesystem::VFSPath> state;
std::optional<Tesses::Framework::Filesystem::VFSPath> data;
std::optional<Tesses::Framework::Filesystem::VFSPath> cache;
std::optional<Tesses::Framework::Filesystem::VFSPath> temp;
};
namespace SpecialFolders {
Tesses::Framework::Filesystem::VFSPath GetTemp();
Tesses::Framework::Filesystem::VFSPath GetHomeFolder();
Tesses::Framework::Filesystem::VFSPath GetDownloads();
Tesses::Framework::Filesystem::VFSPath GetMusic();
Tesses::Framework::Filesystem::VFSPath GetPictures();
Tesses::Framework::Filesystem::VFSPath GetVideos();
Tesses::Framework::Filesystem::VFSPath GetDocuments();
Tesses::Framework::Filesystem::VFSPath GetConfig();
Tesses::Framework::Filesystem::VFSPath GetDesktop();
Tesses::Framework::Filesystem::VFSPath GetState();
Tesses::Framework::Filesystem::VFSPath GetCache();
Tesses::Framework::Filesystem::VFSPath GetData();
}
extern PortableAppConfig portable_config;
std::string GetPlatform();
namespace SpecialFolders {
Tesses::Framework::Filesystem::VFSPath GetTemp();
Tesses::Framework::Filesystem::VFSPath GetHomeFolder();
Tesses::Framework::Filesystem::VFSPath GetDownloads();
Tesses::Framework::Filesystem::VFSPath GetMusic();
Tesses::Framework::Filesystem::VFSPath GetPictures();
Tesses::Framework::Filesystem::VFSPath GetVideos();
Tesses::Framework::Filesystem::VFSPath GetDocuments();
Tesses::Framework::Filesystem::VFSPath GetConfig();
Tesses::Framework::Filesystem::VFSPath GetDesktop();
Tesses::Framework::Filesystem::VFSPath GetState();
Tesses::Framework::Filesystem::VFSPath GetCache();
Tesses::Framework::Filesystem::VFSPath GetData();
} // namespace SpecialFolders
Tesses::Framework::Filesystem::VFSPath GetRealExecutablePath(Tesses::Framework::Filesystem::VFSPath realPath);
std::string GetPlatform();
std::optional<std::string> GetVariable(std::string name);
void SetVariable(std::string name, std::optional<std::string> var);
Tesses::Framework::Filesystem::VFSPath
GetRealExecutablePath(Tesses::Framework::Filesystem::VFSPath realPath);
void GetEnvironmentVariables(std::vector<std::pair<std::string,std::string>>& env);
}
std::optional<std::string> GetVariable(std::string name);
void SetVariable(std::string name, std::optional<std::string> var);
void GetEnvironmentVariables(
std::vector<std::pair<std::string, std::string>> &env);
} // namespace Tesses::Framework::Platform::Environment

View File

@@ -1,50 +1,71 @@
/*
TessesFramework a library to make C++ easier for me, used in CrossLang:
https://git.tesses.org/tesses50/crosslang Copyright (C) 2026 Mike Nolan
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#pragma once
#include <vector>
#include <string>
#include "TessesFramework/Streams/Stream.hpp"
#include "TessesFramework/HiddenField.hpp"
#include "TessesFramework/Streams/Stream.hpp"
#include <signal.h>
#include <string>
#include <vector>
#if defined(_WIN32)
#define SIGKILL 9
#endif
namespace Tesses::Framework::Platform {
class Process {
private:
HiddenField hidden;
bool exited = false;
int exitCode=0;
public:
std::string name;
std::vector<std::string> args;
std::string workingDirectory;
std::vector<std::pair<std::string,std::string>> env;
bool includeThisEnv;
bool redirectStdIn=false;
bool redirectStdOut=false;
bool redirectStdErr=false;
bool HasExited();
private:
HiddenField hidden;
bool exited = false;
int exitCode = 0;
public:
std::string name;
std::vector<std::string> args;
std::string workingDirectory;
std::vector<std::pair<std::string, std::string>> env;
bool includeThisEnv;
bool redirectStdIn = false;
bool redirectStdOut = false;
bool redirectStdErr = false;
bool HasExited();
void CloseStdInNow();
std::shared_ptr<Tesses::Framework::Streams::Stream> GetStdinStream();
void CloseStdInNow();
std::shared_ptr<Tesses::Framework::Streams::Stream> GetStdoutStream();
std::shared_ptr<Tesses::Framework::Streams::Stream> GetStderrStream();
std::shared_ptr<Tesses::Framework::Streams::Stream> GetStdinStream();
Process();
Process(std::string name, std::vector<std::string> args,bool includeThisEnv=true);
Process(std::string name, std::vector<std::string> args, std::vector<std::pair<std::string,std::string>> env,bool includeThisEnv=false);
Process(std::string name, std::vector<std::string> args, std::vector<std::string> env,bool includeThisEnv=false);
std::shared_ptr<Tesses::Framework::Streams::Stream> GetStdoutStream();
std::shared_ptr<Tesses::Framework::Streams::Stream> GetStderrStream();
bool Start();
Process();
Process(std::string name, std::vector<std::string> args,
bool includeThisEnv = true);
Process(std::string name, std::vector<std::string> args,
std::vector<std::pair<std::string, std::string>> env,
bool includeThisEnv = false);
Process(std::string name, std::vector<std::string> args,
std::vector<std::string> env, bool includeThisEnv = false);
void Kill(int signal);
bool Start();
int WaitForExit();
void Kill(int signal);
~Process();
int WaitForExit();
~Process();
};
}
} // namespace Tesses::Framework::Platform