~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/cached_directory.cc

Merge with trunk.

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