Main Page   Class Hierarchy   Alphabetical List   Data Structures   File List   Data Fields  

base.CommandLineOptionBase.h

00001 /*----------------------------------------------------------------------------
00002   SWORD 2000 - Software With Objects for Rapid Development
00003   Copyright (C) 2003 Eric NICOLAS
00004   ----------------------------------------------------------------------------
00005   SWORD is free software; you can redistribute it and/or modify
00006   it under the terms of the GNU Lesser General Public License as published by
00007   the Free Software Foundation; either version 2 of the License, or
00008   (at your option) any later version.
00009 
00010   SWORD is distributed in the hope that it will be useful,
00011   but WITHOUT ANY WARRANTY; without even the implied warranty of
00012   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013   GNU Lesser General Public License for more details.
00014 
00015   You should have received a copy of the GNU Lesser General Public License
00016   along with SWORD; if not, write to the Free Software
00017   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00018   --------------------------------------------------------------------------*/
00019 #ifndef _SWORD_BASE_COMMANDLINEOPTIONBASE_
00020 #define _SWORD_BASE_COMMANDLINEOPTIONBASE_
00021 
00022 namespace sword {
00023 
00025         class SWORDDECL CommandLineOptionBase {
00026                 friend class CommandLineManager;
00027         public:
00029 
00033                 CommandLineOptionBase(
00034                         CommandLineManager &manager,
00035                         char shortName, const std::string &longName, const std::string &help,
00036                         bool acceptValue, bool acceptMultiple);
00037 
00038                 virtual ~CommandLineOptionBase();
00039 /*
00040                 char shortName() const;
00041                 const std::string &longName() const;
00042                 const std::string &help() const;
00043 */
00045 
00048                 bool isSet() const;
00049 
00050         protected:
00051                 char        shortName_;
00052                 std::string longName_;
00053                 std::string help_;
00054                 bool        acceptValue_;
00055                 bool        acceptMultiple_;
00056                 bool        gotOne_;
00057                 bool        used_;
00058     CommandLineManager &manager_;
00059 
00060                 void print_(std::ostream &os, size_t ll) const;
00061                 virtual void push_(const std::string &value) = 0;
00062                 virtual void toggle_(bool onOff) = 0;
00063         };
00064 
00065 } // namespace sword
00066 
00067 #include "sword.private/base.CommandLineOptionBase.inl"
00068 
00069 #endif // _SWORD_BASE_COMMANDLINEOPTIONBASE_

Generated on Tue Dec 23 20:08:56 2003 for SWORD by doxygen1.3-rc2