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,83 @@
/* -----------------------------------------------------------------------------
GSFramework
Copyright 2001-2013 Emmanuel Julien. All Rights Reserved.
----------------------------------------------------------------------------- */
#include "metafile/nml.h"
#include "alloc/ialloc.h"
using namespace GS::NML;
//------------------------------------------------------------------------------
bool File::GetBool(const char *path, bool dflt, bool verbose) const {
Tag *t = GetTypedTag(path, Variant::VariantBool, verbose);
return t ? t->GetBool() : dflt;
}
int File::GetInteger(const char *path, int dflt, bool verbose) const {
Tag *t = GetTypedTag(path, Variant::VariantInteger, verbose);
return t ? t->GetInteger() : dflt;
}
float File::GetReal(const char *path, float dflt, bool verbose) const {
Tag *t = GetTypedTag(path, Variant::VariantFloat, verbose);
return t ? t->GetReal() : dflt;
}
const char *File::GetString(const char *path, const char *dflt, bool verbose) const {
Tag *t = GetTypedTag(path, Variant::VariantString, verbose);
return t ? t->GetString() : dflt;
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void File::Import(const File &src, bool clear_before_import) {
if (clear_before_import)
Clear();
ListForeachPtr(Tag *, tag, src.GetTags())
AddRoot(tag->Clone());
}
File *File::Clone() const {
File *clone = new File;
if (!clone)
return NULL;
if (!name.IsEmpty())
clone->name = name.c_str();
clone->Import(*this);
return clone;
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
Tag *File::AddRoot(Tag *t) {
if (!t)
return NULL;
if (!tags.Add(t))
return NULL;
return t;
}
Tag *File::AddRoot(const char *name) { return AddRoot(new Tag(name)); }
Tag *File::AddRoot(const char *name, bool v) { return AddRoot(new Tag(name, v)); }
Tag *File::AddRoot(const char *name, int v) { return AddRoot(new Tag(name, v)); }
Tag *File::AddRoot(const char *name, float v) { return AddRoot(new Tag(name, v)); }
Tag *File::AddRoot(const char *name, const char *s) { return AddRoot(new Tag(name, s)); }
Tag *File::AddRoot(const char *name, void *d, size_t s) { return AddRoot(new Tag(name, d, s)); }
bool File::UnlinkRoot(Tag *t) { return tags.Remove(t); }
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void File::Free() {
ListDeleteAllPtr(Tag *, tags);
name.Clear();
}
File::~File() { Free(); }
//------------------------------------------------------------------------------