~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/function/str/pad.h

  • Committer: Olaf van der Spek
  • Date: 2011-02-12 18:24:24 UTC
  • mto: (2167.1.2 build) (2172.1.4 build)
  • mto: This revision was merged to the branch mainline in revision 2168.
  • Revision ID: olafvdspek@gmail.com-20110212182424-kgnm9osi7qo97at2
casts

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
 
4
 *  Copyright (C) 2008 Sun Microsystems, Inc.
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
27
27
 
28
28
class Item_func_rpad :public Item_str_func
29
29
{
 
30
  Session &session;
30
31
  String tmp_value, rpad_str;
31
32
public:
32
 
  Item_func_rpad(Item *arg1,Item *arg2,Item *arg3)
33
 
    :Item_str_func(arg1,arg2,arg3) {}
 
33
  Item_func_rpad(Session &session_arg, Item *arg1, Item *arg2, Item *arg3) :
 
34
    Item_str_func(arg1,arg2,arg3),
 
35
    session(session_arg)
 
36
  {}
34
37
  String *val_str(String *);
35
38
  void fix_length_and_dec();
36
39
  const char *func_name() const { return "rpad"; }
39
42
 
40
43
class Item_func_lpad :public Item_str_func
41
44
{
 
45
  Session &session;
42
46
  String tmp_value, lpad_str;
43
47
public:
44
 
  Item_func_lpad(Item *arg1,Item *arg2,Item *arg3)
45
 
    :Item_str_func(arg1,arg2,arg3) {}
 
48
  Item_func_lpad(Session &session_arg,
 
49
                 Item *arg1,
 
50
                 Item *arg2,
 
51
                 Item *arg3) :
 
52
    Item_str_func(arg1, arg2, arg3) ,
 
53
    session(session_arg)
 
54
  {}
46
55
  String *val_str(String *);
47
56
  void fix_length_and_dec();
48
57
  const char *func_name() const { return "lpad"; }