diff options
author | wolfbeast <mcwerewolf@wolfbeast.com> | 2019-03-29 16:04:01 +0100 |
---|---|---|
committer | wolfbeast <mcwerewolf@wolfbeast.com> | 2019-03-29 16:04:01 +0100 |
commit | 88083f8c683c18f4de68a20c863a82a9da65db8f (patch) | |
tree | 926656892d9d80260da02ea8ea71031b140c51df /other-licenses/7zstub/src/Windows/FileName.cpp | |
parent | f999f544aad04069b03704d994a99352263f600b (diff) | |
parent | 843e4ceffd6ce21a6e6db37419335eafdc543e18 (diff) | |
download | UXP-88083f8c683c18f4de68a20c863a82a9da65db8f.tar UXP-88083f8c683c18f4de68a20c863a82a9da65db8f.tar.gz UXP-88083f8c683c18f4de68a20c863a82a9da65db8f.tar.lz UXP-88083f8c683c18f4de68a20c863a82a9da65db8f.tar.xz UXP-88083f8c683c18f4de68a20c863a82a9da65db8f.zip |
Merge branch 'master' into Sync-weave
Diffstat (limited to 'other-licenses/7zstub/src/Windows/FileName.cpp')
-rw-r--r-- | other-licenses/7zstub/src/Windows/FileName.cpp | 111 |
1 files changed, 0 insertions, 111 deletions
diff --git a/other-licenses/7zstub/src/Windows/FileName.cpp b/other-licenses/7zstub/src/Windows/FileName.cpp deleted file mode 100644 index 4a8a504e3..000000000 --- a/other-licenses/7zstub/src/Windows/FileName.cpp +++ /dev/null @@ -1,111 +0,0 @@ -// Windows/FileName.cpp
-
-#include "StdAfx.h"
-
-#include "Windows/FileName.h"
-#include "Common/Wildcard.h"
-
-namespace NWindows {
-namespace NFile {
-namespace NName {
-
-static const wchar_t kDiskDelimiter = L':';
-
-/*
-static bool IsCharAPrefixDelimiter(wchar_t c)
- { return (c == kDirDelimiter || c == kDiskDelimiter); }
-*/
-
-void NormalizeDirPathPrefix(CSysString &dirPath)
-{
- if (dirPath.IsEmpty())
- return;
- if (dirPath.ReverseFind(kDirDelimiter) != dirPath.Length() - 1)
- dirPath += kDirDelimiter;
-}
-
-#ifndef _UNICODE
-void NormalizeDirPathPrefix(UString &dirPath)
-{
- if (dirPath.IsEmpty())
- return;
- if (dirPath.ReverseFind(wchar_t(kDirDelimiter)) != dirPath.Length() - 1)
- dirPath += wchar_t(kDirDelimiter);
-}
-#endif
-
-namespace NPathType
-{
- EEnum GetPathType(const UString &path)
- {
- if (path.Length() <= 2)
- return kLocal;
- if (path[0] == kDirDelimiter && path[1] == kDirDelimiter)
- return kUNC;
- return kLocal;
- }
-}
-
-void CParsedPath::ParsePath(const UString &path)
-{
- int curPos = 0;
- switch (NPathType::GetPathType(path))
- {
- case NPathType::kLocal:
- {
- int posDiskDelimiter = path.Find(kDiskDelimiter);
- if(posDiskDelimiter >= 0)
- {
- curPos = posDiskDelimiter + 1;
- if (path.Length() > curPos)
- if(path[curPos] == kDirDelimiter)
- curPos++;
- }
- break;
- }
- case NPathType::kUNC:
- {
- int curPos = path.Find(kDirDelimiter, 2);
- if(curPos < 0)
- curPos = path.Length();
- else
- curPos++;
- }
- }
- Prefix = path.Left(curPos);
- SplitPathToParts(path.Mid(curPos), PathParts);
-}
-
-UString CParsedPath::MergePath() const
-{
- UString result = Prefix;
- for(int i = 0; i < PathParts.Size(); i++)
- {
- if (i != 0)
- result += kDirDelimiter;
- result += PathParts[i];
- }
- return result;
-}
-
-const wchar_t kExtensionDelimiter = L'.';
-
-void SplitNameToPureNameAndExtension(const UString &fullName,
- UString &pureName, UString &extensionDelimiter, UString &extension)
-{
- int index = fullName.ReverseFind(kExtensionDelimiter);
- if (index < 0)
- {
- pureName = fullName;
- extensionDelimiter.Empty();
- extension.Empty();
- }
- else
- {
- pureName = fullName.Left(index);
- extensionDelimiter = kExtensionDelimiter;
- extension = fullName.Mid(index + 1);
- }
-}
-
-}}}
|