Finally change cmake file to be like TessesFramework

This commit is contained in:
2024-12-31 08:20:56 -06:00
parent 7aae9fadba
commit 49be0f8528
9 changed files with 190 additions and 40 deletions

View File

@ -54,6 +54,23 @@ namespace Tesses::CrossLang
}
return nullptr;
}
static TObject FS_MakeFull(GCList& ls, std::vector<TObject> args)
{
Tesses::Framework::Filesystem::VFSPath path;
if(GetArgumentAsPath(args,0,path))
{
if(path.relative)
{
Tesses::Framework::Filesystem::LocalFilesystem lfs;
auto curDir = std::filesystem::current_path();
auto myPath = lfs.SystemToVFSPath(curDir.string()) / path;
myPath = myPath.CollapseRelativeParents();
return myPath;
}
return path.CollapseRelativeParents();
}
return nullptr;
}
void TStd::RegisterIO(GC* gc,TRootEnvironment* env,bool enableLocalFilesystem)
{
@ -68,6 +85,7 @@ namespace Tesses::CrossLang
TVFSHeapObject* vfs = TVFSHeapObject::Create(ls, new Tesses::Framework::Filesystem::LocalFilesystem());
dict->SetValue("Local", vfs);
dict->DeclareFunction(gc, "MakeFull", "Make absolute path from relative path",{"path"},FS_MakeFull);
}
dict->DeclareFunction(gc, "MountableFilesystem","Create a mountable filesystem",{"root"}, FS_MountableFilesystem);