Polygon Crucher SDK - Documentation
Documentation
Loading...
Searching...
No Matches
XFileUtils.h
1// ExFileUtils.h: interface for the file related class.
2//
3//////////////////////////////////////////////////////////////////////
4
5#if !defined(CFILEUTILSINCLUDE_H)
6#define CFILEUTILSINCLUDE_H
7
8#ifdef _MSC_VER
9#pragma once
10#endif // _MSC_VER
11
12#include "xfileoperation.h"
13
14BEGIN_MOOTOOLS_NAMESPACE
15
16 class DLL_TOOLSFUNCTION CXFileFind : public CXObject
17 {
18 public:
19 CXFileFind();
20 virtual ~CXFileFind();
21
22 public:
23 fileuint GetFileLength() const;
24 CXString GetFileName() const;
25 CXString GetFilePath() const; // return the entire found file path. If the file is a directory, it is slash terminated unlike the corresponding MFC implementation
26
27 bool AreFileAttributesSet(unsigned int dwMask, bool allIsSet = true) const; // If allIsSet means that all attributes must be set, otherwise one of the attribute only return true.
28 bool IsFileAttributeSet(XFILE_ATTRIBUTE fileAttribute) const;
29
30 bool IsDots() const;
31 bool IsDirectory() const;
32
33 bool IsReadOnly() const;
34 bool IsHidden() const;
35 bool IsNormal() const;
36
37 // Operations
38 void Close();
39 bool FindFile(LPCTSTR pstrName = NULL);
40 bool FindNextFile(); // This must be called just after FindFile (if it returns true) to access the file information
41
42 // Implementation
43 protected:
44 xFileFindInfo curInfo, nextInfo;
45 CXString searchPath;
46
47 // OS specifics
48 xFileFindHandle handle;
49
50#ifdef _DEBUG
51 void Dump() const;
52 #endif
53
54 DECLARE_DYNAMIC_XOBJECT(CXFileFind)
55 };
56
57 inline bool CXFileFind::IsFileAttributeSet(XFILE_ATTRIBUTE attribute) const
58 {
59 if (handle == NULL)
60 return false;
61
62 return (!!(curInfo.fileinfo.attributes & attribute));
63 }
64
65 inline bool CXFileFind::IsReadOnly() const
66 {
67 return IsFileAttributeSet(XFILE_ATTRIBUTE_READONLY);
68 }
69
70 inline bool CXFileFind::IsDirectory() const
71 {
72 return IsFileAttributeSet(XFILE_ATTRIBUTE_DIRECTORY);
73 }
74
75 inline bool CXFileFind::IsHidden() const
76 {
77 return IsFileAttributeSet(XFILE_ATTRIBUTE_HIDDEN);
78 }
79
80 inline bool CXFileFind::IsNormal() const
81 {
82 return IsFileAttributeSet(XFILE_ATTRIBUTE_NORMAL);
83 }
84
85END_MOOTOOLS_NAMESPACE
86
87#endif // !defined(CFILEUTILSINCLUDE_H)
The class defines an x, y, z 3D point which can use int, float or double.
Definition 3DPoint.h:27
Definition XFileUtils.h:17