Move things from crosslang to here

This commit is contained in:
2025-06-21 23:05:12 -05:00
parent 71a2c83e5a
commit 81f0d3be2e
41 changed files with 275029 additions and 96 deletions

View File

@ -0,0 +1,34 @@
#pragma once
#include "TessesFramework/Filesystem/VFSFix.hpp"
#include "TessesFramework/Filesystem/LocalFS.hpp"
#include <optional>
namespace Tesses::Framework::Platform::Environment
{
extern const char EnvPathSeperator;
namespace SpecialFolders {
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();
}
std::string GetPlatform();
Tesses::Framework::Filesystem::VFSPath GetRealExecutablePath(Tesses::Framework::Filesystem::VFSPath realPath);
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);
}

View File

@ -0,0 +1,39 @@
#include <vector>
#include <string>
#include "TessesFramework/Streams/Stream.hpp"
#include "TessesFramework/HiddenField.hpp"
namespace Tesses::Framework::Platform {
class Process {
private:
HiddenField hidden;
public:
std::string name;
std::vector<std::string> args;
std::vector<std::pair<std::string,std::string>> env;
bool includeThisEnv;
bool redirectStdIn=false;
bool redirectStdOut=false;
bool redirectStdErr=false;
//YOU ARE RESPONSABLE FOR FREEING THIS STREAM
Tesses::Framework::Streams::Stream* GetStdinStream(bool closeUnderlying=true);
//YOU ARE RESPONSABLE FOR FREEING THIS STREAM
Tesses::Framework::Streams::Stream* GetStdoutStream(bool closeUnderlying=true);
//YOU ARE RESPONSABLE FOR FREEING THIS STREAM
Tesses::Framework::Streams::Stream* GetStderrStream(bool closeUnderlying=true);
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);
bool Start();
void Kill(int signal);
int WaitForExit();
~Process();
};
}