1 #include "../Common/Common.h"
3 #include "../DasherCore/Parameters.h"
4 #include "../Common/AppSettingsData.h"
10 enum{ TYPE_BOOL
, TYPE_LONG
, TYPE_STRING
};
14 CSchema(const std::string
&strKeyName
, int iType
,
15 const std::string
&strDefault
, const std::string
&strShort
,
16 const std::string
&strLong
);
20 std::string m_strKeyName
;
21 std::string m_strType
;
22 std::string m_strDefault
;
23 std::string m_strShort
;
24 std::string m_strLong
;
27 CSchema::CSchema(const std::string
&strKeyName
, int iType
,
28 const std::string
&strDefault
, const std::string
&strShort
,
29 const std::string
&strLong
) {
30 m_strKeyName
= strKeyName
;
44 m_strDefault
= strDefault
;
45 m_strShort
= strShort
;
49 void CSchema::Dump() {
50 std::cout
<< "<schema>" << std::endl
;
51 std::cout
<< "<key>/schemas/apps/dasher4/" << m_strKeyName
<< "</key>" << std::endl
;
52 std::cout
<< "<applyto>/apps/dasher4/" << m_strKeyName
<< "</applyto>" << std::endl
;
53 std::cout
<< "<owner>dasher</owner>" << std::endl
;
54 std::cout
<< "<type>" << m_strType
<< "</type>" << std::endl
;
55 std::cout
<< "<default>" << m_strDefault
<< "</default>" << std::endl
;
56 std::cout
<< "<locale name=\"C\">" << std::endl
;
57 std::cout
<< "<short>" << m_strShort
<< "</short>" << std::endl
;
58 std::cout
<< "<long>" << m_strLong
<< "</long>" << std::endl
;
59 std::cout
<< "</locale>" << std::endl
;
60 std::cout
<< "</schema>" << std::endl
;
64 int main(int argc
, char **argv
) {
66 std::cout
<< "<gconfschemafile>" << std::endl
;
67 std::cout
<< "<schemalist>" << std::endl
;
69 for(int i(0); i
< NUM_OF_BPS
; ++i
) {
70 if(boolparamtable
[i
].persistent
) {
71 std::string strDefault
;
73 if(boolparamtable
[i
].defaultValue
)
78 CSchema
oSchema( boolparamtable
[i
].regName
,
82 boolparamtable
[i
].humanReadable
);
88 for(int i(0); i
< END_OF_APP_BPS
- END_OF_SPS
; ++i
) {
90 if(app_boolparamtable
[i
].persistent
) {
91 std::string strDefault
;
93 if(app_boolparamtable
[i
].bDefaultValue
)
98 CSchema
oSchema( app_boolparamtable
[i
].regName
,
102 app_boolparamtable
[i
].humanReadable
);
108 for(int i(0); i
< NUM_OF_LPS
; ++i
) {
109 if(longparamtable
[i
].persistent
) {
111 std::stringstream ssDefault
;
113 ssDefault
<< longparamtable
[i
].defaultValue
;
116 CSchema
oSchema( longparamtable
[i
].regName
,
120 longparamtable
[i
].humanReadable
);
126 for(int i(0); i
< END_OF_APP_LPS
- END_OF_APP_BPS
; ++i
) {
127 if(app_longparamtable
[i
].persistent
) {
129 std::stringstream ssDefault
;
131 ssDefault
<< app_longparamtable
[i
].iDefaultValue
;
134 CSchema
oSchema( app_longparamtable
[i
].regName
,
138 app_longparamtable
[i
].humanReadable
);
144 for(int i(0); i
< NUM_OF_SPS
; ++i
) {
145 if(stringparamtable
[i
].persistent
) {
146 CSchema
oSchema( stringparamtable
[i
].regName
,
148 stringparamtable
[i
].defaultValue
,
150 stringparamtable
[i
].humanReadable
);
156 for(int i(0); i
< END_OF_APP_SPS
- END_OF_APP_LPS
; ++i
) {
157 if(app_stringparamtable
[i
].persistent
) {
158 CSchema
oSchema( app_stringparamtable
[i
].regName
,
160 app_stringparamtable
[i
].szDefaultValue
,
162 app_stringparamtable
[i
].humanReadable
);
168 std::cout
<< "</schemalist>" << std::endl
;
169 std::cout
<< "</gconfschemafile>" << std::endl
;
175 // bool defaultValue;
176 // char *humanReadable;