Revision 907, 1.4 kB
(checked in by mido, 14 years ago)
|
LOG LEVEL improved and hopefully finished
|
-
Property svn:eol-style set to
native
|
Line | |
---|
1 | #include "bdmroot.h" |
---|
2 | |
---|
3 | //! Space of basic BDM structures |
---|
4 | namespace bdm { |
---|
5 | |
---|
6 | //! a general utility transforming a comma-separated sequence of strings into an instance of Array<strings> |
---|
7 | Array<string> log_level_base::string2Array( const string &input ) |
---|
8 | { |
---|
9 | string result = input; |
---|
10 | string::size_type loc; |
---|
11 | while( loc = result.find( ',' ), loc != string::npos ) |
---|
12 | result[loc] = ' '; |
---|
13 | return Array<string>("{ " + result + " }" ); |
---|
14 | } |
---|
15 | |
---|
16 | void UI_DBG (const Setting &S, const string &spc, ostream &out =cout){ |
---|
17 | const char *Name=S.getName(); |
---|
18 | if ( Name!=NULL ) {out << spc << std::string ( Name );}; |
---|
19 | Setting::Type T=S.getType(); |
---|
20 | switch ( T ) { |
---|
21 | case Setting::TypeArray: |
---|
22 | out << endl; |
---|
23 | for ( int i=0;i<S.getLength();i++ ) {UI_DBG ( S[i], spc+" ", out);}; |
---|
24 | break; |
---|
25 | case Setting::TypeList: |
---|
26 | out << endl; |
---|
27 | for ( int i=0;i<S.getLength();i++ ) {UI_DBG ( S[i], spc+" ", out );}; |
---|
28 | break; |
---|
29 | case Setting::TypeGroup: |
---|
30 | out << endl; |
---|
31 | for ( int i=0;i<S.getLength();i++ ) {UI_DBG ( S[i], spc+" ", out );} |
---|
32 | break; |
---|
33 | case Setting::TypeInt: |
---|
34 | out << " = "; |
---|
35 | out << int ( S ) <<endl; |
---|
36 | break; |
---|
37 | case Setting::TypeFloat: |
---|
38 | out << " = "; |
---|
39 | out << double ( S ) <<endl; |
---|
40 | break; |
---|
41 | case Setting::TypeString: |
---|
42 | out << " = "; |
---|
43 | out << ( const char* ) ( S ) <<endl; |
---|
44 | break; |
---|
45 | case Setting::TypeBoolean: |
---|
46 | out << " = "; |
---|
47 | out << bool ( S ) <<endl; |
---|
48 | break; |
---|
49 | default: {out << "?";}; |
---|
50 | }; |
---|
51 | } |
---|
52 | |
---|
53 | } |
---|