00001 /* 00002 * steghide 0.5.1 - a steganography program 00003 * Copyright (C) 1999-2003 Stefan Hetzl <shetzl@chello.at> 00004 * 00005 * This program is free software; you can redistribute it and/or 00006 * modify it under the terms of the GNU General Public License 00007 * as published by the Free Software Foundation; either version 2 00008 * of the License, or (at your option) any later version. 00009 * 00010 * This program 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 General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU General Public License 00016 * along with this program; if not, write to the Free Software 00017 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00018 * 00019 */ 00020 00021 #ifndef SH_ARGUMENTS_H 00022 #define SH_ARGUMENTS_H 00023 00024 #include <string> 00025 #include <vector> 00026 00027 #include "Arg.h" 00028 00029 // to include DEBUG if defined 00030 #ifdef HAVE_CONFIG_H 00031 #include "config.h" 00032 #endif 00033 00038 class Arguments { 00039 public: 00040 Arguments (void) {} ; 00041 00045 Arguments (int argc, char *argv[]) ; 00046 00050 void parse (void) ; 00051 00055 bool stdin_isused (void) const ; 00056 00058 ArgCommand Command ; 00060 std::string CommandString ; 00061 00063 ArgString EmbFn ; 00065 ArgString ExtFn ; 00067 ArgString CvrFn ; 00069 ArgString StgFn ; 00070 ArgString Passphrase ; 00071 ArgBool Checksum ; 00072 ArgInt Compression ; 00073 ArgBool EmbedEmbFn ; 00074 ArgEncAlgo EncAlgo ; 00075 ArgEncMode EncMode ; 00076 ArgULong Radius ; 00077 ArgFloat Goal ; 00078 ArgBool Force ; 00079 ArgVerbosity Verbosity ; 00080 ArgDebugCommand DebugCommand ; 00081 ArgBool Check ; 00082 ArgStringList FileList ; 00083 ArgUInt DebugLevel ; 00084 ArgUInt GmlGraphRecDepth ; 00085 ArgUInt GmlStartVertex ; 00086 00087 std::string getPassphrase (bool doublecheck = false) ; 00088 00089 private: 00090 typedef std::vector<std::string>::const_iterator ArgIt ; 00091 00092 static const int NoCompression = 0 ; 00093 00094 static const EncryptionAlgorithm Default_EncAlgo ; 00095 static const EncryptionMode Default_EncMode ; 00096 static const bool Default_Checksum = true ; 00097 static const int Default_Compression = 9 ; // slowest, but smallest 00098 static const bool Default_EmbedEmbFn = true ; 00099 static const bool Default_Force = false ; 00100 static const VERBOSITY Default_Verbosity = NORMAL ; 00101 static const unsigned long Default_Radius = 0 ; // there is no default radius for all file formats 00102 static const unsigned int Max_Algorithm = 3 ; 00103 static float Default_Goal ; 00104 static const DEBUGCOMMAND Default_DebugCommand = NONE ; 00105 static const bool Default_Check = false ; 00106 static const unsigned int Default_DebugLevel = 0 ; 00107 static const unsigned int Default_GmlGraphRecDepth = 0 ; 00108 static const unsigned int Default_GmlStartVertex = 0 ; 00109 00116 void parse_Command (ArgIt& curarg) ; 00117 00122 bool parse_EmbFn (ArgIt& curarg) ; 00123 00124 bool parse_ExtFn (ArgIt& curarg) ; 00125 bool parse_CvrFn (ArgIt& curarg) ; 00126 bool parse_StgFn (ArgIt& curarg) ; 00127 bool parse_PassphraseFile (ArgIt& curarg) ; 00128 bool parse_Passphrase (ArgIt& curarg) ; 00129 bool parse_Checksum (ArgIt& curarg) ; 00130 bool parse_Compression (ArgIt& curarg) ; 00131 bool parse_EmbedEmbFn (ArgIt& curarg) ; 00132 bool parse_Encryption (ArgIt& curarg) ; 00133 bool parse_Radius (ArgIt& curarg) ; 00134 bool parse_Goal (ArgIt& curarg) ; 00135 bool parse_Force (ArgIt& curarg) ; 00136 bool parse_Verbosity (ArgIt& curarg) ; 00137 bool parse_Debug (ArgIt& curarg) ; 00138 00139 void setDefaults (void) ; 00140 00141 std::vector<std::string> TheArguments ; 00142 } ; 00143 00144 // gcc does not support the export keyword 00145 #include "Arg.cc" 00146 00147 #endif /* ndef SH_ARGUMENTS_H */