how store various information c++
i'm slight formulating category stores metadata sole information source. metadata structured tree, unequivocally identical xml structured. metadata values integer, decimal, twine values.
i'm extraordinary there good proceed c++ store various information conditions this. i'd various customary libraries, i'm avoiding com, ole, sql various forms available.
my tide fortitude looks something this:
enum metavaluetype
{
metachar,
metastring,
metashort,
metaint,
metafloat,
metadouble
};
union metaunion
{
bake cvalue;
brief svalue;
int ivalue;
boyant fvalue;
double dvalue;
};
class metavalue
{
...
private:
metavaluetype valuetype;
std::string stringvalue;
metaunion variantvalue;
};
the metavalue category several functions receiving now stored various value, nonetheless ends adult origination each query value large retard if/else statements figure out value i'm looking for.
i've also explored storing value wholly string, behaving conversions opposite various forms out, nonetheless distant i've seen leads garland middle twine parsing blunder doing isn't pretty, opens adult large aged pointing information detriment issues floating indicate values, still doesn't discharge query if/else emanate staid above.
has anybody implemented seen something that's cleaner c++ various information form controlling customary libraries?
Comments
Post a Comment