Changeset 2054


Ignore:
Timestamp:
Sep 6, 2009, 8:25:06 PM (11 years ago)
Author:
Peter
Message:

refs 521. Using OptionFile? and StreamRedirector? rather than deprecated classes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/yat/utility/CommandLine.h

    r2046 r2054  
    5252     CommandLine cmd;
    5353     OptionHelp help(cmd);
    54      OptionInFile in(cmd, "i,in",
    55                      "Read input from file (rather than standard input)");
    56      OptionOutFile out(cmd, "o,out", "Place the output to file");
     54     OptionFile in(cmd, "i,in",
     55                   "Read input from file (rather than standard input)",
     56                   false, true, "r");
     57     OptionFile out(cmd, "o,out", "Place the output to file", false, false, "w");
    5758     OptionSwitch target(cmd, "T,target", "treat DEST as a normal file", true);
    5859     OptionSwitch verbose(cmd, "v,verbose", "explain what is being done");
     
    7980       return EXIT_SUCCESS;
    8081     }
     82     StreamRedirect sr_out(std::cout, out.value(), out.present());
     83     StreamRedirect sr_in(std::cin, in.value(), in.present());
    8184     ...
    8285     \endcode
Note: See TracChangeset for help on using the changeset viewer.