DCL
3.7.4
Loading...
Searching...
No Matches
Dir.h
Go to the documentation of this file.
1
#ifndef __DCL_DIR_H__
2
#define __DCL_DIR_H__ 20041127
3
4
#ifndef __DCL_CONFIG_H__
5
#include <
dcl/Config.h
>
6
#endif
7
8
#ifdef __WINNT__
9
#ifndef _WINDOWS_
10
#error "Required windows.h, See dcl/_windows.h"
11
#endif
12
#if 0
13
#include <fileapi.h>
// HANDLE WIN32_FIND_DATAW
14
#endif
15
#else
16
#include <dirent.h>
17
#endif
18
19
#ifndef __DCL_OBJECT_H__
20
#include <
dcl/Object.h
>
21
#endif
22
#ifndef __DCL_STRING_H__
23
#include <
dcl/String.h
>
24
#endif
25
#ifndef __DCL_EXCEPTION_H__
26
#include <
dcl/Exception.h
>
27
#endif
28
29
__DCL_BEGIN_NAMESPACE
30
31
class
CharsetConvertException
;
32
40
class
DCLCAPI
Dir :
public
Object
41
{
42
DECLARE_CLASSINFO
(Dir)
43
public
:
44
#ifdef __WINNT__
45
typedef
HANDLE HandleType;
46
#else
47
typedef
DIR* HandleType;
48
#endif
49
55
class
DCLCAPI
Entry
56
{
57
private
:
58
#ifdef __WINNT__
59
WIN32_FIND_DATAW __dirent;
60
#else
61
struct
dirent __dirent;
62
#if defined(_AIX)
63
String
__path
;
64
#elif defined(__sun__)
65
String
__path
;
66
String __name;
67
#endif
68
#endif
69
friend
class
Dir;
70
public
:
74
Entry();
75
83
84
String name()
const
85
__DCL_THROWS1
(
CharsetConvertException
*);
86
90
bool
isDir()
const
;
91
96
bool
isLink()
const
__DCL_THROWS1
(
IOException
*);
97
101
String
toString
()
const
__DCL_THROWS1
(
IOException
*);
102
};
103
108
virtual
~Dir();
109
114
Dir(
const
String& _path)
115
__DCL_THROWS1
(
IOException
*);
116
120
void
close()
121
__DCL_THROWS1
(
IOException
*);
122
126
void
rewind()
127
__DCL_THROWS1
(
IOException
*);
128
142
bool
read(Entry& _entry)
__DCL_THROWS1
(
IOException
*);
143
148
const
String& path()
const
{
return
__path
; }
149
150
protected
:
151
HandleType
__handle
;
152
String
__path
;
153
};
154
155
__DCL_END_NAMESPACE
156
157
#endif
// __DCL_DIR_H__
Config.h
DCLCAPI
#define DCLCAPI
Definition
Config.h:95
__DCL_THROWS1
#define __DCL_THROWS1(e)
Definition
Config.h:152
Exception.h
Object.h
DECLARE_CLASSINFO
#define DECLARE_CLASSINFO(class_name)
Definition
Object.h:227
String.h
CharsetConvertException
Definition
Charset.h:76
Dir::__path
String __path
Definition
Dir.h:152
Dir::__handle
HandleType __handle
Definition
Dir.h:151
IOException
Definition
Exception.h:93
Object::Object
Object()
Definition
Object.cpp:183
Object::toString
virtual String toString() const
Definition
Object.cpp:187
include
dcl
Dir.h
Generated by
1.14.0