Drizzled Public API Documentation

typelib.h
00001 /* Copyright (C) 2000 MySQL AB
00002 
00003    This program is free software; you can redistribute it and/or modify
00004    it under the terms of the GNU General Public License as published by
00005    the Free Software Foundation; version 2 of the License.
00006 
00007    This program is distributed in the hope that it will be useful,
00008    but WITHOUT ANY WARRANTY; without even the implied warranty of
00009    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010    GNU General Public License for more details.
00011 
00012    You should have received a copy of the GNU General Public License
00013    along with this program; if not, write to the Free Software
00014    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA */
00015 
00016 
00017 #pragma once
00018 
00019 #include <drizzled/common_fwd.h>
00020 
00021 namespace drizzled {
00022 
00023 class TYPELIB
00024 {
00025 public:
00026   enum e_find_options
00027   {
00028     e_none = 0,
00029     e_match_full = 1,
00030     e_dont_complete = 2,
00031 
00032     e_default = 3
00033   };
00034 
00035   TYPELIB* copy_typelib(memory::Root&) const;
00036   int find_type_or_exit(const char*, const char* option) const;
00037   int find_type(const char*, e_find_options) const;
00038   const char *get_type(unsigned int nr) const;
00039 
00040   uint64_t find_set(const char *x, uint32_t length, const charset_info_st*,
00041                     char **err_pos, uint32_t *err_len, bool *set_warning) const;
00042   uint32_t find_type(const char *find, uint32_t length, bool part_match) const;
00043   uint32_t find_type2(const char *find, uint32_t length, const charset_info_st*) const;
00044 
00045   unsigned int count;
00046   const char *name;
00047   const char **type_names;
00048   unsigned int *type_lengths;
00049 };
00050 
00051 } /* namespace drizzled */
00052