commit x64 compilation from lulu cause the other branch dont seems to compile properly at home

This commit is contained in:
2026-07-17 16:08:20 +02:00
parent c0f3eeb00d
commit 0efa4ee6f7
625 changed files with 117283 additions and 4426 deletions

View File

@ -0,0 +1,59 @@
/* -----------------------------------------------------------------------------
GSFramework
Copyright 2001-2013 Emmanuel Julien. All Rights Reserved.
----------------------------------------------------------------------------- */
#include "filesystem/io_base.h"
#include "filesystem/io_handle.h"
#include "memory/nauto_ptr.h"
#include "nstring/nstring.h"
#include "hash/nsha1.h"
#include "log/log.h"
using GS::String;
using namespace GS::IO;
//------------------------------------------------------------------------------
bool Base::FileLoad(const char *uri, GS::Array <char> &buffer)
{
AutoPtr <Handle> h(Open(uri));
if (h.IsNull())
return false;
size_t size = h->GetSize();
if (!buffer.Allocate(size))
return false;
return asbool(h->Read(buffer.c_ptr(), size) == size);
}
bool Base::FileSave(const char *uri, const GS::Array <char> &buffer)
{
AutoPtr <Handle> h(Open(uri, ModeWrite));
if (h.IsNull())
return false;
return asbool(h->Write(buffer.c_ptr(), buffer.GetSize()) == buffer.GetSize());
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
bool Base::Exists(const char *uri)
{
AutoPtr <Handle> h(Open(uri, ModeRead));
return h.IsValid();
}
String Base::Hash(const char *uri)
{
Array <char> data;
return FileLoad(uri, data) ? SHA1::ComputeHexa(data) : String();
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
String Base::MapToAbsolute(const char *uri) const
{ return String(uri); }
String Base::MapToRelative(const char *path) const
{ return String(path); }
//------------------------------------------------------------------------------