rasdaman API
csv.hh
Go to the documentation of this file.
1 /*
2 * This file is part of rasdaman community.
3 *
4 * Rasdaman community is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * Rasdaman community is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with rasdaman community. If not, see <http://www.gnu.org/licenses/>.
16 *
17 * Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann /
18 rasdaman GmbH.
19 *
20 * For more information please see <http://www.rasdaman.org>
21 * or contact Peter Baumann via <baumann@rasdaman.com>.
22 /
36 #ifndef _R_CONV_CSV_HH_
37 #define _R_CONV_CSV_HH_
38 
39 #include "conversion/convertor.hh"
40 #include <ostream>
41 
42 //@ManMemo: Module {\bf conversion}
43 
44 /*@Doc:
45  CSV convertor class.
46 
47  Supported parameters are
48 
49  \begin{tabular}{lcl}
50  comptype && string && the compression type to use (see below)\\
51  quality && int && quality parameter for JPEG compression\\
52  skiphuff && int && skipping parameter for Huffman coding\\
53  \end{tabular}
54 
55  The compression type defaults to deflate but may be one of the
56  following
57 
58  \begin{tabular}{ll}
59  none && no compression\\
60  rle && Run Length Coding\\
61  huffman && Huffman coding\\
62  deflate && ZIP deflate\\
63  \end{tabular}
64 
65 */
66 class r_Conv_CSV : public r_Convertor
67 {
68 public:
70  r_Conv_CSV( const char *src, const r_Minterval &interv, const r_Type *tp) throw(r_Error);
72  r_Conv_CSV( const char *src, const r_Minterval &interv, int tp ) throw(r_Error);
74  ~r_Conv_CSV( void );
75 
77  virtual r_convDesc &convertTo( const char *options=NULL ) throw(r_Error);
79  virtual r_convDesc &convertFrom( const char *options=NULL ) throw(r_Error);
81  virtual r_Convertor *clone( void ) const;
83  virtual const char *get_name( void ) const;
84  virtual r_Data_Format get_data_format( void ) const;
85 
86 
87 private:
88  template <class baseType, class castType>
89  void print(std::ofstream &f, baseType* val, int *dims, int dim);
91  void printStruct(std::ofstream &f, int *dims, int dim);
93  void printStructVal(std::ofstream &f);
94 
95  char* val;
96 };
97 
98 #endif
Definition: csv.hh:66
virtual r_convDesc & convertFrom(const char *options=NULL)
convert from CSV
Definition: error.hh:88
Definition: type.hh:56
virtual const char * get_name(void) const
identification
Definition: convertor.hh:111
r_Conv_CSV(const char *src, const r_Minterval &interv, const r_Type *tp)
constructor using an r_Type object. Exception if the type isn't atomic.
r_Data_Format
Definition: mddtypes.hh:133
virtual r_convDesc & convertTo(const char *options=NULL)
convert to CSV
virtual r_Convertor * clone(void) const
cloning
~r_Conv_CSV(void)
destructor
virtual r_Data_Format get_data_format(void) const
Definition: convertor.hh:56
Definition: minterval.hh:249