m_pCtxt = pCtxt;
}
+
+
+CString GetPathOnly( const CString& sString )
+{
+ int nIdx = sString.GetLength();
+
+ CString sReturn;
+
+ while ( nIdx-- ) {
+
+ if ( sString.GetAt(nIdx) == '/' || sString.GetAt(nIdx) == '\\' ) {
+ if ( nIdx > 1 ) {
+ char* pszRet = sReturn.GetBufferSetLength( nIdx );
+ strncpy( pszRet, sString, nIdx );
+ pszRet[nIdx] = '\0';
+ sReturn.ReleaseBuffer();
+ }
+ }
+ }
+
+ return sReturn;
+}
+
+
+//
+// extension does not have '.'
+//
+void SplitFilename( LPCTSTR pathLeft, CString* pPath, CString* pFile, CString* pExt )
+{
+ const TCHAR* pszChar = pathLeft + strlen(pathLeft);
+
+ while ( pathLeft < --pszChar ) {
+ if ( *pszChar == '.' && pExt != NULL && pExt->GetLength() == 0 ) {
+
+ *pExt = pszChar + 1;
+ }
+ else if ( *pszChar == '/' || *pszChar == '\\' ) {
+
+ // Set the directory
+ if ( pPath != NULL ) {
+ char* pszDir = pPath->GetBufferSetLength( pszChar - pathLeft );
+ strncpy( pszDir, pathLeft, pszChar - pathLeft );
+ pszDir[pszChar - pathLeft] = '\0';
+ pPath->ReleaseBuffer();
+ }
+
+ // Set the file
+ if ( pFile != NULL ) {
+ *pFile = pszChar + 1;
+ }
+
+ return;
+ }
+ }
+
+ // Never found a delimiter
+}
+
+
+
BOOL CDirDoc::UpdateItemStatus(LPCTSTR pathLeft, LPCTSTR pathRight,
UINT status)
{
int xisalnum (int c);
#include "edtlib.h"
+
+CString GetPathOnly( const CString& sString );
+void SplitFilename( LPCTSTR pathLeft, CString* pPath, CString* pFile, CString* pExt );
+
+
+
//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.