-
Notifications
You must be signed in to change notification settings - Fork 1
/
CPathSplit.h
75 lines (57 loc) · 1.74 KB
/
CPathSplit.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
//////////////////////////////////////////////////////////////////////
// CPathSplit.h - Kochise Kochise 2002-2004
//
#ifndef __CPATHSPLIT_H__
#define __CPATHSPLIT_H__
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
#include "SigUtils.h"
class CPathSplit
{
// Construction
public:
CPathSplit
(
);
CPathSplit
( const char* i_panStrPath
);
virtual ~CPathSplit(void);
typedef enum ePathElement
{ ePS_DRV = 0
, ePS_DIR
, ePS_FN
, ePS_EXT
, ePS__NUM
};
// Operations
// Split the path
BOOL Split
( const char* i_panStrPath
);
inline char* GetPath() { return mp_panBufferPath; }
char* GetPath
( int i_nEnd
, const char* i_poStrQueue = NULL // No queue
, int i_nStart = ePS_DRV // From DRIVE
);
inline char* GetDrive() { return GetPath(ePS_DRV, NULL, ePS_DRV); }
inline char* GetDirectory(){ return GetPath(ePS_DIR, NULL, ePS_DIR); }
inline char* GetFolder() { return GetPath(ePS_DIR, NULL, ePS_DRV); }
inline char* GetFileName() { return GetPath(ePS_FN, NULL, ePS_FN); }
inline char* GetExtension(){ return GetPath(ePS_EXT, NULL, ePS_EXT); }
inline char* GetFile() { return GetPath(ePS_EXT, NULL, ePS_FN); }
// Attributes
protected:
char* mp_panBufferPath;
char* mp_panBufferTempo;
int mp_nBufferSize;
char* mp_panTempo;
int mp_anPathFirst[ePS__NUM];
int mp_anPathCount[ePS__NUM];
void _ErasePointers();
int _Find(char i_nFind, bool i_bReserve = false);
void _Copy(const char* i_panString, int i_nNumber = 0);
};
#endif // __CPATHSPLIT_H__