Very simple, Header-only, Key-Value pair Parser and Generator.
Go to file
Syntriax a92b2fe91a
Update README.md
2020-10-28 20:22:37 +03:00
ConfigurationParser.h Initial Commit 2020-10-28 20:19:36 +03:00
LICENSE Initial Commit 2020-10-28 20:19:36 +03:00
README.md Update README.md 2020-10-28 20:22:37 +03:00

README.md

Configuration Parser

Very simple, Header-only, Key-Value pair Parser and Generator.

To change the default assigner "=" there's a define named CONFIG_ASSIGNER in ConfigReader.h (33).

#define CONFIG_ASSIGNER "="

Example

#include <iostream>
#include "ConfigurationParser.h"

int main()
{
    Syn::ConfigurationParser parser = Syn::ConfigurationParser("config.cfg");
    
    parser["NewKey"] = "NewValue";
    std::cout << "parser[newKey] -> " << parser["NewKey"]  << std::endl;
    
    // Save to the current file "config.cfg"
    parser.SaveFile();

    // Open another file
    parser.ParseFile("anotherConfig.conf");

    for(auto [key, value] : parser)
        std::cout << key << " -> " << value << std::endl;

    // Write to a specific file and change the current file to that file
    parser.WriteFile("newConfig.ini");
    
    return 0;
}