33 std::map<wxString, wxString>
kv;
46 if( ( line.size() > 2 && line[line.size() - 2] ==
'|' && line[line.size() - 1] ==
'>' ) )
48 str.append( line, 0, line.size() - 2 );
57 std::size_t token_end = 0;
59 while( token_end < str.size() && token_end != std::string::npos )
61 std::size_t token_start = str.find(
'|', token_end );
62 std::size_t token_equal = str.find(
'=', token_end );
63 std::size_t key_start;
65 if( token_start <= token_equal )
67 key_start = token_start + 1;
72 key_start = token_end;
75 token_end = str.find(
'|', key_start );
77 if( token_equal >= token_end )
82 if( token_end == std::string::npos )
84 token_end = str.size() + 1;
87 std::string keyS = str.substr( key_start, token_equal - key_start );
88 std::string valueS = str.substr( token_equal + 1, token_end - token_equal - 1 );
92 wxString key( keyS.c_str(), wxConvISO8859_1 );
95 wxString canonicalKey = key.Trim(
false ).Trim(
true ).MakeUpper();
100 if( canonicalKey.StartsWith(
"%UTF8%" ) )
101 value = wxString( valueS.c_str(), wxConvUTF8 );
103 value = wxString( valueS.c_str(), wxConvISO8859_1 );
105 if( canonicalKey != wxS(
"PATTERN" ) && canonicalKey != wxS(
"SOURCEFOOTPRINTLIBRARY" ) )
109 value.Replace( wxT(
"ÿ" ), wxT(
" " ) );
113 if( str.rfind(
"|BINARY", 0 ) != 0 )
115 if( canonicalKey == wxT(
"DESIGNATOR" ) || canonicalKey == wxT(
"NAME" )
116 || canonicalKey == wxT(
"TEXT" ) )
118 wxString recordType =
kv[ wxT(
"RECORD" ) ];
121 if( recordType != wxT(
"4" ) && recordType != wxT(
"33" ) )
126 kv.insert( { canonicalKey, value.Trim() } );