Fawkes API Fawkes Development Version
utils.h
1/***************************************************************************
2 * utils.h - Helper functions for mongodb
3 *
4 * Created: Thu 11 Apr 2019 17:53:40 CEST 17:53
5 * Copyright 2019 Till Hofmann <hofmann@kbsg.rwth-aachen.de>
6 ****************************************************************************/
7
8/* This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program 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
16 * GNU Library General Public License for more details.
17 *
18 * Read the full text in the LICENSE.GPL file in the doc directory.
19 */
20
21#ifndef _PLUGINS_MONGODB_UTILS_H_
22#define _PLUGINS_MONGODB_UTILS_H_
23
24#include <bsoncxx/document/element.hpp>
25#include <bsoncxx/document/view.hpp>
26#include <string>
27#include <utility>
28
29bool check_mongodb_ok(const bsoncxx::document::view &reply);
30bsoncxx::document::element get_dotted_field(const bsoncxx::document::view &doc,
31 const std::string & key);
32std::pair<std::string, std::string> split_db_collection_string(const std::string &dbcollection);
33
34#endif /* !_PLUGINS_MONGODB_UTILS_H_ */