update for HEAD-2003091401
[reactos.git] / subsys / system / explorer / Seashell / SeaShellExt / Include / Dirwalk.h
1 #ifndef __DIRWALK_H__
2 #define __DIRWALK_H__
3
4 ////////////////////////////////////////////////
5 // CSplitPath
6 ////////////////////////////////////////////////
7 class CTRL_EXT_CLASS CSplitPath
8 {
9 public:
10         CSplitPath(LPCTSTR pszPath);
11         CSplitPath();
12         virtual ~CSplitPath();
13 // operations
14 public:
15         void Split(LPCTSTR pszPath);
16         void Make();
17 // attributes
18 public:
19         CString GetPath() const;
20         CString GetDrive() const;
21         CString GetDir() const;
22         CString GetFileName() const;
23         CString GetExt() const;
24         void SetDrive(LPCTSTR pszDrive);
25         void SetDir(LPCTSTR pszDir);
26         void SetFileName(LPCTSTR pszFileName);
27         void SetExt(LPCTSTR pszExt);
28 protected:
29         void Init();
30 private:
31         TCHAR m_szPath[MAX_PATH];
32         TCHAR m_szDrive[_MAX_DRIVE];
33         TCHAR m_szDir[_MAX_DIR];
34         TCHAR m_szFname[_MAX_FNAME];
35         TCHAR m_szExt[_MAX_EXT];
36 };
37
38 inline CSplitPath::CSplitPath()
39 {
40         Init();
41 }
42
43 inline CSplitPath::CSplitPath(LPCTSTR pszPath)
44 {
45         Init();
46         Split(pszPath);
47 }
48
49 inline void CSplitPath::Init()
50 {
51         m_szPath[0] = 0;
52         m_szDrive[0] = 0;
53         m_szDir[0] = 0;
54         m_szFname[0] = 0;
55         m_szExt[0] = 0;
56 }
57
58 inline CSplitPath::~CSplitPath()
59 {
60
61 }
62
63 inline CString CSplitPath::GetPath() const
64 {
65         return m_szPath;
66 }
67
68 inline CString CSplitPath::GetDrive() const
69 {
70         return m_szDrive;
71 }
72
73 inline CString CSplitPath::GetDir() const
74 {
75         return m_szDir;
76 }
77
78 inline CString CSplitPath::GetFileName() const
79 {
80         return m_szFname;
81 }
82
83 inline CString CSplitPath::GetExt() const
84 {
85         return m_szExt;
86 }
87
88 inline void CSplitPath::SetDrive(LPCTSTR pszDrive)
89 {
90         lstrcpy(m_szDrive,pszDrive);
91 }
92
93 inline void CSplitPath::SetDir(LPCTSTR pszDir)
94 {
95         lstrcpy(m_szDir,pszDir);
96 }
97
98 inline void CSplitPath::SetFileName(LPCTSTR pszFileName)
99 {
100         lstrcpy(m_szFname,pszFileName);
101 }
102
103 inline void CSplitPath::SetExt(LPCTSTR pszExt)
104 {
105         lstrcpy(m_szExt,pszExt);
106 }
107
108 inline void CSplitPath::Split(LPCTSTR pszPath)
109 {
110         _tsplitpath(pszPath,m_szDrive,m_szDir,m_szFname,m_szExt);
111 }
112
113 inline void CSplitPath::Make()
114 {
115         _tmakepath(m_szPath,m_szDrive,m_szDir,m_szFname,m_szExt);
116 }
117
118 #define ARRAY_SIZE(A)  (sizeof(A) / sizeof((A)[0]))
119
120 #endif //__DIRWALK_H__