Blame D4Maps.cc

Packit a4aae4
// -*- mode: c++; c-basic-offset:4 -*-
Packit a4aae4
Packit a4aae4
// This file is part of libdap, A C++ implementation of the OPeNDAP Data
Packit a4aae4
// Access Protocol.
Packit a4aae4
Packit a4aae4
// Copyright (c) 2013 OPeNDAP, Inc.
Packit a4aae4
// Author: James Gallagher <jgallagher@opendap.org>
Packit a4aae4
//
Packit a4aae4
// This library is free software; you can redistribute it and/or
Packit a4aae4
// modify it under the terms of the GNU Lesser General Public
Packit a4aae4
// License as published by the Free Software Foundation; either
Packit a4aae4
// version 2.1 of the License, or (at your option) any later version.
Packit a4aae4
//
Packit a4aae4
// This library is distributed in the hope that it will be useful,
Packit a4aae4
// but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit a4aae4
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit a4aae4
// Lesser General Public License for more details.
Packit a4aae4
//
Packit a4aae4
// You should have received a copy of the GNU Lesser General Public
Packit a4aae4
// License along with this library; if not, write to the Free Software
Packit a4aae4
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
Packit a4aae4
//
Packit a4aae4
// You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112.
Packit a4aae4
Packit a4aae4
#include "config.h"
Packit a4aae4
Packit a4aae4
#include "XMLWriter.h"
Packit a4aae4
#include "InternalErr.h"
Packit a4aae4
#include "D4Maps.h"
Packit a4aae4
Packit a4aae4
using namespace libdap;
Packit a4aae4
Packit a4aae4
void
Packit a4aae4
D4Map::print_dap4(XMLWriter &xml)
Packit a4aae4
{
Packit a4aae4
	if (xmlTextWriterStartElement(xml.get_writer(), (const xmlChar*) "Map") < 0)
Packit a4aae4
		throw InternalErr(__FILE__, __LINE__, "Could not write Map element");
Packit a4aae4
Packit a4aae4
	if (xmlTextWriterWriteAttribute(xml.get_writer(), (const xmlChar*) "name", (const xmlChar*)d_name.c_str()) < 0)
Packit a4aae4
		throw InternalErr(__FILE__, __LINE__, "Could not write attribute for name");
Packit a4aae4
Packit a4aae4
	if (xmlTextWriterEndElement(xml.get_writer()) < 0)
Packit a4aae4
		throw InternalErr(__FILE__, __LINE__, "Could not end Map element");
Packit a4aae4
Packit a4aae4
}
Packit a4aae4
Packit a4aae4
D4Maps&
Packit a4aae4
D4Maps::operator=(const D4Maps &rhs)
Packit a4aae4
{
Packit a4aae4
	if (this == &rhs) return *this;
Packit a4aae4
	m_duplicate(rhs);
Packit a4aae4
	return *this;
Packit a4aae4
}