annotate src/gpf/inc/pco_inifile.h @ 101:2c4e31c7c4e5

LICENSE: same as Citrine and Magnetite
author Mychaela Falconia <falcon@freecalypso.org>
date Sat, 21 Jul 2018 07:28:12 +0000
parents 1ea54a97e831
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1 /*
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2 +-----------------------------------------------------------------------------
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
3 | Project : PCO2
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
4 | Modul : inc\pco_inifile.h
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
5 +-----------------------------------------------------------------------------
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
6 | Copyright 2002 Texas Instruments Berlin, AG
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
7 | All rights reserved.
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
8 |
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
9 | This file is confidential and a trade secret of Texas
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
10 | Instruments Berlin, AG
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
11 | The receipt of or possession of this file does not convey
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
12 | any rights to reproduce or disclose its contents or to
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
13 | manufacture, use, or sell anything it may describe, in
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
14 | whole, or in part, without the specific written consent of
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
15 | Texas Instruments Berlin, AG.
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
16 +-----------------------------------------------------------------------------
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
17 | Purpose : Contains declarations of the class IniFile. (Based on
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
18 | File from Adam Clauss)
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
19 +-----------------------------------------------------------------------------
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
20 */
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
21
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
22 #ifndef _PCO_INIFILE_H_
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
23 #define _PCO_INIFILE_H_
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
24
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
25 /*==== INCLUDES ===================================================*/
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
26
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
27 #pragma warning (disable: 4786) /* ignore warning about to long template names */
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
28
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
29 #include <iostream>
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
30 #include <string>
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
31 #include <vector>
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
32 #include "cms.h"
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
33
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
34 using namespace std;
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
35
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
36 /*==== PROTOTYPES ==================================================*/
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
37
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
38 //all Keys are of this type
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
39 struct Key
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
40 {
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
41 //list of values in key
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
42 vector<string> values;
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
43
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
44 //corresponding list of value names
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
45 vector<string> names;
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
46
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
47 //corresponding list of modified state
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
48 vector<bool> modified;
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
49 };
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
50
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
51 class IniFile
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
52 {
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
53 //all private variables
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
54 private:
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
55
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
56 //stores pathname of ini file to read/write
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
57 string path;
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
58
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
59 //list of Keys in ini
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
60 vector<Key> keys;
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
61
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
62 //corresponding list of Keynames
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
63 vector<string> names;
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
64
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
65 // semaphore to protect file reading/writing
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
66 CMS_HANDLE m_file_sema;
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
67
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
68 //all private functions
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
69 private:
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
70 //overloaded to take string
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
71 istream & getline( istream & is, string & str );
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
72
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
73 //returns index of specified value, in the specified Key, or -1 if not found
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
74 int FindValue(int Keynum, string valuename) const;
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
75
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
76 //returns index of specified Key, or -1 if not found
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
77 int FindKey(string Keyname) const;
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
78
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
79
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
80 //public variables
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
81 public:
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
82
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
83 //will contain error info if one occurs
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
84 //ended up not using much, just in ReadFile and GetValue
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
85 mutable string error;
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
86
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
87 //will contain warning info if one occurs
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
88 //ended up not using much, just in ReadFile
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
89 mutable string warning;
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
90
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
91 //public functions
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
92 public:
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
93 //default constructor
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
94 IniFile();
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
95
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
96 //constructor, can specify pathname here instead of using SetPath later
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
97 IniFile(string inipath);
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
98
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
99 //default destructor
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
100 virtual ~IniFile();
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
101
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
102 //sets path of ini file to read and write from
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
103 void SetPath(string newpath);
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
104
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
105 //returns path of currently selected ini file
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
106 const char* GetPath() const { return path.c_str();}
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
107
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
108 //reads ini file specified using IniFile::SetPath()
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
109 //returns true if successful, false otherwise
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
110 //may contain warnings in warning-variable
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
111 bool ReadFile(bool refresh=false);
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
112
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
113 //writes data stored in class to ini file
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
114 bool WriteFile(bool refresh_first=true);
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
115
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
116 //deletes all stored ini data
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
117 void Reset();
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
118
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
119 //returns number of Keys currently in the ini
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
120 int GetNumKeys() const;
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
121
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
122 //returns number of values stored for specified Key
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
123 int GetNumValues(string Keyname) const;
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
124
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
125 //gets value of [Keyname] valuename =
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
126 //overloaded to return string, int, and double,
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
127 //returns "", or 0 if Key/value not found. Sets error member to show problem
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
128 string GetValue(string Keyname, string valuename) const;
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
129 int GetValueI(string Keyname, string valuename) const;
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
130 double GetValueF(string Keyname, string valuename) const;
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
131
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
132 //sets value of [Keyname] valuename =.
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
133 //specify the optional paramter as false (0) if you do not want it to create
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
134 //the Key if it doesn't exist. Returns true if data entered, false otherwise
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
135 //overloaded to accept string, int, and double
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
136 bool SetValue(string Key, string valuename, string value, bool create = 1);
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
137 bool SetValueI(string Key, string valuename, int value, bool create = 1);
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
138 bool SetValueF(string Key, string valuename, double value, bool create = 1);
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
139
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
140 bool modified(string keyname, string valuename);
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
141 bool set_modified(string keyname, string valuename, bool modified=true);
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
142
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
143 //deletes specified value
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
144 //returns true if value existed and deleted, false otherwise
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
145 bool DeleteValue(string Keyname, string valuename);
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
146
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
147 //deletes specified Key and all values contained within
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
148 //returns true if Key existed and deleted, false otherwise
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
149 bool DeleteKey(string Keyname);
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
150 };
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
151
1ea54a97e831 src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
152 #endif /* _PCO_INIFILE_H_ */