Blame samples/metacopy.hpp

Packit Service 21b5d1
// ***************************************************************** -*- C++ -*-
Packit Service 21b5d1
/*
Packit Service 21b5d1
 * This program is part of the Exiv2 distribution.
Packit Service 21b5d1
 *
Packit Service 21b5d1
 * This program is free software; you can redistribute it and/or
Packit Service 21b5d1
 * modify it under the terms of the GNU General Public License
Packit Service 21b5d1
 * as published by the Free Software Foundation; either version 2
Packit Service 21b5d1
 * of the License, or (at your option) any later version.
Packit Service 21b5d1
 *
Packit Service 21b5d1
 * This program is distributed in the hope that it will be useful,
Packit Service 21b5d1
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service 21b5d1
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit Service 21b5d1
 * GNU General Public License for more details.
Packit Service 21b5d1
 *
Packit Service 21b5d1
 * You should have received a copy of the GNU General Public License
Packit Service 21b5d1
 * along with this program; if not, write to the Free Software
Packit Service 21b5d1
 * Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301 USA.
Packit Service 21b5d1
 */
Packit Service 21b5d1
/*!
Packit Service 21b5d1
  @file    metacopy.hpp
Packit Service 21b5d1
  @brief   Defines class Params, used for the command line handling
Packit Service 21b5d1
  @author  Brad Schick (brad) <brad@robotbattle.com>
Packit Service 21b5d1
  @date    13-Jul-04, brad: created
Packit Service 21b5d1
 */
Packit Service 21b5d1
#ifndef METACOPY_HPP_
Packit Service 21b5d1
#define METACOPY_HPP_
Packit Service 21b5d1
Packit Service 21b5d1
class Params : public Util::Getopt {
Packit Service 21b5d1
private:
Packit Service 21b5d1
    std::string optstring_;
Packit Service 21b5d1
    bool first_;
Packit Service 21b5d1
Packit Service 21b5d1
public:
Packit Service 21b5d1
    bool help_;                    //!< Help option flag.
Packit Service 21b5d1
    bool iptc_;                    //!< Iptc option flag.
Packit Service 21b5d1
    bool exif_;                    //!< Exif option flag.
Packit Service 21b5d1
    bool comment_;                 //!< JPEG comment option flag.
Packit Service 21b5d1
    bool xmp_;                     //!< XMP option flag.
Packit Service 21b5d1
    bool preserve_;                //!< Preserve existing metadata option flag.
Packit Service 21b5d1
    std::string read_;             //!< Source file
Packit Service 21b5d1
    std::string write_;            //!< Destination file
Packit Service 21b5d1
Packit Service 21b5d1
public:
Packit Service 21b5d1
    /*!
Packit Service 21b5d1
      @brief Default constructor. Note that optstring_ is initialized here.
Packit Service 21b5d1
     */
Packit Service 21b5d1
    Params() : optstring_(":iecaph"),
Packit Service 21b5d1
               first_(true),
Packit Service 21b5d1
               help_(false),
Packit Service 21b5d1
               iptc_(false),
Packit Service 21b5d1
               exif_(false),
Packit Service 21b5d1
               comment_(false),
Packit Service 21b5d1
               xmp_(false),
Packit Service 21b5d1
               preserve_(false)
Packit Service 21b5d1
        {}
Packit Service 21b5d1
Packit Service 21b5d1
    /*!
Packit Service 21b5d1
      @brief Call Getopt::getopt() with optstring, to initiate command line
Packit Service 21b5d1
             argument parsing, perform consistency checks after all command line
Packit Service 21b5d1
             arguments are parsed.
Packit Service 21b5d1
Packit Service 21b5d1
      @param argc Argument count as passed to main() on program invocation.
Packit Service 21b5d1
      @param argv Argument array as passed to main() on program invocation.
Packit Service 21b5d1
Packit Service 21b5d1
      @return 0 if successful, >0 in case of errors.
Packit Service 21b5d1
     */
Packit Service 21b5d1
    int getopt(int argc, char* const argv[]);
Packit Service 21b5d1
Packit Service 21b5d1
    //! Handle options and their arguments.
Packit Service 21b5d1
    virtual int option(int opt, const std::string& optarg, int optopt);
Packit Service 21b5d1
Packit Service 21b5d1
    //! Handle non-option parameters.
Packit Service 21b5d1
    virtual int nonoption(const std::string& argv);
Packit Service 21b5d1
Packit Service 21b5d1
    //! Print a minimal usage note to an output stream.
Packit Service 21b5d1
    void usage(std::ostream& os =std::cout) const;
Packit Service 21b5d1
Packit Service 21b5d1
    //! Print further usage explanations to an output stream.
Packit Service 21b5d1
    void help(std::ostream& os =std::cout) const;
Packit Service 21b5d1
Packit Service 21b5d1
}; // class Params
Packit Service 21b5d1
Packit Service 21b5d1
#endif // METACOPY_HPP_