12f8ffbbdb7c4394e05fa6ff2b55c159bbcee72e
[profile/ivi/ico-vic-carsimulator.git] / src / CConf.h
1 /*
2  * Copyright (c) 2013, TOYOTA MOTOR CORPORATION.
3  *
4  * This program is licensed under the terms and conditions of the 
5  * Apache License, version 2.0.  The full text of the Apache License is at
6  * http://www.apache.org/licenses/LICENSE-2.0
7  *
8  */
9 /**
10  * @brief   Read configuration file
11  * @file    CConf.h
12  */
13
14 #ifndef CCONF_H_
15 #define CCONF_H_
16
17 #include <string>
18 #include <string.h>
19 #include <iostream>
20 #include <stdlib.h>
21 #include <stdio.h>
22
23 #define STR_BUF_SIZE    2048
24
25 class CConf
26 {
27   public:
28             CConf();
29     virtual ~CConf();
30
31     char m_strConfPath[260];
32
33     static int GetConfig(const char *strPath, const char *strSection,
34                          const char *strKey, int nDefault);
35     static double GetConfig(const char *strPath, const char *strSection,
36                             const char *strKey, double fDefault);
37     static bool GetConfig(const char *strPath, const char *strSection,
38                           const char *strKey, const char *strDefault,
39                           char *buf, int bufsize);
40
41     static bool SetConfig(const char *strPath, const char *strSection,
42                           const char *strKey, int nValue);
43     static bool SetConfig(const char *strPath, const char *strSection,
44                           const char *strKey, double fValue);
45     static bool SetConfig(const char *strPath, const char *strSection,
46                           const char *strKey, const char strValue);
47
48     static void GetModulePath(char *buf, int bufsize);
49
50     void LoadConfig(const char*filePath);
51
52
53     int m_nHazard;
54     int m_nWinkR;
55     int m_nWinkL;
56     int m_nAircon;
57     int m_nShiftU;
58     int m_nShiftD;
59     int m_nHeadLight;
60     int m_nSteering;
61     int m_nAccel;
62     int m_nBrake;
63     int m_nShift1;
64     int m_nShift2;
65     int m_nShift3;
66     int m_nShift4;
67     int m_nShift5;
68     int m_nShift6;
69     int m_nShiftR;
70     double m_fLng;
71     double m_fLat;
72     std::string m_sDeviceName;
73     std::string m_sAmbConfigName;
74
75 };
76
77 #endif /* CCONF_H_ */
78 /**
79  * End of File.(CConf.h)
80  */