MCPcopy Create free account
hub / github.com/bailey27/cppcryptfs / get_file_directory

Function get_file_directory

libcppcryptfs/filename/cryptfilename.cpp:1023–1046  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1021}
1022
1023bool
1024get_file_directory(LPCWSTR filepath, wstring& dirpath)
1025{
1026 size_t len = wcslen(filepath);
1027
1028 if (len < 1)
1029 return false;
1030
1031 const WCHAR *lastslash = wcsrchr(filepath, '\\');
1032
1033 if (!lastslash)
1034 return false;
1035
1036 if (lastslash == filepath) {
1037 dirpath = L"\\";
1038 return true;
1039 }
1040
1041 dirpath = filepath;
1042
1043 dirpath = dirpath.substr(0, lastslash - filepath);
1044
1045 return true;
1046}
1047
1048const WCHAR * // returns base64-encoded, encrypted stream name. input stream name is expected to start with colon
1049encrypt_stream_name(const CryptContext *con, const unsigned char *dir_iv, const WCHAR *stream, wstring& storage)

Callers 7

ConvertMethod · 0.85
read_virtual_fileFunction · 0.85
get_file_informationFunction · 0.85
convert_find_stream_dataFunction · 0.85
get_actual_encryptedFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected