Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/orxonox/branches/chris/src/ini_parser.h @ 2097

Last change on this file since 2097 was 2066, checked in by chris, 20 years ago

orxonox/branches/chris: Implemented CommandNode (Keyboard handling), created some functions to convert key names to identifyers and vice versa, ensured it compiles (when compiled spereately) added a header to hold global message structures

File size: 631 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 <strings.h>
13#include <stdlib.h>
14
15#define PARSELINELENGHT 512
16
17class IniParser {
18 private:
19        FILE* stream;
20        bool bInSection;
21        char internbuf[PARSELINELENGHT];
22       
23 public:
24  IniParser (char* filename);
25  ~IniParser ();
26 
27  char* get_var( char* name, char* section, char* defvalue);
28        int open_file( char* name);
29  int get_section( char* section);
30  int next_var( char* name, char* value);
31};
32
33#endif
Note: See TracBrowser for help on using the repository browser.