00001 // -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*- 00002 00003 /****************************************************************************** 00004 * 00005 * file: VersionVisitor.h 00006 * 00007 * Copyright (c) 2003, Michael E. Smoot . 00008 * All rights reverved. 00009 * 00010 * See the file COPYING in the top directory of this distribution for 00011 * more information. 00012 * 00013 * THE SOFTWARE IS PROVIDED _AS IS_, WITHOUT WARRANTY OF ANY KIND, EXPRESS 00014 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 00015 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 00016 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 00017 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 00018 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 00019 * DEALINGS IN THE SOFTWARE. 00020 * 00021 *****************************************************************************/ 00022 00023 00024 #ifndef TCLAP_VERSION_VISITOR_H 00025 #define TCLAP_VERSION_VISITOR_H 00026 00027 #include <tclap/CmdLineInterface.h> 00028 #include <tclap/CmdLineOutput.h> 00029 #include <tclap/Visitor.h> 00030 00031 namespace TCLAP { 00032 00037 class VersionVisitor: public Visitor 00038 { 00039 private: 00043 VersionVisitor(const VersionVisitor& rhs); 00044 VersionVisitor& operator=(const VersionVisitor& rhs); 00045 00046 protected: 00047 00051 CmdLineInterface* _cmd; 00052 00056 CmdLineOutput** _out; 00057 00058 public: 00059 00065 VersionVisitor( CmdLineInterface* cmd, CmdLineOutput** out ) 00066 : Visitor(), _cmd( cmd ), _out( out ) { } 00067 00072 void visit() { 00073 (*_out)->version(*_cmd); 00074 throw ExitException(0); 00075 } 00076 00077 }; 00078 00079 } 00080 00081 #endif