~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/cached_directory.h

Refactor

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
 *   Defines the interface to the CachedDirectory class.
26
26
 */
27
27
 
28
 
#ifndef DRIZZLED_CACHED_DIRECTORY_H
29
 
#define DRIZZLED_CACHED_DIRECTORY_H
30
 
 
31
 
#include <dirent.h>
 
28
#pragma once
32
29
 
33
30
#include <iostream>
34
31
#include <vector>
37
34
#include <cstdlib>
38
35
#include <cerrno>
39
36
 
40
 
namespace drizzled
41
 
{
 
37
namespace drizzled {
42
38
 
43
39
/**
44
40
 * A utility class to handle processing the entries/files within a directory.
49
45
class CachedDirectory
50
46
{
51
47
public:
52
 
  enum FILTER {
 
48
  enum FILTER 
 
49
  {
53
50
    NONE,
54
51
    DIRECTORY,
55
52
    FILE,
86
83
   * @param[in] File extensions to allow
87
84
   */
88
85
  CachedDirectory(const std::string& in_path, std::set<std::string>& allowed_exts);
89
 
  CachedDirectory(const std::string& in_path, enum CachedDirectory::FILTER filter);
 
86
  CachedDirectory(const std::string& in_path, enum CachedDirectory::FILTER filter, bool use_full_path= false);
90
87
 
91
88
  /**
92
89
   * Destructor.  Cleans up any resources we've taken 
131
128
private:
132
129
  std::string path; ///< Path to the directory
133
130
  int error; ///< Error code stored from various syscalls
 
131
  bool use_full_path;
134
132
  Entries entries; ///< Entries in the directory
135
133
 
136
134
  /**
175
173
 
176
174
} /* namespace drizzled */
177
175
 
178
 
#endif /* DRIZZLED_CACHED_DIRECTORY_H */