VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Volume/Volume.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/Volume/Volume.h')
-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 30373ca1..620d0077 100644
--- a/src/Volume/Volume.h
+++ b/src/Volume/Volume.h
@@ -39,6 +39,33 @@ namespace VeraCrypt
39 39
40 bool IsDevice () const { return FilesystemPath (Data).IsBlockDevice() || FilesystemPath (Data).IsCharacterDevice(); } 40 bool IsDevice () const { return FilesystemPath (Data).IsBlockDevice() || FilesystemPath (Data).IsCharacterDevice(); }
41 bool IsEmpty () const { return Data.empty(); } 41 bool IsEmpty () const { return Data.empty(); }
42
43 wstring GetExtension () const
44 {
45 if (Data.empty() || (Data.size() == 1))
46 return L"";
47 else
48 {
49 size_t pos = Data.find_last_of (L'.');
50 if (pos == string::npos)
51 return L"";
52 return Data.substr (pos + 1);
53 }
54 }
55
56 bool HasTrueCryptExtension () const
57 {
58 wstring sExt = GetExtension ();
59 if ((sExt.size () == 2)
60 && (sExt[0] == L't' || sExt[0] == L'T')
61 && (sExt[1] == L'c' || sExt[1] == L'C')
62 )
63 {
64 return true;
65 }
66 else
67 return false;
68 }
42 69
43 protected: 70 protected:
44 wstring Data; 71 wstring Data;