Add Dirk Luetjen's ssphys libraries and command-line tool
[vss2svn.git] / ssphys / SSPhysLib / FileName.cpp
blobe18d91c9b9f3f8e1345e1c3d2963a9e1bb1014b9
1 // FileName.cpp: implementation of the CFileName class.
2 //
3 //////////////////////////////////////////////////////////////////////
5 #include "stdafx.h"
6 #include "FileName.h"
8 //////////////////////////////////////////////////////////////////////
9 // Construction/Destruction
10 //////////////////////////////////////////////////////////////////////
12 void CFileName::Normalize ()
14 // int n = 0;
15 // int isAbsolute = IsFullPath ();
16 // int isUNCPath = IsUNCPath();
18 // int minCount = 0;
19 // if (isUNCPath)
20 // minCount = 1; // do not drop the computer during ".." resolution.
22 // // break the path into peaces
23 // CString dir (m_szDir);
24 // CStringList elements;
25 // do
26 // {
27 // CString element = SysTokenize (dir, _T("\\/"), n);
28 //
29 // if( n != -1 )
30 // {
31 // if (element == _T(".."))
32 // {
33 // // drop the last directory if we are not a relative path
34 // if (elements.GetCount () > minCount)
35 // elements.RemoveTail ();
36 // else if (!isAbsolute)
37 // elements.AddTail (element);
38 // }
39 // else if (element != _T("."))
40 // elements.AddTail (element);
41 // }
42 // } while( n != -1 );
43 //
44 // // resamble the Path
45 // if (isUNCPath)
46 // dir = _T("\\\\");
47 // else if (isAbsolute)
48 // dir = _T("\\");
49 // else
50 // dir.Empty();
52 // POSITION pos = elements.GetHeadPosition ();
53 // while (pos != NULL)
54 // {
55 // CString element = elements.GetNext(pos);
56 // dir += element + _T("\\");
57 // }
59 // _tcsncpy (m_szDir, dir, _MAX_DIR);