OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimDirectory.h
Go to the documentation of this file.
1 //*******************************************************************
2 // Copyright (C) 2000 ImageLinks Inc.
3 //
4 // License: MIT
5 //
6 // See LICENSE.txt file in the top level directory for more details.
7 //
8 // Author: Garrett Potts
9 //
10 // Description:
11 //
12 //*************************************************************************
13 // $Id: ossimDirectory.h 22656 2014-02-28 17:51:42Z dburken $
14 #ifndef ossimDirectory_HEADER
15 #define ossimDirectory_HEADER
16 
18 
19 #ifndef _WIN32
20 class ossimDirectoryData;
21 #endif
22 
24 {
25 public:
26 
31  enum
32  {
33  OSSIM_DIR_FILES = 0x0001, // include files
34  OSSIM_DIR_DIRS = 0x0002, // include directories
35  OSSIM_DIR_HIDDEN = 0x0004, // include hidden files
36  OSSIM_DIR_DOTDOT = 0x0008, // include '.' and '..'
37 
38  // by default, enumerate everything except '.' and '..'
39  OSSIM_DIR_DEFAULT = OSSIM_DIR_FILES | OSSIM_DIR_DIRS | OSSIM_DIR_HIDDEN
40  };
41 
42 
44 
45  ossimDirectory(const ossimFilename& dir);
46 
47  ~ossimDirectory();
48 
49  bool open(const ossimFilename& dir);
50 
51  bool isOpened() const;
52 
53  bool getFirst(ossimFilename &filename,
54  int flags = OSSIM_DIR_DEFAULT);
55 
60  bool getNext(ossimFilename &filename) const;
61 
62  void findAllFilesThatMatch(std::vector<ossimFilename>& result,
63  const ossimString& regularExpressionPattern,
64  int flags = OSSIM_DIR_DEFAULT);
65 
66 #if defined (_WIN32)
67  void setFlags(int flags) { theFlags = flags; };
68  bool fileMatched(ossimFilename &filename) const;
69 #endif
70 
71  // ESH 07/2008, Trac #234: OSSIM is case sensitive
72  // when using worldfile templates during ingest
89  bool findCaseInsensitiveEquivalents( const ossimFilename &filename,
90  std::vector<ossimFilename>& result,
91  bool bExcludeExactMatch = true );
92 
93  // TODO using scandir() when available later, emulating it otherwise
94 
95 private:
96 #if defined (_WIN32)
97  intptr_t theData;
98  ossimFilename theDirectoryName;
99  int theFlags;
100 #else
102 #endif
103 };
104 
105 #endif /* #ifndef ossimDirectory_HEADER */
#define OSSIMDLLEXPORT
ossimDirectoryData * theData