~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/cached_directory.cc

  • Committer: Lee Bieber
  • Date: 2011-03-23 23:16:25 UTC
  • mfrom: (2247.1.2 build)
  • Revision ID: kalebral@gmail.com-20110323231625-61k77qbh7n1iu776
Merge Olaf - Use BOOST_FOREACH
Merge Olaf - Remove std::nothrow from new()

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
#include <dirent.h>
30
30
#include <drizzled/definitions.h>
31
31
 
 
32
#include <boost/foreach.hpp>
32
33
#include <sys/types.h>
33
34
#include <sys/stat.h>
34
35
#include <unistd.h>
41
42
 
42
43
using namespace std;
43
44
 
44
 
namespace drizzled
45
 
{
 
45
namespace drizzled {
46
46
 
47
47
CachedDirectory::CachedDirectory() : 
48
48
  error(0)
79
79
 
80
80
CachedDirectory::~CachedDirectory()
81
81
{
82
 
  for (Entries::iterator iter= entries.begin(); iter != entries.end(); ++iter)
83
 
  {
84
 
    delete *iter;
85
 
  }
86
 
  entries.clear();
 
82
        BOOST_FOREACH(Entries::reference iter, entries)
 
83
    delete iter;
87
84
}
88
85
 
89
86
bool CachedDirectory::open(const string &in_path)
90
87
{
91
88
  set<string> empty;
92
 
 
93
89
  return open(in_path, empty);
94
90
}
95
91
 
199
195
  return error == 0;
200
196
}
201
197
 
 
198
std::ostream& operator<<(std::ostream& output, const CachedDirectory &directory)
 
199
{
 
200
  output << "CachedDirectory:(Path: " << directory.getPath() << ")\n";
 
201
  BOOST_FOREACH(const CachedDirectory::Entry* iter, directory.getEntries())
 
202
    output << "\t(" << iter->filename << ")\n";
 
203
  return output;
 
204
}
 
205
 
202
206
} /* namespace drizzled */