libdap Updated for version 3.20.10
libdap4 is an implementation of OPeNDAP's DAP protocol.
D4Maps.cc
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) 2013 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#include "config.h"
26
27#include "XMLWriter.h"
28#include "InternalErr.h"
29#include "D4Maps.h"
30
31using namespace libdap;
32
33void
34D4Map::print_dap4(XMLWriter &xml)
35{
36 if (xmlTextWriterStartElement(xml.get_writer(), (const xmlChar*) "Map") < 0)
37 throw InternalErr(__FILE__, __LINE__, "Could not write Map element");
38
39 if (xmlTextWriterWriteAttribute(xml.get_writer(), (const xmlChar*) "name", (const xmlChar*)d_name.c_str()) < 0)
40 throw InternalErr(__FILE__, __LINE__, "Could not write attribute for name");
41
42 if (xmlTextWriterEndElement(xml.get_writer()) < 0)
43 throw InternalErr(__FILE__, __LINE__, "Could not end Map element");
44
45}
46
47D4Maps&
48D4Maps::operator=(const D4Maps &rhs)
49{
50 if (this == &rhs) return *this;
51 m_duplicate(rhs);
52 return *this;
53}
A class for software fault reporting.
Definition InternalErr.h:65
top level DAP object to house generic methods