• Main Page
  • Modules
  • Classes
  • Files
  • File List

D:/Projekt/ECF_trunk/examples/iprojekt/readpar.h

00001 /* Razred za citanje parametara iz tekst datoteke */
00002 /* Class for reading parameters from a text file */
00003 /* last update 14.02.01. */
00004 
00005 #include<stdio.h>
00006 
00007 //#define STRING 0
00008 //#define INTEGER 1
00009 //#define DOUBLE 2
00010 #define TAB 9
00011 #define SPACE 32
00012 #define NEWLINE '\n'
00013 
00014 const int MAX_LINE = 10000;
00015 
00016 class ReadPar
00017 {   public:
00018         static const int STRING = 0;
00019         static const int INTEGER = 1;
00020         static const int DOUBLE = 2;
00021         ReadPar(void);
00022         ~ReadPar(void);
00023 
00024         int OpenFile(const char *fname);
00025         int CloseFile(void);
00026         int ReadParameter(const char *par, int type, void *val, int vector=1, int item=1);  
00027         // type: 0 - string, 1 - integer, 2 - double
00028         // vector: 1-... number of elements
00029 
00030     private:
00031         FILE *fp;
00032         char buf[MAX_LINE];
00033 };
00034 

Generated on Wed Sep 21 2011 13:46:53 for ECF by  doxygen 1.7.1