Giter Site home page Giter Site logo

akashverma1515 / cpp-properties Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fredyw/cpp-properties

0.0 0.0 0.0 1.22 MB

A small C++ Java properties parser

License: MIT License

C++ 83.30% Makefile 1.88% Shell 8.80% Python 4.88% CMake 0.59% M4 0.49% C 0.05%

cpp-properties's Introduction

CPP-properties

A small C++ Java properties parser.

How to build

cpp-properties uses CMake build system (http://www.cmake.org/).

./build.sh

Examples

input.properties

key1=value1
key2=value2
key3=value3
key4=value4

output.properties

key100=value100
key200=value200
key300=value300

Main.cpp

#include <iostream>
#include "PropertiesParser.h"
using namespace std;
using namespace cppproperties;

void TestRead() {
    Properties props = PropertiesParser::Read("input.properties");
    vector<string> names = props.GetPropertyNames();
    for (vector<string>::const_iterator i = names.begin(); i != names.end(); ++i) {
        cout << *i << " = " << props.GetProperty(*i) << endl;
    }
}

void TestWrite() {
    Properties props;
    props.AddProperty("key100", "value100");
    props.AddProperty("key200", "value200");
    props.AddProperty("key300", "value300");
    PropertiesParser::Write("output.properties", props);
}

int main() {
    TestRead();
    TestWrite();
    return 0;
}

cpp-properties's People

Contributors

akashverma1515 avatar dasroteskelett avatar dhoard avatar emmenlau avatar fredyw avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.