The server tree of https://code.moenext.com/nanahira/ygopro.git, branch server, commit 52c868ce071ea0f2fcb0cf39bf2fb4151d12b90c, stock: gframe/, premake5.lua, .ci/, LICENSE, and gframe/ygopro.rc + .ico (upstream keeps them in resource/ and copies them in before building). No game assets, no scripts, no ocgcore submodule: the core is ../core. The third-party sources upstream's Windows CI downloads are vendored here at the positions its premake expects, each with its premake fragment from upstream's premake/ folder inside it: lua 5.4.8, sqlite 3.53.3, libevent 2.1.13-stable (tests, samples and autotools helpers left out; the files its Windows prebuild copies into include/ left out), zlib 1.3.2 (contrib and examples left out), xz 5.8.3 (src/liblzma + src/common only), and irrlicht 1.9 from mycard at 20f86d25: include/ plus the source/Irrlicht headers and the 11 .cpp files the server's zip reader project compiles. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
66 lines
2.9 KiB
C++
66 lines
2.9 KiB
C++
// Madoc 05/09
|
|
|
|
#ifndef __C_XMLREGISTRY_H_INCLUDED__
|
|
#define __C_XMLREGISTRY_H_INCLUDED__
|
|
|
|
#include <irrlicht.h>
|
|
|
|
using namespace irr;
|
|
#include "CXMLNode.h"
|
|
//File->
|
|
// Node1->
|
|
// Name1/Value
|
|
// Node2->
|
|
// Name2/Value
|
|
// Oddity: Very little error checking, crashes if you look at it funny
|
|
// Oddity: When using setValue ala setValue("someindex",100); compiler cant tell if 100 is a bool or an int, silly compiler,
|
|
// casting to u16 works ala setValue("someindex",(u16)100); I see why, but its still silly, and casts are slow
|
|
class CXMLRegistry {
|
|
public:
|
|
CXMLRegistry(io::IFileSystem *fsys);
|
|
~CXMLRegistry();
|
|
bool loadFile(const c8 *fname, const c8 *path);
|
|
bool loadConfigFile(const c8 *fname);
|
|
bool writeFile(const c8 *fname, const c8 *path);
|
|
bool writeConfigFile(const c8 *fname);
|
|
const wchar_t *getValueAsCStr(const wchar_t *index,const wchar_t *context = 0);
|
|
// Dosnt work, just declare a stringc and assign the wchar_t to it
|
|
//const irr::c8 *getValueAsCharCStr(const wchar_t *index,const wchar_t *context = 0);
|
|
bool getValueAsBool(const wchar_t *index, const wchar_t *context = 0);
|
|
u16 getValueAsInt(const wchar_t *index, const wchar_t *context = 0);
|
|
// This one only takes a context because its going to read 4 childrens values
|
|
irr::core::rect<u32> getValueAsRect(const wchar_t *context = 0);
|
|
// This one only takes a context because its going to read 4 childrens values
|
|
video::SColor getValueAsColor(const wchar_t *context = 0);
|
|
irr::core::array<const wchar_t*> *listNonNodeChildren(const wchar_t *node,const wchar_t *context = 0);
|
|
irr::core::array<const wchar_t*> *listNodeChildren(const wchar_t *node,const wchar_t *context = 0);
|
|
bool setValue(const wchar_t *index, bool boolval, const wchar_t *context = 0);
|
|
bool setValue(const wchar_t *index, u16 intval, const wchar_t *context = 0);
|
|
bool setValue(const wchar_t *index, const wchar_t *txtval,const wchar_t *context = 0);
|
|
// Speed improvement, why search if we want multiple values from the same context
|
|
void setContext(const wchar_t *context);
|
|
bool isTopLevelNode(const wchar_t *node);
|
|
bool populateTreeView(irr::gui::IGUITreeView *control,const wchar_t *context = 0);
|
|
// TODO: These are trivial to do, just dont need them yet
|
|
// renameNode(context(?),TYPE)
|
|
// deleteNode(context(?) (CAREFUL WITH CHILDREN)
|
|
// addNode(context, value, type)
|
|
// CXMLNODETYPE_COMMENT
|
|
// Loading/saving of CDATA, easiest would be just save it in the value of
|
|
// the CXMLNODETYPE_NODE their accosicated with.
|
|
// make registry inherit node instead of containing an instance of it.
|
|
// context(?) might be tricky with CXMLNODETYPE_VALUE
|
|
//
|
|
//
|
|
private:
|
|
io::IFileSystem* fileSystem;
|
|
CXMLNode* registry;
|
|
CXMLNode* currentContext;
|
|
const wchar_t *convertBoolToText(bool boolval);
|
|
bool convertTextToBool(const wchar_t* textval);
|
|
CXMLNode *resolveContext(const wchar_t* context);
|
|
const irr::c8 *resolveConfigPath(const irr::c8 *fname);
|
|
|
|
};
|
|
#endif
|