"Fossies" - the Fresh Open Source Software Archive

Member "src/Main/CommandLineInterface.h" (10 Oct 2018, 2970 Bytes) of package /windows/misc/VeraCrypt_1.23-Hotfix-2_Source.zip:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "CommandLineInterface.h" see the Fossies "Dox" file reference documentation.

    1 /*
    2  Derived from source code of TrueCrypt 7.1a, which is
    3  Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
    4  by the TrueCrypt License 3.0.
    5 
    6  Modifications and additions to the original source code (contained in this file)
    7  and all other portions of this file are Copyright (c) 2013-2017 IDRIX
    8  and are governed by the Apache License 2.0 the full text of which is
    9  contained in the file License.txt included in VeraCrypt binary and source
   10  code distribution packages.
   11 */
   12 
   13 #ifndef TC_HEADER_Main_CommandInterface
   14 #define TC_HEADER_Main_CommandInterface
   15 
   16 #include "System.h"
   17 #include "Main.h"
   18 #include "Volume/VolumeInfo.h"
   19 #include "Core/MountOptions.h"
   20 #include "Core/VolumeCreator.h"
   21 #include "UserPreferences.h"
   22 #include "UserInterfaceType.h"
   23 
   24 namespace VeraCrypt
   25 {
   26     struct CommandId
   27     {
   28         enum Enum
   29         {
   30             None,
   31             AutoMountDevices,
   32             AutoMountDevicesFavorites,
   33             AutoMountFavorites,
   34             BackupHeaders,
   35             ChangePassword,
   36             CreateKeyfile,
   37             CreateVolume,
   38             DeleteSecurityTokenKeyfiles,
   39             DismountVolumes,
   40             DisplayVersion,
   41             DisplayVolumeProperties,
   42             ExportSecurityTokenKeyfile,
   43             Help,
   44             ImportSecurityTokenKeyfiles,
   45             ListSecurityTokenKeyfiles,
   46             ListVolumes,
   47             MountVolume,
   48             RestoreHeaders,
   49             SavePreferences,
   50             Test
   51         };
   52     };
   53 
   54     struct CommandLineInterface
   55     {
   56     public:
   57         CommandLineInterface (int argc, wchar_t** argv, UserInterfaceType::Enum interfaceType);
   58         virtual ~CommandLineInterface ();
   59 
   60 
   61         CommandId::Enum ArgCommand;
   62         bool ArgDisplayPassword;
   63         shared_ptr <EncryptionAlgorithm> ArgEncryptionAlgorithm;
   64         shared_ptr <FilePath> ArgFilePath;
   65         VolumeCreationOptions::FilesystemType::Enum ArgFilesystem;
   66         bool ArgForce;
   67         shared_ptr <Hash> ArgHash;
   68         shared_ptr <KeyfileList> ArgKeyfiles;
   69         MountOptions ArgMountOptions;
   70         shared_ptr <DirectoryPath> ArgMountPoint;
   71         shared_ptr <Hash> ArgNewHash;
   72         shared_ptr <KeyfileList> ArgNewKeyfiles;
   73         shared_ptr <VolumePassword> ArgNewPassword;
   74         int ArgNewPim;
   75         bool ArgNoHiddenVolumeProtection;
   76         shared_ptr <VolumePassword> ArgPassword;
   77         int ArgPim;
   78         bool ArgQuick;
   79         FilesystemPath ArgRandomSourcePath;
   80         uint64 ArgSize;
   81         shared_ptr <VolumePath> ArgVolumePath;
   82         VolumeInfoList ArgVolumes;
   83         VolumeType::Enum ArgVolumeType;
   84         bool ArgTrueCryptMode;
   85         shared_ptr<SecureBuffer> ArgTokenPin;
   86 
   87         bool StartBackgroundTask;
   88         UserPreferences Preferences;
   89 
   90     protected:
   91         void CheckCommandSingle () const;
   92         shared_ptr <KeyfileList> ToKeyfileList (const wxString &arg) const;
   93         VolumeInfoList GetMountedVolumes (const wxString &filter) const;
   94 
   95     private:
   96         CommandLineInterface (const CommandLineInterface &);
   97         CommandLineInterface &operator= (const CommandLineInterface &);
   98     };
   99 
  100     shared_ptr<VolumePassword> ToUTF8Password (const wchar_t* str, size_t charCount = (size_t) -1);
  101     shared_ptr<SecureBuffer> ToUTF8Buffer (const wchar_t* str, size_t charCount = (size_t) -1);
  102 
  103     extern auto_ptr <CommandLineInterface> CmdLine;
  104 }
  105 
  106 #endif // TC_HEADER_Main_CommandInterface