31#include <libdap/BaseType.h>
32#include <libdap/Str.h>
33#include <libdap/Error.h>
34#include <libdap/debug.h>
35#include <libdap/ServerFunctionsList.h>
37#include "LinearScaleFunction.h"
51function_dap2_version(
int, BaseType *[], DDS &dds, BaseType **btpp)
53 string xml_value =
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
58 ServerFunctionsList *sfList = libdap::ServerFunctionsList::TheList();
59 std::multimap<string,libdap::ServerFunction *>::iterator begin = sfList->begin();
60 std::multimap<string,libdap::ServerFunction *>::iterator end = sfList->end();
61 std::multimap<string,libdap::ServerFunction *>::iterator sfit;
63 xml_value +=
"<ds:functions xmlns:ds=\"http://xml.opendap.org/ns/DAP/4.0/dataset-services#\">\n";
64 for(sfit=begin; sfit!=end; sfit++){
65 sf = sfList->getFunction(sfit);
66 if(sf->canOperateOn(dds)){
67 xml_value +=
" <ds:function name=\"" + sf->getName() +
"\""+
68 " version=\"" + sf->getVersion() +
"\""+
69 " type=\"" + sf->getTypeString() +
"\""+
70 " role=\"" + sf->getRole() +
"\""+
72 xml_value +=
" <ds:Description href=\"" + sf->getDocUrl() +
"\">" + sf->getDescriptionString() +
"</ds:Description>\n";
73 xml_value +=
" </ds:function>\n";
76 xml_value +=
"</functions>\n";
78 Str *response =
new Str(
"version");
80 response->set_value(xml_value);
93BaseType *function_dap4_version(D4RValueList *, DMR &dmr)
95 string xml_value =
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
100 ServerFunctionsList *sfList = libdap::ServerFunctionsList::TheList();
101 std::multimap<string,libdap::ServerFunction *>::iterator begin = sfList->begin();
102 std::multimap<string,libdap::ServerFunction *>::iterator end = sfList->end();
103 std::multimap<string,libdap::ServerFunction *>::iterator sfit;
105 xml_value +=
"<ds:functions xmlns:ds=\"http://xml.opendap.org/ns/DAP/4.0/dataset-services#\">\n";
106 for(sfit=begin; sfit!=end; sfit++){
107 sf = sfList->getFunction(sfit);
108 if(sf->canOperateOn(dmr)){
109 xml_value +=
" <ds:function name=\"" + sf->getName() +
"\""+
110 " version=\"" + sf->getVersion() +
"\""+
111 " type=\"" + sf->getTypeString() +
"\""+
112 " role=\"" + sf->getRole() +
"\""+
114 xml_value +=
" <ds:Description href=\"" + sf->getDocUrl() +
"\">" + sf->getDescriptionString() +
"</ds:Description>\n";
115 xml_value +=
" </ds:function>\n";
118 xml_value +=
"</functions>\n";
120 Str *response =
new Str(
"version");
122 response->set_value(xml_value);