~ubuntu-branches/ubuntu/saucy/drizzle/saucy-proposed

« back to all changes in this revision

Viewing changes to drizzled/temporal_format.cc

  • Committer: Package Import Robot
  • Author(s): Clint Byrum
  • Date: 2012-06-19 10:46:49 UTC
  • mfrom: (1.1.6)
  • mto: This revision was merged to the branch mainline in revision 29.
  • Revision ID: package-import@ubuntu.com-20120619104649-e2l0ggd4oz3um0f4
Tags: upstream-7.1.36-stable
ImportĀ upstreamĀ versionĀ 7.1.36-stable

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
 
31
31
#include <config.h>
32
32
 
 
33
#include <boost/foreach.hpp>
33
34
#include <drizzled/temporal_format.h>
34
35
#include <drizzled/temporal.h>
35
36
 
41
42
 
42
43
using namespace std;
43
44
 
44
 
namespace drizzled
45
 
{
 
45
namespace drizzled {
46
46
 
47
47
TemporalFormat::TemporalFormat(const char *pattern) :
48
48
  _pattern(pattern)
66
66
                    );
67
67
}
68
68
 
 
69
TemporalFormat::~TemporalFormat()
 
70
{
 
71
  pcre_free(_re);
 
72
}
 
73
 
69
74
bool TemporalFormat::matches(const char *data, size_t data_len, Temporal *to)
70
75
{
71
76
  if (! is_valid()) 
302
307
/** Free all allocated temporal formats */
303
308
void deinit_temporal_formats()
304
309
{
305
 
  vector<TemporalFormat *>::iterator p= all_temporal_formats.begin();
306
 
  while (p != all_temporal_formats.end())
307
 
  {
308
 
    delete *p;
309
 
    ++p;
310
 
  }
 
310
  BOOST_FOREACH(TemporalFormat* it, all_temporal_formats)
 
311
    delete it;
311
312
  known_date_formats.clear();
312
313
  known_datetime_formats.clear();
313
314
  known_time_formats.clear();