ECF 1.5
readpar.h
1/* Razred za citanje parametara iz tekst datoteke */
2/* Class for reading parameters from a text file */
3/* last update 14.02.01. */
4
5#include<stdio.h>
6
7//#define STRING 0
8//#define INTEGER 1
9//#define DOUBLE 2
10#define TAB 9
11#define SPACE 32
12#define NEWLINE '\n'
13
14const int MAX_LINE = 10000;
15
17{ public:
18 static const int STRING = 0;
19 static const int INTEGER = 1;
20 static const int DOUBLE = 2;
21 ReadPar(void);
22 ~ReadPar(void);
23
24 int OpenFile(const char *fname);
25 int CloseFile(void);
26 int ReadParameter(const char *par, int type, void *val, int vector=1, int item=1);
27 // type: 0 - string, 1 - integer, 2 - double
28 // vector: 1-... number of elements
29
30 private:
31 FILE *fp;
32 char buf[MAX_LINE];
33};
34
type
Data types used for configuration file parameters.
Definition: Registry.h:16