Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

fredyw/cpp-properties

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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;
}

About

A small C++ Java properties parser

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Morty Proxy This is a proxified and sanitized view of the page, visit original site.