20 #if !defined(ZIPARCHIVE_ZIPPATHCOMPONENT_DOT_H)
21 #define ZIPARCHIVE_ZIPPATHCOMPONENT_DOT_H
25 #if defined ZIP_HAS_DLL
26 #pragma warning (push)
27 #pragma warning( disable : 4251 ) // needs to have dll-interface to be used by clients of class
31 #include "ZipString.h"
32 #include "ZipExport.h"
41 #ifdef _ZIP_SYSTEM_WIN
42 static const CZipString PathPrefix;
62 static int IsPrefixed(
const CZipString& path);
76 static CZipString AddPrefix(LPCTSTR path,
bool isFolder =
true);
87 static void AddPrefix(CZipString& path,
bool isFolder =
true);
102 SetFullPath(lpszFullPath);
115 static void AppendSeparator(CZipString& szPath)
117 RemoveSeparators(szPath);
118 szPath += m_cSeparator;
130 static void Combine(CZipString& szPath, LPCTSTR lpszName)
132 AppendSeparator(szPath);
133 if (lpszName != NULL)
143 static void RemoveSeparators(CZipString& szPath)
145 szPath.TrimRight(_T(
"\\/"));
154 static void RemoveSeparatorsLeft(CZipString& szPath)
156 szPath.TrimLeft(_T(
"\\/"));
169 static bool IsSeparator(TCHAR c)
171 return c == _T(
'\\') || c == _T(
'/');
183 static bool HasEndingSeparator(
const CZipString& szPath)
185 int iLen = szPath.GetLength();
187 return IsSeparator(szPath[iLen - 1]);
199 void SetFullPath(LPCTSTR lpszFullPath);
215 void SetFileTitle(LPCTSTR lpszFileTitle) { m_szFileTitle = lpszFileTitle;}
224 void SetExtension(LPCTSTR lpszExt)
226 m_szFileExt = lpszExt;
227 m_szFileExt.TrimLeft(_T(
'.'));
252 CZipString GetNoDrive()
const ;
260 CZipString GetFileName()
const
262 CZipString szFullFileName = m_szFileTitle;
263 if (!m_szFileExt.IsEmpty())
265 szFullFileName += _T(
".");
266 szFullFileName += m_szFileExt;
268 return szFullFileName;
277 CZipString GetFullPath()
const
279 CZipString szFullPath = GetFilePath();
280 CZipString szFileName = GetFileName();
281 if (!szFileName.IsEmpty())
283 if (szFullPath.IsEmpty())
284 szFullPath += _T(
'.');
285 szFullPath += m_cSeparator;
286 szFullPath += szFileName;
297 CZipString GetFilePath()
const
299 CZipString szDrive = m_szDrive;
300 CZipString szDir = m_szDirectory;
301 if (!szDrive.IsEmpty() && !szDir.IsEmpty())
302 szDrive += m_cSeparator;
304 return m_szPrefix + szDrive + szDir;
311 CZipString m_szDirectory,
320 #if (_MSC_VER > 1000) && (defined ZIP_HAS_DLL)
321 #pragma warning (pop)
325 #endif // !defined(ZIPARCHIVE_ZIPPATHCOMPONENT_DOT_H)