~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/cached_directory.cc

  • Committer: lbieber
  • Date: 2010-10-01 13:06:31 UTC
  • mfrom: (1802.2.2 drizzle-bug-651948)
  • mto: This revision was merged to the branch mainline in revision 1805.
  • Revision ID: lbieber@orisndriz08-20101001130631-xubscnhmj7r5dn6g
Merge Andrew - Fix bug 651948 - Index lengths not retrieved using drizzledump

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
3
 *
4
 
 *  Copyright (C) 2008 Sun Microsystems, Inc.
 
4
 *  Copyright (C) 2008 Sun Microsystems
5
5
 *
6
6
 *  This program is free software; you can redistribute it and/or modify
7
7
 *  it under the terms of the GNU General Public License as published by
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