All Projects → c-ridgway → cpp-feather-ini-parser

c-ridgway / cpp-feather-ini-parser

Licence: MIT license
Header only, simple, fast, templated - portable INI parser for ANSI C++.

Programming Languages

C++
36643 projects - #6 most used programming language

Projects that are alternatives of or similar to cpp-feather-ini-parser

Fastify Esso
The easiest authentication plugin for Fastify, with built-in support for Single sign-on
Stars: ✭ 20 (-54.55%)
Mutual labels:  fast, easy
Tkinter-Designer
An easy and fast way to create a Python GUI 🐍
Stars: ✭ 4,697 (+10575%)
Mutual labels:  fast, easy
duckphp
PHP框架,PHP Framework. keep PHP simple and fast. Laravel larva and Smarty is evil
Stars: ✭ 125 (+184.09%)
Mutual labels:  fast, easy
Mrthumb
【拇指先生】 a simple easy video thumbnail provider,顺滑的获取视频缩略图,支持本地和网络视频,有问题大胆提Issues
Stars: ✭ 60 (+36.36%)
Mutual labels:  fast, easy
Nuxt Stories
Nuxt stories module -- Painless (and now insanely fast) storybooking for Nuxt
Stars: ✭ 81 (+84.09%)
Mutual labels:  fast, easy
discord-economy-super
Easy and customizable economy module for your Discord bot.
Stars: ✭ 28 (-36.36%)
Mutual labels:  fast, easy
Q Municate Ios
Q-municate iOS repository
Stars: ✭ 164 (+272.73%)
Mutual labels:  fast, easy
avo
Ruby on Rails application building framework
Stars: ✭ 907 (+1961.36%)
Mutual labels:  fast, easy
zipline
A ShareX/file upload server that is easy to use, packed with features, and with an easy setup!
Stars: ✭ 215 (+388.64%)
Mutual labels:  easy
nightly-docker-rebuild
Use nightli.es 🌔 to rebuild N docker 🐋 images 📦 on hub.docker.com
Stars: ✭ 13 (-70.45%)
Mutual labels:  fast
Learning Resources
Beginner-friendly repository to make your first Pull Request and contribute to the open-source.
Stars: ✭ 40 (-9.09%)
Mutual labels:  easy
skmeans
Super fast simple k-means implementation for unidimiensional and multidimensional data.
Stars: ✭ 59 (+34.09%)
Mutual labels:  fast
pixie
Tiny template functions.
Stars: ✭ 14 (-68.18%)
Mutual labels:  fast
mcthings
A Python framework for creating 3D scenes in Minecraft and Minetest
Stars: ✭ 44 (+0%)
Mutual labels:  easy
FAST
A GML supplement library for GMS 2.3+
Stars: ✭ 22 (-50%)
Mutual labels:  fast
q-municate-web
Q-municate Web chat application
Stars: ✭ 66 (+50%)
Mutual labels:  easy
marshmallow-objects
Marshmallow Objects and Models
Stars: ✭ 37 (-15.91%)
Mutual labels:  ini-parser
brute-md5
Advanced, Light Weight & Extremely Fast MD5 Cracker/Decoder/Decryptor written in Python 3
Stars: ✭ 16 (-63.64%)
Mutual labels:  fast
Apex.Serialization
High performance contract-less binary serializer for .NET
Stars: ✭ 82 (+86.36%)
Mutual labels:  fast
DownloadRedditImages
Easily download all the images from any subreddit (also select sort_type if you want hot/top/new/controversial, and also sort_time day/week/month/year/all). Randomly select downloaded images and set as wallpaper, updating every 30 mins (or whenever you want duh)!
Stars: ✭ 66 (+50%)
Mutual labels:  easy

feather-ini-parser

Intuitive, fast, lightweight, header, portable INI parser for ANSI C++.

Methods

Statement Return Type
ini(filename, doParse, parseFlags) constructor
ini(ini) copy constructor
ini.parse(parseFlags) bool
ini.save(filename, saveFlags) bool
ini.set(section, key, value) bool
ini.get(section, key, def) string
ini.getAs<type>(section, key, def = type()) type
ini.create(section) bool
ini.select(section) bool
ini.set(key, value) bool
ini.get(key, def) string
ini.getAs<type>(key, def = type()) type
ini.clear() bool
ini[section][key] string&
ini[section] keys_t&

Flags

Flag Effect
PARSE_COMMENTS_ALL Parses comments // and #
PARSE_COMMENTS_SLASH Parses comment //
PARSE_COMMENTS_HASH Parses comment #
SAVE_PRUNE Removes all empty sections/keys
SAVE_PADDING_SECTIONS Appends a blank line under each section
SAVE_SPACE_SECTIONS '[ Section ]' instead of '[Section]'
SAVE_SPACE_KEYS 'key = value' instead of 'key=value'
SAVE_TAB_KEYS ' key=value' instead of 'key=value'
SAVE_SEMICOLON_KEYS 'key=value;' instead of 'key=value'

Example

Requires C++11: -std=c++11 or -std=c++14 or -std=c++20 or ...

#include "INI.h"
//#define FINI_WIDE_SUPPORT
...

// Set global parsing/saving options
INI::PARSE_FLAGS = INI::PARSE_COMMENTS_ALL | INI::PARSE_COMMENTS_SLASH | INI::PARSE_COMMENTS_HASH;
INI::SAVE_FLAGS = INI::SAVE_PRUNE | INI::SAVE_PADDING_SECTIONS | INI::SAVE_SPACE_SECTIONS | INI::SAVE_SPACE_KEYS | INI::SAVE_TAB_KEYS | INI::SAVE_SEMICOLON_KEYS;

INI ini("file.ini", true);  // Assign ini file and parse

ini.create("Section 0");
ini.select("Section 0");
ini.set("Key2", "Value");
ini.get("Key1", "DefaultValue");

ini.set("Section 0", "Key1", std::to_string(11.12));
cout << ini.getAs<float>("Section 2", "Key1") << endl; // Return as float

ini["Section 0"]["Key1"] = "Changed";

// Save with formatting
ini.save("test.ini");

// Loop through sections, keys and values
for(auto i: ini.sections) {
   cout << "[" << i.first << "]" << endl;

   //for(auto j = i.second->begin(); j != i.second->end(); j++)
   for(auto j: *i.second) {
      cout << "  " << j.first << "=" << j.second << endl;
   }
}

More

Please see the example .cpp file and Code::Blocks .cbp project for a compilable GCC and VSC++ example. Further examples include enabling wide char support.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].