rasdaman API
vff.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_VFF_HH_
37 #define _R_CONV_VFF_HH_
38 
39 #include "conversion/convertor.hh"
40 
41 
42 
43 //@ManMemo: Module {\bf conversion}
44 
45 /*@Doc:
46  VFF convertor class.
47 
48  Supported parameters are
49 
50  \begin{tabular}{rcl}
51  dorder && string && data order to read/write in 3D mode; permutations of "xyz"\\
52  dimorder && string && dimension order for vectors (size, origin, ...)\\
53  vffendian && int && default endianness, 0 for big endian, 1 for little\\
54  \end{tabular}
55 
56 */
57 
58 class r_Conv_VFF : public r_Convertor
59 {
60 public:
62  r_Conv_VFF( const char *src, const r_Minterval &interv, const r_Type *tp ) throw(r_Error);
64  r_Conv_VFF( const char *src, const r_Minterval &interv, int tp ) throw(r_Error);
66  ~r_Conv_VFF( void );
67 
69  virtual r_convDesc &convertTo( const char *options=NULL ) throw(r_Error);
71  virtual r_convDesc &convertFrom( const char *options=NULL ) throw(r_Error);
73  virtual r_Convertor *clone( void ) const;
75  virtual const char *get_name( void ) const;
76  virtual r_Data_Format get_data_format( void ) const;
77 
78 
79 private:
81  void initVFF( void );
83  static void skip_white( const char *&str );
85  static const char *read_vector( r_Dimension dim, const char *str, double *&vec );
87  static const char *read_string( const char *str, char *dest, bool allowSpace=0 );
89  static void write_interval( const char *keyname, std::ostream &str, const r_Minterval &iv,
90  const unsigned int *order, r_Range inc=0 );
92  static void write_origin( const char *keyname, std::ostream &str, const r_Minterval &iv,
93  const unsigned int *order );
95  static const char *get_endian_id( void );
97  static int parse_data_order( r_Dimension dim, const char *dstr, unsigned int *order );
99  static const char *get_default_order( r_Dimension dim );
101  static const char *get_default_dim_order( r_Dimension dim );
102 
104  unsigned int *get_dimension_order( r_Dimension dim ) const;
106  const char *get_default_endianness( void ) const;
107 
109  char *dorderParam;
111  char *dimOrderParam;
113  int dfltEndianness;
114 
116  static const char *fileMagic;
118  static const char *keywords[];
120  static const char *kval_Raster;
121  static const char *kval_Slice;
122  static const char *kval_LEndian;
123  static const char *kval_BEndian;
125  static const char *dfltDataOrder2;
126  static const char *dfltDataOrder3;
128  static const char *dfltDimOrder2;
129  static const char *dfltDimOrder3;
131  static const char endOfHeader;
133  static const char *method_convTo;
135  static const char *method_convFrom;
136 };
137 
138 #endif
Definition: error.hh:88
Definition: type.hh:56
int r_Range
Definition: mddtypes.hh:100
unsigned int r_Dimension
Definition: mddtypes.hh:118
Definition: vff.hh:58
~r_Conv_VFF(void)
destructor
Definition: convertor.hh:111
virtual r_Data_Format get_data_format(void) const
r_Data_Format
Definition: mddtypes.hh:133
r_Conv_VFF(const char *src, const r_Minterval &interv, const r_Type *tp)
constructor using an r_Type object
virtual r_Convertor * clone(void) const
cloning
virtual r_convDesc & convertTo(const char *options=NULL)
convert to VFF
virtual r_convDesc & convertFrom(const char *options=NULL)
convert from VFF
virtual const char * get_name(void) const
identification
Definition: convertor.hh:56
Definition: minterval.hh:249