VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Volume
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2016-12-18 14:26:35 (GMT)
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2016-12-25 23:00:04 (GMT)
commit1ef6177ae3605b4aa24beb6d9a0da214c15e100e (patch)
tree91276de7861c42faccce3efecb4e55aa5af8b9a0 /src/Volume
parenta8fea1d64358793691418089552b6bb9ab32d189 (diff)
downloadVeraCrypt-1ef6177ae3605b4aa24beb6d9a0da214c15e100e.zip
VeraCrypt-1ef6177ae3605b4aa24beb6d9a0da214c15e100e.tar.gz
Linux & MacOSX: automatically check TrueCryptMode in password dialog when selecting a container file that has the .tc file extension
Diffstat (limited to 'src/Volume')
-rw-r--r--src/Volume/Volume.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/Volume/Volume.h b/src/Volume/Volume.h
index 30373ca..620d007 100644
--- a/src/Volume/Volume.h
+++ b/src/Volume/Volume.h
@@ -39,6 +39,33 @@ namespace VeraCrypt
bool IsDevice () const { return FilesystemPath (Data).IsBlockDevice() || FilesystemPath (Data).IsCharacterDevice(); }
bool IsEmpty () const { return Data.empty(); }
+
+ wstring GetExtension () const
+ {
+ if (Data.empty() || (Data.size() == 1))
+ return L"";
+ else
+ {
+ size_t pos = Data.find_last_of (L'.');
+ if (pos == string::npos)
+ return L"";
+ return Data.substr (pos + 1);
+ }
+ }
+
+ bool HasTrueCryptExtension () const
+ {
+ wstring sExt = GetExtension ();
+ if ((sExt.size () == 2)
+ && (sExt[0] == L't' || sExt[0] == L'T')
+ && (sExt[1] == L'c' || sExt[1] == L'C')
+ )
+ {
+ return true;
+ }
+ else
+ return false;
+ }
protected:
wstring Data;