Drizzled Public API Documentation

file_exchange.h
00001 /* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
00002  *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
00003  *
00004  *  Copyright (C) 2008 Sun Microsystems, Inc.
00005  *
00006  *  This program is free software; you can redistribute it and/or modify
00007  *  it under the terms of the GNU General Public License as published by
00008  *  the Free Software Foundation; version 2 of the License.
00009  *
00010  *  This program is distributed in the hope that it will be useful,
00011  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  *  GNU General Public License for more details.
00014  *
00015  *  You should have received a copy of the GNU General Public License
00016  *  along with this program; if not, write to the Free Software
00017  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00018  */
00019 
00020 
00021 #pragma once
00022 
00023 #include <drizzled/sql_string.h>
00024 #include <drizzled/memory/sql_alloc.h>
00025 #include <drizzled/enum.h>
00026 
00027 namespace drizzled
00028 {
00029 
00030 extern const CHARSET_INFO *default_charset_info;
00031 
00032 static String default_line_term("\n",default_charset_info);
00033 static String default_escaped("\\",default_charset_info);
00034 static String default_field_term("\t",default_charset_info);
00035 
00036 /*
00037   Used to hold information about file and file structure in exchange
00038   via non-DB file (...INTO OUTFILE..., ...LOAD DATA...)
00039   XXX: We never call destructor for objects of this class.
00040 */
00041 
00042 class file_exchange :
00043   public memory::SqlAlloc
00044 {
00045 public:
00046   enum enum_filetype filetype; /* load XML, Added by Arnold & Erik */
00047   char *file_name;
00048   String *field_term,*enclosed,*line_term,*line_start,*escaped;
00049   bool opt_enclosed;
00050   bool dumpfile;
00051   ulong skip_lines;
00052   const CHARSET_INFO *cs;
00053   file_exchange(char *name, bool flag,
00054                 enum_filetype filetype_arg= FILETYPE_CSV);
00055 };
00056 
00057 
00058 } /* namespace drizzled */
00059