Kea 2.6.0
dhcp_space.h
Go to the documentation of this file.
1// Copyright (C) 2022 Internet Systems Consortium, Inc. ("ISC")
2//
3// This Source Code Form is subject to the terms of the Mozilla Public
4// License, v. 2.0. If a copy of the MPL was not distributed with this
5// file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
7#ifndef ISC_UTIL_DHCP_SPACE_H
8#define ISC_UTIL_DHCP_SPACE_H 1
9
10#include <string>
11
12#include <boost/algorithm/string/replace.hpp>
13
14namespace isc {
15namespace util {
16
20};
21
27template <DhcpSpace D>
28char const* cStringDhcpSpace();
29
35template <DhcpSpace D>
36std::string formatDhcpSpace(char const* const format_string) {
37 std::string result(format_string);
38 boost::replace_all(result, "{}", cStringDhcpSpace<D>());
39 return result;
40}
41
42} // namespace util
43} // namespace isc
44
45#endif // ISC_UTIL_DHCP_SPACE_H
std::string formatDhcpSpace(char const *const format_string)
Replaces all occurrences of {} with 4 or 6 based on the templated DHCP space.
Definition: dhcp_space.h:36
char const * cStringDhcpSpace()
Provides the C string representation of the DHCP space.
Defines the logger used by the top-level component of kea-lfc.