GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - wsjcpp/wsjcpp-parse-conf: Primitive parser for *.conf files

BranchesTags
Open more actions menu

Latest commit

 

History

4 Commits
4 Commits

Folders and files

NameName
Last commit message
Last commit date
src.wsjcpp
src.wsjcpp
 
 
src
src
 
 
unit-tests.wsjcpp
unit-tests.wsjcpp
 
 
.gitignore
.gitignore
 
 
.travis.yml
.travis.yml
 
 
CMakeLists.txt
CMakeLists.txt
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
build_simple.sh
build_simple.sh
 
 
example.conf
example.conf
 
 
wsjcpp.yml
wsjcpp.yml
 
 

Repository files navigation

wsjcpp-parse-conf

Build Status Github Stars Github Stars Github Forks Total alerts Language grade: C/C++

Primitive parser for *.conf files

How to integrate

$ wsjcpp install "https://github.com/wsjcpp/wsjcpp-parse-conf:master"

or include files to your project:

  • src.wsjcpp/wsjcpp_core/wsjcpp_core.h
  • src.wsjcpp/wsjcpp_core/wsjcpp_core.cpp
  • src/wsjcpp_parse_conf.h
  • src/wsjcpp_parse_conf.cpp

Example usage

#include <string>
#include <iostream>
#include <wsjcpp_core.h>
#include <wsjcpp_parse_conf.h>

int main(int argc, const char* argv[]) {
    std::string TAG = "MAIN";
    std::string appName = std::string(WSJCPP_NAME);
    std::string appVersion = std::string(WSJCPP_VERSION);
    if (!WsjcppCore::dirExists(".logs")) {
        WsjcppCore::makeDir(".logs");
    }
    WsjcppLog::setPrefixLogFile("wsjcpp");
    WsjcppLog::setLogDirectory(".logs");
    
    WsjcppParseConf conf("./example.conf");
    if (!conf.load()) {
        std::cout << "Could not load file conf" << std::endl;
        return -1;
    }
    
    if (conf.has("testBool")) {
        bool bResult = conf.getBoolValue("testBool", false);
        std::cout << "testBool = " << (bResult ? "true" : "false" ) << std::endl;
    }

    if (conf.has("testInt")) {
        int nResult = conf.getIntValue("testInt", 0);
        std::cout << "testInt = " << nResult << std::endl;
    }

    if (conf.has("testString")) {
        std::string sResult = conf.getStringValue("testString", "");
        std::cout << "testString = " << sResult << std::endl;
    }

    if (conf.has("testString2")) {
        std::string sResult2 = conf.getStringValue("testString2", "");
        std::cout << "testString2 = " << sResult2 << std::endl;
    }

    return 0;
}

About

Primitive parser for *.conf files

Topics

cppparse-confparserparser-configswsjcpp-package

Resources

Readme
MIT license
Activity
Custom properties

Stars

2 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.