Ignore:
Timestamp:
Sep 26, 2009, 12:57:46 AM (12 years ago)
Author:
Peter Johansson
Message:

adding missing file Exception.h.diff

File:
1 edited

Legend:

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

    r795 r824  
    22#define _theplu_yat_utility_commandline_
    33
    4 //$Id: CommandLine.h 1954 2009-05-07 15:30:58Z jari $
     4//$Id: CommandLine.h 2054 2009-09-06 18:25:06Z peter $
    55
    66/*
     
    2626#include <cctype>
    2727#include <map>
    28 #include <iostream>
     28#include <iosfwd>
    2929#include <sstream>
    3030#include <stdexcept>
     
    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
     
    129132    /**
    130133       \brief parse the commandline
     134
     135       First the commandline is parsed to detect which options are
     136       present, then each Option parses the its relevant part of
     137       commandline (Option::parse()), and finally each Option is
     138       validated (Option::validate()).
    131139
    132140       throw cmd_error if an error is detected.
Note: See TracChangeset for help on using the changeset viewer.