My Project
sql_locale.h
00001 /* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
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 #ifndef SQL_LOCALE_INCLUDED
00017 #define SQL_LOCALE_INCLUDED
00018 
00019 typedef struct my_locale_errmsgs
00020 {
00021   const char *language;
00022   const char **errmsgs;
00023 } MY_LOCALE_ERRMSGS;
00024 
00025 #include "my_global.h"                          /* uint */
00026 
00027 typedef struct st_typelib TYPELIB;
00028 
00029 class MY_LOCALE
00030 {
00031 public:
00032   uint  number;
00033   const char *name;
00034   const char *description;
00035   const bool is_ascii;
00036   TYPELIB *month_names;
00037   TYPELIB *ab_month_names;
00038   TYPELIB *day_names;
00039   TYPELIB *ab_day_names;
00040   uint max_month_name_length;
00041   uint max_day_name_length;
00042   uint decimal_point;
00043   uint thousand_sep;
00044   const char *grouping;
00045   MY_LOCALE_ERRMSGS *errmsgs;
00046   MY_LOCALE(uint number_par,
00047             const char *name_par, const char *descr_par, bool is_ascii_par,
00048             TYPELIB *month_names_par, TYPELIB *ab_month_names_par,
00049             TYPELIB *day_names_par, TYPELIB *ab_day_names_par,
00050             uint max_month_name_length_par, uint max_day_name_length_par,
00051             uint decimal_point_par, uint thousand_sep_par,
00052             const char *grouping_par, MY_LOCALE_ERRMSGS *errmsgs_par) :
00053     number(number_par),
00054     name(name_par), description(descr_par), is_ascii(is_ascii_par),
00055     month_names(month_names_par), ab_month_names(ab_month_names_par),
00056     day_names(day_names_par), ab_day_names(ab_day_names_par),
00057     max_month_name_length(max_month_name_length_par),
00058     max_day_name_length(max_day_name_length_par),
00059     decimal_point(decimal_point_par),
00060     thousand_sep(thousand_sep_par),
00061     grouping(grouping_par),
00062     errmsgs(errmsgs_par)
00063   {}
00064 };
00065 /* Exported variables */
00066 
00067 extern MY_LOCALE my_locale_en_US;
00068 extern MY_LOCALE *my_locales[];
00069 extern MYSQL_PLUGIN_IMPORT MY_LOCALE *my_default_lc_messages;
00070 extern MY_LOCALE *my_default_lc_time_names;
00071 
00072 /* Exported functions */
00073 
00074 MY_LOCALE *my_locale_by_name(const char *name);
00075 MY_LOCALE *my_locale_by_number(uint number);
00076 void cleanup_errmsgs(void);
00077 
00078 #endif /* SQL_LOCALE_INCLUDED */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines