Kea 2.5.8
boost_time_utils.h
Go to the documentation of this file.
1// Copyright (C) 2015-2019 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 KEA_BOOST_TIME_UTILS_H
8#define KEA_BOOST_TIME_UTILS_H
9
10#include <boost/date_time/posix_time/posix_time.hpp>
11#include <string>
12
13namespace isc {
14namespace util {
15
18const size_t MAX_FSECS_PRECISION=boost::posix_time::time_duration::num_fractional_digits();
19
37std::string ptimeToText(boost::posix_time::ptime t,
38 size_t fsecs_precision = MAX_FSECS_PRECISION);
39
50std::string durationToText(boost::posix_time::time_duration dur,
51 size_t fsecs_precision = MAX_FSECS_PRECISION);
52
53}; // end of isc::util namespace
54}; // end of isc namespace
55
56#endif
const size_t MAX_FSECS_PRECISION
The number of digits of fractional seconds supplied by the underlying class, boost::posix_time.
std::string durationToText(boost::posix_time::time_duration dur, size_t fsecs_precision=MAX_FSECS_PRECISION)
Converts StatsDuration to text.
std::string ptimeToText(boost::posix_time::ptime t, size_t fsecs_precision=MAX_FSECS_PRECISION)
Converts ptime structure to text.
Defines the logger used by the top-level component of kea-lfc.