ifw-daq  2.1.0-pre1
IFW Data Acquisition modules
uri.hpp
Go to the documentation of this file.
1 /**
2  * @file
3  * @ingroup daq_ocm_libdaqif_suppport
4  * @copyright 2022 ESO - European Southern Observatory
5  *
6  * @brief Contains URI support functions for daqif
7  */
8 #ifndef OCMIF_URI_HPP_
9 #define OCMIF_URI_HPP_
10 #include <string>
11 #include <string_view>
12 #include <network/uri.hpp>
13 
14 
15 namespace daqif {
16 
17 /**
18  * Creates a server URI
19  *
20  * @param uri Base URI in the expected form e.g. "<URI>" or "<URI>/".
21  * @returns URI with single trailing slash.
22  */
23 network::uri MakeServerUri(std::string uri);
24 
25 /**
26  * Creates a service URI of the form <baseuri>/<service>.
27  *
28  * @param base_uri Base URI in the expected form e.g. "<URI>" or "<URI>/".
29  * @param service_path URI path element in the form "<path>" or "/<path>".
30  * @returns <base_uri>/<service_path> URI with any extra slashes stripped when joining the paths.
31  */
32 network::uri MakeServiceUri(std::string base_uri, std::string_view service_path);
33 
34 }
35 #endif // #ifndef OCMIF_URI_HPP_
daqif::MakeServiceUri
network::uri MakeServiceUri(std::string base_uri, std::string_view service_path)
Creates a service URI of the form <baseuri>/<service>.
Definition: uri.cpp:19
daqif
Definition: parsing.hpp:14
daqif::MakeServerUri
network::uri MakeServerUri(std::string uri)
Creates a server URI.
Definition: uri.cpp:13