~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mysys/cached_directory.h

Fix issue where there are too many files in data directory. We now only
cache files with correct ext. AKA... we no longer keep all the filenames in
memory. The comparison operation will have us holding the lock on directory
a little longer (aka... whatever the OS is doing).

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
 
31
31
#include <iostream>
32
32
#include <vector>
 
33
#include <set>
33
34
#include <string>
34
35
#include <dirent.h>
35
36
#include <stdlib.h>
71
72
   * Constructor taking full directory path as sole parameter.
72
73
   *
73
74
   * @param[in] Path to the directory to open
 
75
   * @param[in] File extensions to mask against.
74
76
   */
75
 
 CachedDirectory(const std::string &in_path); 
 
77
 CachedDirectory(const std::string& in_path); 
 
78
 CachedDirectory(const std::string& in_path, std::set<std::string>& exts);
 
79
 
76
80
 /**
77
81
  * Destructor.  Cleans up any resources we've taken 
78
82
  */
117
121
  /**
118
122
   * Encapsulate the logic to open the directory.
119
123
   * @param[in] dirPath The path to the directory to open and read.
 
124
   * @param[in] File extensions to mask against.
120
125
   * @retval true Success
121
126
   * @retval false Failure
122
127
   */
123
128
  bool open(const std::string &dirPath);
 
129
  bool open(const std::string &in_path, std::set<std::string> exts, bool honor_exts= true);
124
130
 
125
131
};
126
132