8 #ifndef EPT_CORE_DESKTOPFILE_H 9 #define EPT_CORE_DESKTOPFILE_H 20 typedef std::map< std::string, Entry >
EntryMap;
28 typedef std::map< std::string, Group >
GroupMap;
35 std::string spaces =
"";
char c;
bool started =
false;
39 while ( i.peek() != EOF ) {
41 if ( !started && c ==
'\n' )
47 if ( !started && c ==
'#' ) {
48 while ( i.peek() != EOF && i.get() !=
'\n' )
62 bool backslash =
false;
64 while ( i.peek() != EOF ) {
71 if ( !started && isspace( c ) )
75 if ( c ==
'\\' ) e.
value +=
'\\';
76 else if ( c ==
'n' ) e.
value +=
'\n';
77 else if ( c ==
't' ) e.
value +=
'\t';
78 else if ( c ==
'r' ) e.
value +=
'\r';
79 else if ( c ==
's' ) e.
value +=
' ';
95 bool started =
false;
char c;
97 while ( i.peek() != EOF ) {
99 if ( !started && isspace( c ) )
101 if ( !started && c ==
'#' ) {
102 while( i.peek() != EOF && i.get() !=
'\n' )
106 if ( !started && c ==
'[' ) {
110 if ( started && c ==
']' ) {
111 while( i.peek() != EOF && i.get() !=
'\n' )
117 while ( i.peek() != EOF ) {
127 while ( i.peek() != EOF ) {
Group & group(std::string k)
Definition: desktopfile.h:30
Definition: desktopfile.h:15
Definition: desktopfile.h:22
-*- C++ -*- (c) 2006, 2007 Petr Rockai me@mornfall.net
Definition: apt.cc:43
std::istream & operator>>(std::istream &i, Category &cat)
Definition: desktop.h:41
EntryMap entries
Definition: desktopfile.h:24
std::map< std::string, Group > GroupMap
Definition: desktopfile.h:28
Entry & entry(std::string k)
Definition: desktopfile.h:25
std::string key
Definition: desktopfile.h:17
std::string name
Definition: desktopfile.h:23
GroupMap groups
Definition: desktopfile.h:29
std::string value
Definition: desktopfile.h:18
std::map< std::string, Entry > EntryMap
Definition: desktopfile.h:20
Definition: desktopfile.h:16