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,65 @@
/* -----------------------------------------------------------------------------
GSFramework
Copyright 2001-2013 Emmanuel Julien. All Rights Reserved.
----------------------------------------------------------------------------- */
#include "metafile/nml_string.h"
#include "metafile/nml.h"
#include "filesystem/io_memory.h"
#include "memory/nauto_ptr.h"
#include "nstring/nstring.h"
#include "log/log.h"
namespace GS {
namespace NML {
//-----------------------------------------------------------------------------
bool TagToString(const Tag &tag, String &str)
{
IO::Memory memory_fs;
AutoPtr <IO::Handle> h(memory_fs.Open("file", IO::ModeWrite));
if (h.IsNull() || !Parser::SaveTag(*h, tag))
return false;
h = NULL;
Array <char> data;
if (!memory_fs.FileLoad("file", data))
return false;
str.Set(data.Start(), data.End());
return true;
}
bool TagFromString(const String &str, Tag &tag)
{
return Parser::ParseTag(tag, str.c_str(), &str.c_str()[str.Len()]);
}
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
bool FileToString(const File &file, String &str)
{
IO::Memory memory_fs;
AutoPtr <IO::Handle> h(memory_fs.Open("file", IO::ModeWrite));
if (h.IsNull() || !Parser::Save(*h, file))
return false;
h = NULL;
Array <char> data;
if (!memory_fs.FileLoad("file", data))
return false;
str.Set(data.Start(), data.End());
return true;
}
bool FileFromString(const String &str, File &file)
{
return Parser::LoadFromMemory(str.c_str(), str.Len(), file);
}
//-----------------------------------------------------------------------------
} // NML
} // GS