other-licenses/7zstub/src/Windows/FileName.h

Fri, 16 Jan 2015 18:13:44 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Fri, 16 Jan 2015 18:13:44 +0100
branch
TOR_BUG_9701
changeset 14
925c144e1f1f
permissions
-rw-r--r--

Integrate suggestion from review to improve consistency with existing code.

michael@0 1 // Windows/FileName.h
michael@0 2
michael@0 3 #ifndef __WINDOWS_FILENAME_H
michael@0 4 #define __WINDOWS_FILENAME_H
michael@0 5
michael@0 6 #include "../Common/String.h"
michael@0 7
michael@0 8 namespace NWindows {
michael@0 9 namespace NFile {
michael@0 10 namespace NName {
michael@0 11
michael@0 12 const TCHAR kDirDelimiter = CHAR_PATH_SEPARATOR;
michael@0 13 const TCHAR kAnyStringWildcard = '*';
michael@0 14
michael@0 15 void NormalizeDirPathPrefix(CSysString &dirPath); // ensures that it ended with '\\'
michael@0 16 #ifndef _UNICODE
michael@0 17 void NormalizeDirPathPrefix(UString &dirPath); // ensures that it ended with '\\'
michael@0 18 #endif
michael@0 19
michael@0 20 namespace NPathType
michael@0 21 {
michael@0 22 enum EEnum
michael@0 23 {
michael@0 24 kLocal,
michael@0 25 kUNC
michael@0 26 };
michael@0 27 EEnum GetPathType(const UString &path);
michael@0 28 }
michael@0 29
michael@0 30 struct CParsedPath
michael@0 31 {
michael@0 32 UString Prefix; // Disk or UNC with slash
michael@0 33 UStringVector PathParts;
michael@0 34 void ParsePath(const UString &path);
michael@0 35 UString MergePath() const;
michael@0 36 };
michael@0 37
michael@0 38 void SplitNameToPureNameAndExtension(const UString &fullName,
michael@0 39 UString &pureName, UString &extensionDelimiter, UString &extension);
michael@0 40
michael@0 41 }}}
michael@0 42
michael@0 43 #endif

mercurial