LibPkg
dirstream.h
Go to the documentation of this file.
1 // This file is part of LibPkg.
2 // Copyright © 2003-2005 Graham Shaw.
3 // Distribution and use are subject to the GNU Lesser General Public License,
4 // a copy of which may be found in the file !LibPkg.Copyright.
5 
6 #ifndef LIBPKG_DIRSTREAM
7 #define LIBPKG_DIRSTREAM
8 
9 #include <string>
10 
11 namespace pkg {
12 
13 using std::string;
14 
16 class dirstream
17 {
18 public:
19  struct object;
20 private:
22  unsigned int _buffer_size;
23 
25  char* _buffer;
26 
28  int _offset;
29 
31  string _pathname;
32 
34  string _pattern;
35 
39  bool _buffer_full;
40 public:
45  dirstream(const string& pathname,const string& pattern="*");
46 
48  ~dirstream();
49 
53  operator bool();
54 
59  dirstream& operator>>(object& obj);
60 private:
62  void fill_buffer();
63 };
64 
66 {
68  unsigned long loadaddr;
70  unsigned long execaddr;
72  unsigned long length;
74  unsigned long attr;
76  unsigned long objtype;
78  unsigned long filetype;
80  string name;
81 };
82 
83 }; /* namespace pkg */
84 
85 #endif
unsigned long loadaddr
The load address.
Definition: dirstream.h:68
The namespace used to hold the package management library.
Definition: auto_dir.cc:12
unsigned long filetype
The file type.
Definition: dirstream.h:78
unsigned long attr
The file attributes.
Definition: dirstream.h:74
unsigned long execaddr
The execution address.
Definition: dirstream.h:70
unsigned long objtype
The object type.
Definition: dirstream.h:76
Definition: dirstream.h:65
~dirstream()
Destroy directory stream.
Definition: dirstream.cc:21
dirstream(const string &pathname, const string &pattern="*")
Construct directory stream.
Definition: dirstream.cc:12
A class for reading directories.
Definition: dirstream.h:16
dirstream & operator>>(object &obj)
Read file information.
Definition: dirstream.cc:32
string name
The object name.
Definition: dirstream.h:80
unsigned long length
The file length.
Definition: dirstream.h:72

Reference Manual LibPkg Version 0.6.1 (28 Jan 2015)