~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/function/time/date.cc

  • Committer: Monty Taylor
  • Date: 2009-04-14 19:16:51 UTC
  • mto: (997.2.5 mordred)
  • mto: This revision was merged to the branch mainline in revision 994.
  • Revision ID: mordred@inaugust.com-20090414191651-ltbww6hpqks8k7qk
Clarified instructions in README.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18
18
 */
19
19
 
20
 
#include "config.h"
21
 
 
 
20
#include "drizzled/server_includes.h"
 
21
#include CSTDINT_H
22
22
#include "drizzled/function/time/date.h"
23
23
#include "drizzled/temporal.h"
24
24
 
25
 
namespace drizzled
26
 
{
27
 
 
28
25
String *Item_date::val_str(String *str)
29
26
{
30
27
  assert(fixed);
31
28
 
32
29
  /* We have our subclass convert a Date temporal for us */
33
 
  Date temporal;
 
30
  drizzled::Date temporal;
34
31
  if (! get_temporal(temporal))
35
32
    return (String *) NULL; /* get_temporal throws error. */
36
33
 
41
38
  }
42
39
 
43
40
  /* Convert the Date to a string and return it */
44
 
  int new_length;
45
 
  new_length= temporal.to_string(str->c_ptr(), MAX_DATE_STRING_REP_LENGTH);
46
 
  assert(new_length < MAX_DATE_STRING_REP_LENGTH);
47
 
  str->length(new_length);
 
41
  size_t new_length;
 
42
  temporal.to_string(str->c_ptr(), &new_length);
 
43
  str->length((uint32_t) new_length);
48
44
  return str;
49
45
}
50
46
 
53
49
  assert(fixed);
54
50
 
55
51
  /* We have our subclass convert a Date temporal for us */
56
 
  Date temporal;
 
52
  drizzled::Date temporal;
57
53
  if (! get_temporal(temporal))
58
54
    return 0; /* get_temporal throws error. */
59
55
 
62
58
  temporal.to_int32_t(&int_value);
63
59
  return (int64_t) int_value;
64
60
}
65
 
 
66
 
} /* namespace drizzled */