nsnake
Classic snake game for the terminal
Classes
INI Namespace Reference

Simple module that contains everything needed to load and parse a file with the INI configuration format. More...

Classes

struct  Level
 Contains a "scope" of the INI file. More...
 
class  Parser
 Loads, reads and parses the contents of an INI file (or string). More...
 

Detailed Description

Simple module that contains everything needed to load and parse a file with the INI configuration format.

It basically is an INI::Parser, which uses several INI::Level according to the contents of the file.

Usage

For an INI file like this:

key       = value
[group]
other_key = other_value
[[nested_group]]
final_key = final_value

You'd run this module like this:

// Loads and parses immediately the file
INI::Parser parser("path/to/file.ini");
// Returns "value"
parser["key"];
// Returns "other_value"
parser("group")["other_key"];
// Returns "final_value"
parser("group")("nested_group")["final_key"];

Credits

This module is a modified version of ini-parser, originally made by Poordeveloper.