mirror of
https://git.tesses.org/tesses50/tessesframework.git
synced 2026-06-02 02:25:31 +00:00
Make streams and vfs and http shared_ptr
This commit is contained in:
@@ -124,7 +124,7 @@ namespace Tesses::Framework::Platform::Environment
|
||||
|
||||
|
||||
if(!realPath.relative) return realPath;
|
||||
if(LocalFS.FileExists(realPath)) return realPath.MakeAbsolute();
|
||||
if(LocalFS->FileExists(realPath)) return realPath.MakeAbsolute();
|
||||
const char* path = std::getenv("PATH");
|
||||
#if defined(_WIN32)
|
||||
const char* pathext = std::getenv("PATHEXT");
|
||||
@@ -134,13 +134,13 @@ namespace Tesses::Framework::Platform::Environment
|
||||
for(auto item : pathParts)
|
||||
{
|
||||
|
||||
auto newPath = LocalFS.SystemToVFSPath(item) / realPath;
|
||||
auto newPath = LocalFS->SystemToVFSPath(item) / realPath;
|
||||
for(auto item2 : pext)
|
||||
{
|
||||
auto newPathExt = newPath + item2;
|
||||
if(LocalFS.FileExists(newPathExt)) return newPathExt;
|
||||
if(LocalFS->FileExists(newPathExt)) return newPathExt;
|
||||
}
|
||||
if(LocalFS.FileExists(newPath)) return newPath;
|
||||
if(LocalFS->FileExists(newPath)) return newPath;
|
||||
}
|
||||
return realPath;
|
||||
#else
|
||||
@@ -148,8 +148,8 @@ namespace Tesses::Framework::Platform::Environment
|
||||
auto pathParts = HttpUtils::SplitString(path,":");
|
||||
for(auto item : pathParts)
|
||||
{
|
||||
auto newPath = LocalFS.SystemToVFSPath(item) / realPath;
|
||||
if(LocalFS.FileExists(newPath)) return newPath;
|
||||
auto newPath = LocalFS->SystemToVFSPath(item) / realPath;
|
||||
if(LocalFS->FileExists(newPath)) return newPath;
|
||||
}
|
||||
return realPath.MakeAbsolute();
|
||||
#endif
|
||||
|
||||
@@ -685,34 +685,34 @@ CreateProcessW(
|
||||
#endif
|
||||
}
|
||||
|
||||
Tesses::Framework::Streams::Stream* Process::GetStdinStream()
|
||||
std::shared_ptr<Tesses::Framework::Streams::Stream> Process::GetStdinStream()
|
||||
{
|
||||
if (this->exited) return nullptr;
|
||||
#if defined(GEKKO) || defined(__PS2__) || defined(__SWITCH__) || !defined(TESSESFRAMEWORK_ENABLE_PROCESS)
|
||||
|
||||
return nullptr;
|
||||
#else
|
||||
return new ProcessStream(this->hidden.GetField<ProcessData*>()->stdin_strm,true);
|
||||
return std::make_shared<ProcessStream>(this->hidden.GetField<ProcessData*>()->stdin_strm,true);
|
||||
#endif
|
||||
}
|
||||
Tesses::Framework::Streams::Stream* Process::GetStdoutStream()
|
||||
std::shared_ptr<Tesses::Framework::Streams::Stream> Process::GetStdoutStream()
|
||||
{
|
||||
|
||||
if (this->exited) return nullptr;
|
||||
#if defined(GEKKO) || defined(__PS2__) || defined(__SWITCH__) || !defined(TESSESFRAMEWORK_ENABLE_PROCESS)
|
||||
return nullptr;
|
||||
#else
|
||||
return new ProcessStream(this->hidden.GetField<ProcessData*>()->stdout_strm,false);
|
||||
return std::make_shared<ProcessStream>(this->hidden.GetField<ProcessData*>()->stdout_strm,false);
|
||||
#endif
|
||||
}
|
||||
Tesses::Framework::Streams::Stream* Process::GetStderrStream()
|
||||
std::shared_ptr<Tesses::Framework::Streams::Stream> Process::GetStderrStream()
|
||||
{
|
||||
|
||||
if (this->exited) return nullptr;
|
||||
#if defined(GEKKO) || defined(__PS2__) || defined(__SWITCH__) || !defined(TESSESFRAMEWORK_ENABLE_PROCESS)
|
||||
return nullptr;
|
||||
#else
|
||||
return new ProcessStream(this->hidden.GetField<ProcessData*>()->stderr_strm,false);
|
||||
return std::make_shared<ProcessStream>(this->hidden.GetField<ProcessData*>()->stderr_strm,false);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user