libdap++  Updated for version 3.12.0
DAS.h
Go to the documentation of this file.
1 
2 // -*- mode: c++; c-basic-offset:4 -*-
3 
4 // This file is part of libdap, A C++ implementation of the OPeNDAP Data
5 // Access Protocol.
6 
7 // Copyright (c) 2002,2003 OPeNDAP, Inc.
8 // Author: James Gallagher <jgallagher@opendap.org>
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 OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112.
25 
26 // (c) COPYRIGHT URI/MIT 1994-1999
27 // Please read the full copyright statement in the file COPYRIGHT_URI.
28 //
29 // Authors:
30 // jhrg,jimg James Gallagher <jgallagher@gso.uri.edu>
31 
32 // Using the DASVHMap class, build a parser for the DAS and add functions
33 // that provide access to the variables, their attributes and values.
34 //
35 // jhrg 7/25/94
36 
37 #ifndef _das_h
38 #define _das_h 1
39 
40 
41 #include <cstdio>
42 #include <string>
43 #include <iostream>
44 
45 #ifndef _attrtable_h
46 #include "AttrTable.h"
47 #endif
48 
49 using std::cout;
50 
51 namespace libdap
52 {
53 
121 class DAS : public DapObj
122 {
123 private:
124  AttrTable *d_container ;
125  string _container_name ;
126  AttrTable d_attrs ;
127 
128 public:
129  DAS();
130 
131  virtual ~DAS();
132 
133  virtual string container_name() ;
134  virtual void container_name( const string &cn ) ;
135  virtual AttrTable *container() ;
136 
144  if (d_container)
145  return d_container;
146  return &d_attrs;
147  }
148 
149  virtual void erase() ;
150 
151  virtual unsigned int get_size() const ;
152 
155 
156  string get_name(AttrTable::Attr_iter &i);
158 
159  virtual AttrTable *get_table(const string &name);
160 
161  virtual AttrTable *add_table(const string &name, AttrTable *at);
162 
164  virtual void parse(string fname);
165  virtual void parse(int fd);
166  virtual void parse(FILE *in = stdin);
167 
169  virtual void print(FILE *out, bool dereference = false);
170  virtual void print(ostream &out, bool dereference = false);
171 
172  virtual void dump(ostream &strm) const ;
173 };
174 
175 } // namespace libdap
176 
177 #endif // _das_h