|
@@ -15,12 +15,6 @@ CServerPath::CServerPath()
|
|
m_bEmpty = TRUE;
|
|
m_bEmpty = TRUE;
|
|
}
|
|
}
|
|
|
|
|
|
-CServerPath::CServerPath(int nServerType)
|
|
|
|
-{
|
|
|
|
- m_nServerType = nServerType;
|
|
|
|
- m_bEmpty = TRUE;
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
CServerPath::CServerPath(CString path, bool trim)
|
|
CServerPath::CServerPath(CString path, bool trim)
|
|
{
|
|
{
|
|
m_nServerType = FZ_SERVERTYPE_FTP;
|
|
m_nServerType = FZ_SERVERTYPE_FTP;
|
|
@@ -575,195 +569,6 @@ BOOL CServerPath::AddSubdir(CString subdir)
|
|
return TRUE;
|
|
return TRUE;
|
|
}
|
|
}
|
|
|
|
|
|
-CServerPath::CServerPath(CString subdir, const CServerPath &parent)
|
|
|
|
-{
|
|
|
|
- *this=parent;
|
|
|
|
- subdir.TrimLeft( L" " );
|
|
|
|
- subdir.TrimRight( L" " );
|
|
|
|
-
|
|
|
|
- if ( subdir==L"" )
|
|
|
|
- {
|
|
|
|
- if (IsEmpty())
|
|
|
|
- DebugFail();
|
|
|
|
- else
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (!(m_nServerType&FZ_SERVERTYPE_HIGHMASK))
|
|
|
|
- m_nServerType=FZ_SERVERTYPE_FTP;
|
|
|
|
-
|
|
|
|
- m_bEmpty = FALSE;
|
|
|
|
-
|
|
|
|
- switch (m_nServerType&FZ_SERVERTYPE_HIGHMASK)
|
|
|
|
- {
|
|
|
|
- case FZ_SERVERTYPE_FTP:
|
|
|
|
- switch(m_nServerType&FZ_SERVERTYPE_SUBMASK)
|
|
|
|
- {
|
|
|
|
- case FZ_SERVERTYPE_SUB_FTP_MVS:
|
|
|
|
- case FZ_SERVERTYPE_SUB_FTP_BS2000:
|
|
|
|
- {
|
|
|
|
- subdir.TrimLeft(FTP_MVS_DOUBLE_QUOTA);
|
|
|
|
- subdir.TrimRight(FTP_MVS_DOUBLE_QUOTA);
|
|
|
|
-
|
|
|
|
- if (subdir.Left(1) == L"'")
|
|
|
|
- {
|
|
|
|
- if (subdir.Right(1) == L"'")
|
|
|
|
- {
|
|
|
|
- if (!SetPath(subdir))
|
|
|
|
- m_bEmpty = true;
|
|
|
|
- }
|
|
|
|
- else
|
|
|
|
- m_bEmpty = true;
|
|
|
|
- }
|
|
|
|
- else if (subdir.Right(1) == L"'")
|
|
|
|
- m_bEmpty = true;
|
|
|
|
- else if (!m_bEmpty)
|
|
|
|
- {
|
|
|
|
- if (m_Prefix != L".")
|
|
|
|
- m_bEmpty = true;
|
|
|
|
- else
|
|
|
|
- {
|
|
|
|
- subdir.TrimLeft(L'.');
|
|
|
|
- while (subdir.Replace(L"..", L"."));
|
|
|
|
-
|
|
|
|
- int pos = subdir.Find(L'.');
|
|
|
|
- while (pos != -1)
|
|
|
|
- {
|
|
|
|
- m_Segments.push_back(subdir.Left(pos));
|
|
|
|
- subdir = subdir.Mid(pos + 1);
|
|
|
|
- pos = subdir.Find(L'.');
|
|
|
|
- }
|
|
|
|
- if (subdir != L"")
|
|
|
|
- {
|
|
|
|
- m_Prefix = L"";
|
|
|
|
- m_Segments.push_back(subdir);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- else if (!SetPath(subdir))
|
|
|
|
- m_bEmpty = true;
|
|
|
|
- }
|
|
|
|
- break;
|
|
|
|
- case FZ_SERVERTYPE_SUB_FTP_VMS:
|
|
|
|
- {
|
|
|
|
- int pos1=subdir.Find( L"[" );
|
|
|
|
- if (pos1==-1)
|
|
|
|
- {
|
|
|
|
- DebugAssert( subdir.Right(1)!=L"]" );
|
|
|
|
- while ( subdir.Replace( L"..", L"." ) );
|
|
|
|
- }
|
|
|
|
- else
|
|
|
|
- {
|
|
|
|
- if (subdir.Right(1)!=L"]")
|
|
|
|
- DebugFail();
|
|
|
|
- subdir=subdir.Left(subdir.GetLength()-1);
|
|
|
|
- if (pos1)
|
|
|
|
- m_Prefix=subdir.Left(pos1);
|
|
|
|
- else
|
|
|
|
- m_Prefix=L"";
|
|
|
|
- m_Segments.clear();
|
|
|
|
- subdir=subdir.Mid(pos1+1);
|
|
|
|
-
|
|
|
|
- DebugAssert(subdir.Find( L"[" )==-1 && subdir.Find( L"]" )==-1);
|
|
|
|
- }
|
|
|
|
- int pos=subdir.Find( L"." );
|
|
|
|
- while(pos!=-1)
|
|
|
|
- {
|
|
|
|
- m_Segments.push_back(subdir.Left(pos));
|
|
|
|
- subdir=subdir.Mid(pos+1);
|
|
|
|
- pos=subdir.Find( L"." );
|
|
|
|
- }
|
|
|
|
- if (subdir!=L"")
|
|
|
|
- m_Segments.push_back(subdir);
|
|
|
|
- }
|
|
|
|
- break;
|
|
|
|
- case FZ_SERVERTYPE_SUB_FTP_WINDOWS:
|
|
|
|
- {
|
|
|
|
- subdir.Replace( L"\\", L"/" );
|
|
|
|
- while(subdir.Replace( L"//", L"/" ));
|
|
|
|
- if (subdir.GetLength() >= 2 && subdir[1] == L':')
|
|
|
|
- m_Segments.clear();
|
|
|
|
- else if (subdir[0]==L'/')
|
|
|
|
- {
|
|
|
|
- CString firstSegment;
|
|
|
|
- if (m_Segments.empty())
|
|
|
|
- firstSegment = L"C:";
|
|
|
|
- else
|
|
|
|
- firstSegment = m_Segments.front();
|
|
|
|
- m_Segments.clear();
|
|
|
|
- m_Segments.push_back(firstSegment);
|
|
|
|
- subdir.TrimLeft( L"/" );
|
|
|
|
- }
|
|
|
|
- subdir.TrimRight( L"/" );
|
|
|
|
- int pos = subdir.Find( L"/" );
|
|
|
|
- while(pos!=-1)
|
|
|
|
- {
|
|
|
|
- m_Segments.push_back(subdir.Left(pos));
|
|
|
|
- subdir=subdir.Mid(pos+1);
|
|
|
|
- pos=subdir.Find( L"/" );
|
|
|
|
- }
|
|
|
|
- if (subdir!=L"")
|
|
|
|
- m_Segments.push_back(subdir);
|
|
|
|
- break;
|
|
|
|
- }
|
|
|
|
- default:
|
|
|
|
- subdir.Replace( L"\\", L"/" );
|
|
|
|
- while(subdir.Replace( L"//", L"/" ));
|
|
|
|
- if (subdir[0]==L'/')
|
|
|
|
- {
|
|
|
|
- m_Segments.clear();
|
|
|
|
- subdir.TrimLeft( L"/" );
|
|
|
|
- }
|
|
|
|
- subdir.TrimRight( L"/" );
|
|
|
|
- int pos=subdir.Find( L"/" );
|
|
|
|
- while(pos!=-1)
|
|
|
|
- {
|
|
|
|
- m_Segments.push_back(subdir.Left(pos));
|
|
|
|
- subdir=subdir.Mid(pos+1);
|
|
|
|
- pos=subdir.Find( L"/" );
|
|
|
|
- }
|
|
|
|
- if (subdir!=L"")
|
|
|
|
- m_Segments.push_back(subdir);
|
|
|
|
- break;
|
|
|
|
- }
|
|
|
|
- break;
|
|
|
|
- case FZ_SERVERTYPE_LOCAL:
|
|
|
|
- {
|
|
|
|
- subdir.TrimRight( L"\\" );
|
|
|
|
- while (subdir.Replace( L"\\\\", L"\\" ));
|
|
|
|
- subdir.TrimLeft( L"\\" );
|
|
|
|
- int pos=subdir.Find( L":" );
|
|
|
|
-
|
|
|
|
- if (pos==1) //subdir is absolute path
|
|
|
|
- {
|
|
|
|
- m_Segments.clear();
|
|
|
|
- m_Prefix=subdir.Left(pos+1);
|
|
|
|
- subdir=subdir.Mid(pos+1);
|
|
|
|
- subdir.TrimLeft( L"\\" );
|
|
|
|
- if (subdir.Find( L":" )!=-1)
|
|
|
|
- DebugFail();
|
|
|
|
- }
|
|
|
|
- if (pos==-1 || pos==1)
|
|
|
|
- {
|
|
|
|
- pos=subdir.Find( L"\\" );
|
|
|
|
- while (pos!=-1)
|
|
|
|
- {
|
|
|
|
- m_Segments.push_back(subdir.Left(pos));
|
|
|
|
- subdir=subdir.Mid(pos+1);
|
|
|
|
- pos=subdir.Find( L"\\" );
|
|
|
|
- }
|
|
|
|
- if ( subdir!=L"" )
|
|
|
|
- m_Segments.push_back(subdir);
|
|
|
|
- }
|
|
|
|
- else
|
|
|
|
- DebugFail();
|
|
|
|
- }
|
|
|
|
- break;
|
|
|
|
- default:
|
|
|
|
- DebugFail();
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
BOOL CServerPath::SetPath(CString newpath)
|
|
BOOL CServerPath::SetPath(CString newpath)
|
|
{
|
|
{
|
|
return SetPath(newpath, FALSE);
|
|
return SetPath(newpath, FALSE);
|