3 #include <unicode/regex.h>
12 bool operator()( const string s1
, const string s2
) const
14 return s1
.compare( s2
) == 0;
18 typedef std::hash_map
< string
, string
> stringmap
;
19 typedef std::hash_map
< string
, stringmap
* > INImap
;
24 UErrorCode section_status
;
25 UErrorCode parameter_status
;
26 RegexMatcher
* section_match
;
27 RegexMatcher
* parameter_match
;
30 INIreader(): section_status ( U_ZERO_ERROR
) ,
31 parameter_status ( U_ZERO_ERROR
)
33 section_match
= new RegexMatcher ( "^\\s*\\[([a-zA-Z0-9]*)\\].*" , 0 , section_status
);
34 parameter_match
= new RegexMatcher ( "^\\s*([a-zA-Z0-9]*)\\s*=\\s*([a-zA-Z0-9 ]*).*" , 0 , parameter_status
) ;
39 delete parameter_match
;
41 // open "filename", fill hash_map with sections / paramaters
42 bool read( INImap
& myMap
, string
& filename
);
45 bool is_section( string
& line
, string
& section_str
);
46 bool is_parameter( string
& line
, string
& parameter_key
, string
& parameter_value
);
47 inline void check_status( UErrorCode status
);
48 inline void toStlString ( const UnicodeString
& str
, string
& stl_str
);
49 inline void trim( string
& str
);