Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/orxonox/branches/nico/src/ini_parser.h @ 3943

Last change on this file since 3943 was 3238, checked in by bensch, 20 years ago

orxonox/branches: updated branches: buerli, nico, sound. And moved bezierTrack to old.bezierTrack. Conflicts resolved in a usefull order.
Conflics mostly resolved in favor of trunk
merge.

File size: 781 bytes
Line 
1/*!
2    \file ini_parser.h
3    \brief A small ini file parser
4   
5    Can be used to find a defined [Section] in an ini file and get the VarName=Value entries
6*/
7
8#ifndef _INI_PARSER_H
9#define _INI_PARSER_H
10
11#include <stdio.h>
12#include <string.h>
13#include <stdlib.h>
14
15#define PARSELINELENGHT 512
16
17//! ini-file parser
18/**
19        This class can be used to load an initializer file and parse it's contents for variablename=value pairs.
20*/
21class IniParser {
22 private:
23        FILE* stream;
24        bool bInSection;
25        char internbuf[PARSELINELENGHT];
26       
27 public:
28  IniParser (char* filename);
29  ~IniParser ();
30 
31  char* getVar( char* name, char* section, char* defvalue);
32        int openFile( char* name);
33  int getSection( char* section);
34  int nextVar( char* name, char* value);
35};
36
37#endif /* _INI_PARSER_H */
Note: See TracBrowser for help on using the repository browser.