bes  Updated for version 3.20.5
CSV_Field.h
1 // CSV_Field.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_Field_h
36 #define I_CSV_Field_h 1
37 
38 #include <string>
39 
40 #include <BESObj.h>
41 
42 using namespace std;
43 
44 class CSV_Field: public BESObj {
45 private:
46  string _name;
47  string _type;
48  int _index;
49 public:
50  CSV_Field(): _name(""), _type(""), _index(0)
51  {
52  }
53  virtual ~CSV_Field()
54  {
55  }
56 
57  void insertName(const string& fieldName)
58  {
59  _name = fieldName;
60  }
61  void insertType(const string& fieldType)
62  {
63  _type = fieldType;
64  }
65  void insertIndex(const int& fieldIndex)
66  {
67  _index = fieldIndex;
68  }
69 
70  string getName() const
71  {
72  return _name;
73  }
74  string getType() const
75  {
76  return _type;
77  }
78  int getIndex() const
79  {
80  return _index;
81  }
82 
83  virtual void dump(ostream &strm) const
84  {
85  strm << BESIndent::LMarg << "CSV_Field::dump - (" << (void *) this << ")" << endl;
86  BESIndent::Indent();
87  strm << BESIndent::LMarg << "name: " << _name << endl << BESIndent::LMarg << "type: " << _type << endl
88  << BESIndent::LMarg << "index: " << _index << endl;
89  BESIndent::UnIndent();
90  }
91 };
92 
93 #endif // I_CSV_Field_h
94 
Base object for bes objects.
Definition: BESObj.h:51
virtual void dump(ostream &strm) const
dump the contents of this object to the specified ostream
Definition: CSV_Field.h:83