sipxportlib  Version 3.3
OsFileIteratorLinux.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2004-2006 SIPfoundry Inc.
3 // Licensed by SIPfoundry under the LGPL license.
4 //
5 // Copyright (C) 2004-2006 Pingtel Corp. All rights reserved.
6 // Licensed to SIPfoundry under a Contributor Agreement.
7 //
8 // $$
10 
11 #ifndef _OsFileIterator_h_
12 #define _OsFileIterator_h_
13 
14 // SYSTEM INCLUDES
15 #include <unistd.h>
16 #include <dirent.h>
17 #include <sys/types.h>
18 #include <sys/stat.h>
19 #include <fcntl.h>
20 
21 // APPLICATION INCLUDES
22 #include "os/OsDefs.h"
23 #include "os/OsStatus.h"
24 #include "os/OsFS.h"
25 
26 // DEFINES
27 // MACROS
28 // EXTERNAL FUNCTIONS
29 // EXTERNAL VARIABLES
30 // CONSTANTS
31 // STRUCTS
32 // TYPEDEFS
33 // FORWARD DECLARATIONS
34 class OsFileInfoLinux;
35 class OsPathLinux;
36 class OsFileIteratorBase;
37 
38 //:Abstraction class to iterate through files and/or directories
40 {
41 /* //////////////////////////// PUBLIC //////////////////////////////////// */
42 public:
43 
44 
45 /* ============================ CREATORS ================================== */
46 
48 
49  OsFileIteratorLinux(const OsPathLinux& rPathName);
50 
51  virtual ~OsFileIteratorLinux();
52  //:Destructor
53 
54 
55 /* ============================ MANIPULATORS ============================== */
56 
57 
58 /* ============================ ACCESSORS ================================= */
59 
60 /* ============================ INQUIRY =================================== */
61  //: Returns total files enumerated thus far.
62 
63 /* //////////////////////////// PROTECTED ///////////////////////////////// */
64 protected:
65 
66 /* //////////////////////////// PRIVATE /////////////////////////////////// */
67 private:
68  DIR* mSearchHandle;
69 
70  OsStatus getNextEntryName(UtlString &rName, OsFileType &rFileType);
71  //: Platform dependant call for getting entry
72  OsStatus getFirstEntryName(UtlString &rName, OsFileType &rFileType);
73  //: Platform dependant call for getting entry
74 
75  OsFileType mMatchAttrib;
76  //: Attributes for file matching
77 
78  long mFileCount;
79  //: How many file did this class find
80 
81 };
82 
83 /* ============================ INLINE METHODS ============================ */
84 
85 #endif // _OsFileIterator_h_
86 
87 
virtual ~OsFileIteratorLinux()
Definition: OsFileIteratorLinux.cpp:38
OsStatus
Definition: OsStatus.h:27
OsFileType
Definition: OsFileIteratorBase.h:41
Definition: OsFileIteratorLinux.h:39
Definition: OsFileIteratorBase.h:37
Definition: OsFileInfoLinux.h:35
Definition: UtlString.h:48
Definition: OsPathLinux.h:33
OsFileIteratorLinux()
Definition: OsFileIteratorLinux.cpp:58