libdap Updated for version 3.20.11
libdap4 is an implementation of OPeNDAP's DAP protocol.
Keywords2.h
1// -*- mode: c++; c-basic-offset:4 -*-
2
3// This file is part of libdap, A C++ implementation of the OPeNDAP Data
4// Access Protocol.
5
6// Copyright (c) 2011 OPeNDAP, Inc.
7// Author: James Gallagher <jgallagher@opendap.org>
8//
9// This library is free software; you can redistribute it and/or
10// modify it under the terms of the GNU Lesser General Public
11// License as published by the Free Software Foundation; either
12// version 2.1 of the License, or (at your option) any later version.
13//
14// This library is distributed in the hope that it will be useful,
15// but WITHOUT ANY WARRANTY; without even the implied warranty of
16// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17// Lesser General Public License for more details.
18//
19// You should have received a copy of the GNU Lesser General Public
20// License along with this library; if not, write to the Free Software
21// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22//
23// You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112.
24
25#ifndef KEYWORDS_H_
26#define KEYWORDS_H_
27
28#include <string>
29#include <set>
30#include <map>
31#include <list>
32
33using namespace std;
34
35namespace libdap {
36
52class Keywords {
53public:
54 // convenience types
55 typedef string keyword;
56 typedef string keyword_value;
57 typedef set<keyword_value> value_set_t;
58
59private:
61 map<keyword, keyword_value> d_parsed_keywords;
62
64 map<keyword, value_set_t> d_known_keywords;
65
66 virtual void m_add_keyword(const keyword &word, const keyword_value &value);
67 virtual bool m_is_valid_keyword(const keyword &word, const keyword_value &value) const;
68
69public:
70 Keywords();
71 virtual ~Keywords();
72
73 virtual string parse_keywords(const string &ce);
74
75 // Is this keyword in the dictionary?
76 virtual bool is_known_keyword(const string &s) const;
77
78 // Get a list of all of the keywords parsed
79 virtual list<keyword> get_keywords() const;
80 // Has a particular keyword been parsed
81 virtual bool has_keyword(const keyword &kw) const;
82
83 // Get the parsed keyword (and it's dictionary value) of a particular kind
84 virtual keyword_value get_keyword_value(const keyword &kw) const;
85};
86
87}
88
89#endif /* KEYWORDS_H_ */
virtual keyword_value get_keyword_value(const keyword &kw) const
Definition: Keywords2.cc:158
virtual list< keyword > get_keywords() const
Definition: Keywords2.cc:131
virtual bool has_keyword(const keyword &kw) const
Definition: Keywords2.cc:148
virtual bool is_known_keyword(const string &s) const
Definition: Keywords2.cc:121
virtual string parse_keywords(const string &ce)
Definition: Keywords2.cc:171
top level DAP object to house generic methods
Definition: AlarmHandler.h:36