Flow123d  jenkins-Flow123d-windows-release-multijob-285
read_ini.h
Go to the documentation of this file.
1 /*!
2  *
3  * Copyright (C) 2007 Technical University of Liberec. All rights reserved.
4  *
5  * Please make a following refer to Flow123d on your project site if you use the program for any purpose,
6  * especially for academic research:
7  * Flow123d, Research Centre: Advanced Remedial Technologies, Technical University of Liberec, Czech Republic
8  *
9  * This program is free software; you can redistribute it and/or modify it under the terms
10  * of the GNU General Public License version 3 as published by the Free Software Foundation.
11  *
12  * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
13  * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14  * See the GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License along with this program; if not,
17  * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 021110-1307, USA.
18  *
19  *
20  * $Id$
21  * $Revision$
22  * $LastChangedBy$
23  * $LastChangedDate$
24  *
25  * @file
26  * @brief ???
27  *
28  */
29 
30 #ifndef READ_INI_H
31 #define READ_INI_H
32 
33 #include <vector>
34 
35 struct Ini_item;
36 struct Read_ini;
37 
38 #include "system/system.hh"
39 
40 struct Read_ini
41 {
42  char *ini_file;
43  char *ini_dir; /* absolute or relative path to the ini file */
44  struct Ini_item *ini_item;
45 };
46 
47 struct Ini_item
48 {
49  struct Ini_item *next;
50  struct Ini_item *prev;
51  char *section;
52  char *key;
53  char *value;
54 
55 };
56  long int OptGetInt(const char *section,const char *key,const char *defval);
57  char * OptGetStr(const char *section,const char *key,const char *defval);
58  char * OptGetFileName(const char *section,const char *key,const char *defval);
59  bool OptGetBool(const char *section,const char *key,const char *defval);
60  double OptGetDbl(const char *section,const char *key,const char *defval);
61  void OptionsInit(const char *fname );
62  /**
63  * Read value of particular key as list of doubles and store them into array.
64  * defval string is used if the key is not found.
65  */
66  void OptGetDblArray(const char *section, const char *key, const char *defval, std::vector<double> &array);
67 
68  void OptGetIntArray(const char *section, const char *key, const char *defval, int Arrsize, int *Array);
69  //char * OptGetStrArray();
70 
71 #endif
72 
bool OptGetBool(const char *section, const char *key, const char *defval)
Definition: read_ini.cc:279
void OptGetDblArray(const char *section, const char *key, const char *defval, std::vector< double > &array)
Definition: read_ini.cc:332
struct Ini_item * ini_item
Definition: read_ini.h:44
long int OptGetInt(const char *section, const char *key, const char *defval)
Definition: read_ini.cc:242
struct Ini_item * next
Definition: read_ini.h:49
char * value
Definition: read_ini.h:53
char * ini_dir
Definition: read_ini.h:43
void OptGetIntArray(const char *section, const char *key, const char *defval, int Arrsize, int *Array)
Definition: read_ini.cc:359
char * ini_file
Definition: read_ini.h:42
char * section
Definition: read_ini.h:51
double OptGetDbl(const char *section, const char *key, const char *defval)
Definition: read_ini.cc:260
char * key
Definition: read_ini.h:52
char * OptGetStr(const char *section, const char *key, const char *defval)
Create new string from selected variable from ini file.
Definition: read_ini.cc:205
void OptionsInit(const char *fname)
Load options file.
Definition: read_ini.cc:301
struct Ini_item * prev
Definition: read_ini.h:50
char * OptGetFileName(const char *section, const char *key, const char *defval)
Definition: read_ini.cc:232