bes  Updated for version 3.20.6
CSV_Obj.h
1 // CSV_Obj.h
2 
3 // This file is part of bes, A C++ back-end server implementation framework
4 // for the OPeNDAP Data Access Protocol.
5 
6 // Copyright (c) 2004-2009 University Corporation for Atmospheric Research
7 // Author: Stephan Zednik <zednik@ucar.edu> and Patrick West <pwest@ucar.edu>
8 // and Jose Garcia <jgarcia@ucar.edu>
9 //
10 // This library is free software; you can redistribute it and/or
11 // modify it under the terms of the GNU Lesser General Public
12 // License as published by the Free Software Foundation; either
13 // version 2.1 of the License, or (at your option) any later version.
14 //
15 // This library is distributed in the hope that it will be useful,
16 // but WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 // Lesser General Public License for more details.
19 //
20 // You should have received a copy of the GNU Lesser General Public
21 // License along with this library; if not, write to the Free Software
22 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23 //
24 // You can contact University Corporation for Atmospheric Research at
25 // 3080 Center Green Drive, Boulder, CO 80301
26 
27 // (c) COPYRIGHT University Corporation for Atmospheric Research 2004-2005
28 // Please read the full copyright statement in the file COPYRIGHT_UCAR.
29 //
30 // Authors:
31 // zednik Stephan Zednik <zednik@ucar.edu>
32 // pwest Patrick West <pwest@ucar.edu>
33 // jgarcia Jose Garcia <jgarcia@ucar.edu>
34 
35 #ifndef I_CSV_Obj_h
36 #define I_CSV_Obj_h 1
37 
38 #include <string>
39 #include <vector>
40 
41 #include <BESObj.h>
42 
43 #include "CSV_Reader.h"
44 #include "CSV_Header.h"
45 #include "CSV_Data.h"
46 
47 class CSV_Obj : public BESObj
48 {
49 private:
50  CSV_Reader* _reader ;
51  CSV_Header* _header ;
52  std::vector<CSV_Data*>* _data ;
53 public:
54  CSV_Obj() ;
55  virtual ~CSV_Obj() ;
56 
57  bool open( const std::string& filepath ) ;
58 
59  void load() ;
60 
61  void getFieldList( std::vector<std::string> &list ) ;
62 
63  std::string getFieldType( const std::string& fieldName ) ;
64 
65  int getRecordCount() ;
66 
67  void * getFieldData( const std::string& field ) ;
68 
69  std::vector<std::string> getRecord( const int rowCount ) ;
70 
71  virtual void dump( std::ostream &strm ) const ;
72 } ;
73 
74 #endif // I_CSV_Obj_h
75 
BESObj
top level BES object to house generic methods
Definition: BESObj.h:49
CSV_Header
Definition: CSV_Header.h:46
CSV_Reader
Definition: CSV_Reader.h:46
CSV_Obj
Definition: CSV_Obj.h:47
CSV_Obj::dump
virtual void dump(std::ostream &strm) const
dump the contents of this object to the specified ostream
Definition: CSV_Obj.cc:239