Scopira  20080306
diriterator.h
1 
2 /*
3  * Copyright (c) 2003-2008 National Research Council
4  *
5  * All rights reserved.
6  *
7  * This material is confidential and proprietary information of
8  * National Research Council Canada ("Confidential Information").
9  * This Confidential Information may only be used and reproduced
10  * in accordance with the terms of the license agreement.
11  *
12  */
13 
14 #ifndef __INCLUDED__SCOPIRA_TOOL_DIRITERATOR_HPP__
15 #define __INCLUDED__SCOPIRA_TOOL_DIRITERATOR_HPP__
16 
17 #include <scopira/tool/platform.h>
18 #include <scopira/tool/export.h>
19 
20 #ifdef PLATFORM_win32
21 #include <windows.h>
22 #else
23 #include <dirent.h>
24 #endif
25 
26 #include <string>
27 
28 // THIS FILE HAS BEEN FULLY DOCUMENTED
29 
30 namespace scopira
31 {
32  namespace tool
33  {
34  class dir_iterator;
35  }
36 }
37 
56 {
57  private:
58  bool dm_failed; // currently failed?
59 #ifdef PLATFORM_win32
60  HANDLE dm_dir;
61  WIN32_FIND_DATA dm_dirdata;
62  bool dm_haveprime;
63 #else
64  DIR *dm_dir; // DIR handle
65 #endif
66 
67  public:
72  SCOPIRA_EXPORT dir_iterator(void);
73  SCOPIRA_EXPORT ~dir_iterator();
74 
80  bool failed(void) const { return dm_failed; }
81 
89  SCOPIRA_EXPORT bool open(const std::string& dirname);
99  SCOPIRA_EXPORT void close(void);
100 
112  SCOPIRA_EXPORT bool next(std::string& out);
113 };
114 
115 #endif
116 
Definition: archiveflow.h:20
Definition: diriterator.h:55
bool next(std::string &out)
bool open(const std::string &dirname)
bool failed(void) const
Definition: diriterator.h:80