11 #include <wibble/range.h>
12 #include <wibble/mixin.h>
20 struct Entry : wibble::mixin::Comparable< Entry > {
27 std::string u =
"", std::string d =
"",
58 return not ( ( *
this < e ) || ( e < *
this ) );
64 std::ostream_iterator< std::string >( s,
" " ) );
69 std::istringstream i( s );
71 std::copy( std::istream_iterator< std::string >( i ),
72 std::istream_iterator< std::string >(),
80 case Source:
return "deb-src";
121 wibble::consumer(
m_entries ).consume( e );
125 void enable(
const Entry & );
136 bool bracket =
false, quote =
false, started =
false;
141 if (started && !quote && !bracket && isspace( c ))
147 if (bracket && c ==
']')
149 if (quote && c ==
'"')
151 if (!quote && c ==
'[')
153 if (!bracket && c ==
'"')
160 std::string line, tmp;
161 std::getline( i, line );
162 std::istringstream l( line );
174 if (tmp ==
"deb" || tmp ==
"deb-src") {
184 l >> w; e.
m_url = w.s;
187 std::copy( std::istream_iterator< std::string >( l ),
188 std::istream_iterator< std::string >(),
205 std::copy( std::istream_iterator< Sources::Entry >( i ),
206 std::istream_iterator< Sources::Entry >(),
213 std::ostream_iterator< Sources::Entry >( o,
"\n" ) );