OPeNDAP Hyrax Back End Server (BES)  Updated for version 3.8.3
w10n_utils.h
Go to the documentation of this file.
1 // -*- mode: c++; c-basic-offset:4 -*-
2 //
3 // w10n_utils.h
4 //
5 // This file is part of BES w10n handler
6 //
7 // Copyright (c) 2015v OPeNDAP, Inc.
8 // Author: Nathan Potter <ndp@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 // Please read the full copyright statement in the file COPYRIGHT_URI.
26 //
27 
28 #ifndef E_w10n_util_h
29 #define E_w10n_util_h 1
30 
31 
32 
33 #include <string>
34 #include <list>
35 #include <iostream>
36 
37 #include <DDS.h>
38 #include <Array.h>
39 #include <Constructor.h>
40 
41 using std::string ;
42 using std::list ;
43 using std::ostream ;
44 
45 namespace w10n {
47  void eval_resource_path(
48  const string &w10nResourceId,
49  const string &catalogRoot,
50  const bool follow_sym_links,
51  string &validPath,
52  bool &isFile,
53  bool &isDir,
54  string &remainder
55  );
56 
57 
58  std::string escape_for_json(const std::string& input);
59 
60  // std::string backslash_escape(std::string source, char char_to_escape);
61 
62  long computeConstrainedShape(libdap::Array *a, std::vector<unsigned int> *shape );
63  void checkConstructorForW10nDataCompatibility(libdap::Constructor *constructor);
64  void checkConstrainedDDSForW10nDataCompatibility(libdap::DDS *dds);
65  bool allVariablesMarkedToSend(libdap::DDS *dds);
66  bool allVariablesMarkedToSend(libdap::Constructor *ctor);
67 
68 
69 } // namespace w10n
70 
71 #endif // E_w10n_util_h
72 
void checkConstrainedDDSForW10nDataCompatibility(libdap::DDS *dds)
Definition: w10n_utils.cc:334
std::string escape_for_json(const std::string &input)
Definition: w10n_utils.cc:222
void checkConstructorForW10nDataCompatibility(libdap::Constructor *constructor)
Definition: w10n_utils.cc:365
bool allVariablesMarkedToSend(libdap::DDS *dds)
Definition: w10n_utils.cc:405
void eval_resource_path(const string &w10nResourceId, const string &catalogRoot, const bool follow_sym_links, string &validPath, bool &isFile, bool &isDir, string &remainder)
Check if the specified path is valid.
Definition: w10n_utils.cc:69
long computeConstrainedShape(libdap::Array *a, std::vector< unsigned int > *shape)
Definition: w10n_utils.cc:296