bes Updated for version 3.21.1
The Backend Server (BES) is the lower two tiers of the Hyrax data server
kvp_utils.h
1// -*- mode: c++; c-basic-offset:4 -*-
2
3// This file is part of the BES
4
5// Copyright (c) 2020 OPeNDAP, Inc.
6// Author: Nathan Potter<ndp@opendap.org>
7//
8// This library is free software; you can redistribute it and/or
9// modify it under the terms of the GNU Lesser General Public
10// License as published by the Free Software Foundation; either
11// version 2.1 of the License, or (at your option) any later version.
12//
13// This library is distributed in the hope that it will be useful,
14// but WITHOUT ANY WARRANTY; without even the implied warranty of
15// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16// Lesser General Public License for more details.
17//
18// You should have received a copy of the GNU Lesser General Public
19// License along with this library; if not, write to the Free Software
20// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21//
22// You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112.
23// Created by ndp on 12/11/19.
24//
25
26#ifndef HYRAX_KVP_UTILS_H
27#define HYRAX_KVP_UTILS_H
28#include <fstream>
29#include <unordered_map>
30#include <set>
31#include <vector>
32
33
34namespace kvp {
35
36
37void load_keys(
38 std::ifstream *keys_file,
39 std::unordered_map<std::string,
40 std::vector<std::string> > &keystore);
41
42void load_keys(
43 const std::string &keys_file_name,
44 std::set<std::string> &loaded_kvp_files,
45 std::unordered_map<std::string, std::vector<std::string> > &keystore);
46
47void load_keys(
48 const std::string &config_file,
49 std::unordered_map <std::string, std::vector<std::string>> &keystore);
50
51bool break_pair(const char* b, std::string& key, std::string &value, bool &addto);
52
53} // namespace kvp
54
55#endif //HYRAX_KVP_UTILS_H