~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/cached_directory.cc

  • Committer: Brian Aker
  • Date: 2010-12-19 06:20:54 UTC
  • mfrom: (2005.1.1 bug673105)
  • Revision ID: brian@tangent.org-20101219062054-1kt0l3dxs4z2z8md
Merge Dave.

Show diffs side-by-side

added added

removed removed

Lines of Context:
50
50
 
51
51
 
52
52
CachedDirectory::CachedDirectory(const string &in_path) :
53
 
  error(0),
54
 
  use_full_path(false)
 
53
  error(0)
55
54
{
56
55
  // TODO: Toss future exception
57
56
  (void) open(in_path);
59
58
 
60
59
 
61
60
CachedDirectory::CachedDirectory(const string& in_path, set<string>& allowed_exts) :
62
 
  error(0),
63
 
  use_full_path(false)
 
61
  error(0)
64
62
{
65
63
  // TODO: Toss future exception
66
64
  (void) open(in_path, allowed_exts);
67
65
}
68
66
 
69
 
CachedDirectory::CachedDirectory(const string& in_path, enum CachedDirectory::FILTER filter, bool use_full_path_arg) :
70
 
  error(0),
71
 
  use_full_path(use_full_path_arg)
 
67
CachedDirectory::CachedDirectory(const string& in_path, enum CachedDirectory::FILTER filter) :
 
68
  error(0)
72
69
{
73
70
  set<string> empty;
74
71
  // TODO: Toss future exception
131
128
         result != NULL)
132
129
  {
133
130
    std::string buffered_fullpath;
134
 
    if (not allowed_exts.empty())
 
131
    if (! allowed_exts.empty())
135
132
    {
136
133
      char *ptr= rindex(result->d_name, '.');
137
134
 
157
154
          if (result->d_name[0] == '.') // We don't pass back anything hidden at the moment.
158
155
            continue;
159
156
 
160
 
          if (use_full_path)
161
 
          {
162
 
            buffered_fullpath.append(in_path);
163
 
            if (buffered_fullpath[buffered_fullpath.length()] != '/')
164
 
              buffered_fullpath.append(1, FN_LIBCHAR);
165
 
          }
 
157
          buffered_fullpath.append(in_path);
 
158
          if (buffered_fullpath[buffered_fullpath.length()] != '/')
 
159
            buffered_fullpath.append(1, FN_LIBCHAR);
166
160
 
167
 
          buffered_fullpath.append(result->d_name);
 
161
          buffered_fullpath.assign(result->d_name);
168
162
 
169
163
          stat(buffered_fullpath.c_str(), &entrystat);
170
164