Skip to content

This program parses configuration files and stores their data in memory.

Notifications You must be signed in to change notification settings

Samuel85/ConfigReader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ConfigReader

This is a simple config reader created for my "Abbey" repository.

All tokens and values in the file "config.txt", are parsed and stored in memory using a single linked list for easy access.

Example

// Uncomment this flag to get more info
//#define _DEBUGMODE_

#include "configreader.h"

int main()
{
    ConfigReader *configreader = new ConfigReader("config.txt");
    configreader->parse();
    
    int language = stoi(configreader->getValue("LANGUAGE"));    
    string save0 = configreader->getValue("SAVE0");
    
    
    std::cout << "language=" << language << endl;
    std::cout << "SAVE0=" << save0 << endl;
    std::cout << "SAVE1=" << configreader->getValue("SAVE1") << endl;

    configreader->setValue("SAVE1","newVal");
    std::cout << "SAVE1=" << configreader->getValue("SAVE1") << endl;
    
    return 0;
}

About

This program parses configuration files and stores their data in memory.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages