Skip to content

Wolfboy248/XDF

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

XDF

XDF is a simple and versatile static C++ library for handling data with minimal overhead.

Usage

The format requires you to have an XDFRoot object as the root, as that has the write function. The root does not require a name, however XDFNode does. 1

// node.h
class XDFRoot : public XDFNode {
public:
  ...

  void write(const std::string& filename);
  bool read(const std::string& filename);
};

Syntax could look something like this:

using namespace xdf;

...

XDFRoot root;
root.addValue("version", "0.1.0");

XDFNode child {"list"};
for (int i = 0; i < 20; i++) {
  XDFNode entry{std::to_string(i)};
  child.append(entry);
}

root.append(child);

root.write("file.xdf");

// root.read() returns true if the read was successful
if (root.read("file.xdf") {
  std::string version = root.getValues().find("version")->second;
  int listSize = root.getChildren().find("list")->second.getChildren().getSize();
}

Footnotes

  1. include/xdf/node.h

About

A simple, versatile data formatting file type. "X" Data Format.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors