28 using namespace pwiz::util;
 
   29 using namespace pwiz::proteome;
 
   43         Config() : name(
"default"), done(false) {}
 
   48     virtual std::string identify(
const std::string& uri, boost::shared_ptr<std::istream> uriStreamPtr)
 const 
   50         bool result = (uri == 
"1"); 
 
   51         if (
os_) *
os_ << 
"Reader1::identify(): " << boolalpha << result << endl;
 
   52         return std::string (result?uri:std::string(
"")); 
 
   55     virtual void read(
const std::string& uri,
 
   56                       boost::shared_ptr<std::istream> uriStreamPtr,
 
   59         if (
os_) *
os_ << 
"Reader1::read()\n";
 
   63     virtual const char *
getType()
 const {
return "Reader1";} 
 
   75         Config() : color(
"orange"), done(false) {}
 
   80     virtual std::string identify(
const std::string& uri, boost::shared_ptr<std::istream> uriStreamPtr)
 const 
   82         bool result = (uri == 
"2"); 
 
   83         if (
os_) *
os_ << 
"Reader2::identify(): " << boolalpha << result << endl;
 
   84         return std::string (result?uri:std::string(
"")); 
 
   87     virtual void read(
const std::string& uri,
 
   88                       boost::shared_ptr<std::istream> uriStreamPtr,
 
   91         if (
os_) *
os_ << 
"Reader2::read()\n";
 
   95     const char *
getType()
 const {
return "Reader2";} 
 
  101     if (
os_) *
os_ << 
"testGet()\n";
 
  111     if (
os_) *
os_ << 
"reader1 config: " << reader1->config.name << endl; 
 
  113     reader1->config.name = 
"raw";
 
  114     if (
os_) *
os_ << 
"reader1 config: " << reader1->config.name << endl; 
 
  136     if (
os_) *
os_ << 
"testAccept()\n";
 
  142     if (
os_) *
os_ << 
"accept 1:\n";
 
  144     if (
os_) *
os_ << 
"accept 2:\n";
 
  146     if (
os_) *
os_ << 
"accept 3:\n";
 
  155     if (
os_) *
os_ << 
"testRead()\n";
 
  168     if (readers.
accept(
"1", shared_ptr<istream>()))
 
  169         readers.
read(
"1", shared_ptr<istream>(), pd);
 
  174     if (readers.
accept(
"2", shared_ptr<istream>()))
 
  175         readers.
read(
"2", shared_ptr<istream>(), pd);
 
  191 int main(
int argc, 
char* argv[])
 
  197         if (argc==2 && !strcmp(argv[1],
"-v")) 
os_ = &cout;