1
1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
2
* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
4
* Copyright (C) 2008 Sun Microsystems
4
* Copyright (C) 2008 Sun Microsystems, Inc.
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
17
17
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20
#ifndef DRIZZLED_LEX_STRING_H
21
#define DRIZZLED_LEX_STRING_H
23
#include <drizzled/util/data_ref.h>
26
LEX_STRING -- a pair of a C-string and its length.
28
lex_string_t -- a pair of a C-string and its length.
29
31
/* This definition must match the one given in mysql/plugin.h */
30
typedef struct st_mysql_lex_string
37
#define STRING_WITH_LEN(X) (X), ((size_t) (sizeof(X) - 1))
38
#define USTRING_WITH_LEN(X) ((unsigned char*) X), ((size_t) (sizeof(X) - 1))
39
#define C_STRING_WITH_LEN(X) ((char *) (X)), ((size_t) (sizeof(X) - 1))
42
#endif /* DRIZZLED_LEX_STRING_H */
34
const char* begin() const
39
const char* end() const
41
return data() + size();
44
const char* data() const
54
void assign(const char* d, size_t s)
56
str_= const_cast<char*>(d);
60
void operator=(str_ref v)
62
assign(v.data(), v.size());
69
inline const lex_string_t &null_lex_string()
71
static lex_string_t tmp= { NULL, 0 };
75
struct execute_string_t : public lex_string_t
81
bool isVariable() const
86
void set(const lex_string_t& s, bool is_variable_arg= false)
88
is_variable= is_variable_arg;
89
static_cast<lex_string_t&>(*this) = s;
94
#define STRING_WITH_LEN(X) (X), (sizeof(X) - 1)
95
#define C_STRING_WITH_LEN(X) const_cast<char*>(X), (sizeof(X) - 1)
97
} /* namespace drizzled */