mirror of
https://onedev.site.tesses.net/crosslang
synced 2026-04-18 08:57:04 +00:00
Add wii build
This commit is contained in:
@@ -501,6 +501,67 @@ namespace Tesses::CrossLang {
|
||||
|
||||
}
|
||||
}
|
||||
void TObjectVFS::Chmod(Tesses::Framework::Filesystem::VFSPath path, uint32_t mode)
|
||||
{
|
||||
TDictionary* dict;
|
||||
|
||||
if(GetObjectHeap(this->obj, dict))
|
||||
{
|
||||
GCList ls(this->ls->GetGC());
|
||||
dict->CallMethod(ls, "Chmod",{path,(int64_t)mode});
|
||||
|
||||
}
|
||||
}
|
||||
bool TObjectVFS::StatVFS(Tesses::Framework::Filesystem::VFSPath path, Tesses::Framework::Filesystem::StatVFSData& data)
|
||||
{
|
||||
TDictionary* dict;
|
||||
|
||||
if(GetObjectHeap(this->obj, dict))
|
||||
{
|
||||
GCList ls(this->ls->GetGC());
|
||||
auto res = dict->CallMethod(ls, "StatVFS",{path});
|
||||
int64_t _num;
|
||||
TDictionary* _dict;
|
||||
TObject _o;
|
||||
if(GetObjectHeap(res,_dict))
|
||||
{
|
||||
this->ls->GetGC()->BarrierBegin();
|
||||
_o = dict->GetValue("BlockSize");
|
||||
if(GetObject(_o,_num)) data.BlockSize = (uint64_t)_num;
|
||||
|
||||
_o = dict->GetValue("FragmentSize");
|
||||
if(GetObject(_o,_num)) data.FragmentSize = (uint64_t)_num;
|
||||
_o = dict->GetValue("Blocks");
|
||||
if(GetObject(_o,_num)) data.Blocks = (uint64_t)_num;
|
||||
_o = dict->GetValue("BlocksFree");
|
||||
if(GetObject(_o,_num)) data.BlocksFree = (uint64_t)_num;
|
||||
_o = dict->GetValue("BlocksAvailable");
|
||||
if(GetObject(_o,_num)) data.BlocksAvailable = (uint64_t)_num;
|
||||
_o = dict->GetValue("TotalInodes");
|
||||
if(GetObject(_o,_num)) data.TotalInodes = (uint64_t)_num;
|
||||
_o = dict->GetValue("FreeInodes");
|
||||
if(GetObject(_o,_num)) data.FreeInodes = (uint64_t)_num;
|
||||
_o = dict->GetValue("AvailableInodes");
|
||||
if(GetObject(_o,_num)) data.AvailableInodes = (uint64_t)_num;
|
||||
_o = dict->GetValue("Id");
|
||||
if(GetObject(_o,_num)) data.Id = (uint64_t)_num;
|
||||
_o = dict->GetValue("Flags");
|
||||
if(GetObject(_o,_num)) data.Flags = (uint64_t)_num;
|
||||
_o = dict->GetValue("MaxNameLength");
|
||||
if(GetObject(_o,_num)) data.MaxNameLength = (uint64_t)_num;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
this->ls->GetGC()->BarrierEnd();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
void TObjectVFS::Close()
|
||||
{
|
||||
TDictionary* dict;
|
||||
|
||||
@@ -3900,7 +3900,47 @@ namespace Tesses::CrossLang {
|
||||
cse.back()->Push(gc, nullptr);
|
||||
return false;
|
||||
}
|
||||
|
||||
if(key == "Chmod")
|
||||
{
|
||||
Tesses::Framework::Filesystem::VFSPath path;
|
||||
int64_t mode;
|
||||
if(GetArgumentAsPath(args,0,path) && GetArgument(args,0,mode))
|
||||
{
|
||||
vfs->Chmod(path,(uint32_t)mode);
|
||||
}
|
||||
|
||||
cse.back()->Push(gc, nullptr);
|
||||
return false;
|
||||
}
|
||||
if(key == "StatVFS")
|
||||
{
|
||||
Tesses::Framework::Filesystem::VFSPath path;
|
||||
|
||||
if(GetArgumentAsPath(args,0,path))
|
||||
{
|
||||
Tesses::Framework::Filesystem::StatVFSData data;
|
||||
if(vfs->StatVFS(path,data))
|
||||
{
|
||||
cse.back()->Push(gc, TDictionary::Create(ls,{
|
||||
TDItem("BlockSize", (int64_t)data.BlockSize),
|
||||
TDItem("FragmentSize",(int64_t)data.FragmentSize),
|
||||
TDItem("Blocks",(int64_t)data.Blocks),
|
||||
TDItem("BlocksFree",(int64_t)data.BlocksFree),
|
||||
TDItem("BlocksAvailable", (int64_t)data.BlocksAvailable),
|
||||
TDItem("TotalInodes", (int64_t)data.TotalInodes),
|
||||
TDItem("FreeInodes",(int64_t)data.FreeInodes),
|
||||
TDItem("AvailableInodes",(int64_t)data.AvailableInodes),
|
||||
TDItem("Id",(int64_t)data.Id),
|
||||
TDItem("Flags",(int64_t)data.Flags),
|
||||
TDItem("MaxNameLength",(int64_t)data.MaxNameLength)
|
||||
}));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
cse.back()->Push(gc, nullptr);
|
||||
return false;
|
||||
}
|
||||
cse.back()->Push(gc, nullptr);
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user