28#ifndef __INIREADER_H__
29#define __INIREADER_H__
31#include "exiv2lib_export.h"
58 const char* name,
const char* value);
61typedef char* (*ini_reader)(
char* str,
int num,
void* stream);
110#ifndef INI_ALLOW_MULTILINE
111#define INI_ALLOW_MULTILINE 1
118#define INI_ALLOW_BOM 1
125#ifndef INI_ALLOW_INLINE_COMMENTS
126#define INI_ALLOW_INLINE_COMMENTS 1
128#ifndef INI_INLINE_COMMENT_PREFIXES
129#define INI_INLINE_COMMENT_PREFIXES ";"
134#define INI_USE_STACK 1
138#ifndef INI_STOP_ON_FIRST_ERROR
139#define INI_STOP_ON_FIRST_ERROR 0
144#define INI_MAX_LINE 200
163 explicit INIReader(
const std::string& filename);
178 std::string Get(std::string section, std::string name,
179 std::string default_value);
190 long GetInteger(std::string section, std::string name,
long default_value);
202 double GetReal(std::string section, std::string name,
double default_value);
214 bool GetBoolean(std::string section, std::string name,
bool default_value);
218 std::map<std::string, std::string> _values;
219 static std::string MakeKey(std::string section, std::string name);
220 static int ValueHandler(
void* user,
const char* section,
const char* name,
Read an INI file into easy-to-access name/value pairs. (Note that I've gone for simplicity here rathe...
Definition: ini.hpp:158
Provides classes and functions to encode and decode Exif and Iptc data. The libexiv2 API consists of ...
Definition: asfvideo.hpp:36
int(* ini_handler)(void *user, const char *section, const char *name, const char *value)
typedef for prototype of handler function.
Definition: ini.hpp:57
int ini_parse_stream(ini_reader reader, void *stream, ini_handler handler, void *user)
Same as ini_parse(), but takes an ini_reader function pointer instead of filename....
Definition: ini.cpp:108
int ini_parse_file(FILE *file, ini_handler handler, void *user)
Same as ini_parse(), but takes a FILE* instead of filename. This doesn't close the file when it's fin...
Definition: ini.cpp:212
int ini_parse(const char *filename, ini_handler handler, void *user)
Parse given INI-style file. May have [section]s, name=value pairs (whitespace stripped),...
Definition: ini.cpp:218
char *(* ini_reader)(char *str, int num, void *stream)
Typedef for prototype of fgets-style reader function.
Definition: ini.hpp:61