As a result of the review.
-// Copyright (C) 2016-2018 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2016-2019 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
-// Copyright (C) 2016-2017 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2016-2019 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
/// @brief Default constructor.
///
- /// Sets current universal time as time value.
- /// Time resolution is to seconds (i.e no fractional seconds).
+ /// Sets current universal time as time value.
+ /// Time resolution is to seconds (i.e no fractional seconds).
HttpDateTime();
/// @brief Construct from @c boost::posix_time::ptime object.
-// Copyright (C) 2015 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2015-2019 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
}
width = fsecs_precision;
- }
+ }
- s << "." << std::setw(width)
+ s << "." << std::setw(width)
<< std::setfill('0')
<< fsecs;
}
-// Copyright (C) 2015 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2015-2019 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
/// Zero omits the value.
///
/// @return a string representing time
-std::string ptimeToText(boost::posix_time::ptime t,
+std::string ptimeToText(boost::posix_time::ptime t,
size_t fsecs_precision = DEFAULT_FRAC_SECS);
/// @brief Converts StatsDuration to text
-// Copyright (C) 2015-2016 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2015-2019 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
for (int precision = 0; precision <= DEFAULT_FRAC_SECS; ++precision) {
if (precision == 1) {
expected.push_back('.');
- }
+ }
- if (precision >= 1) {
+ if (precision >= 1) {
expected.push_back('0');
}
// Expected string should have same precision as default, so
// test the default.
- sepoch = ptimeToText(pepoch);
+ sepoch = ptimeToText(pepoch);
EXPECT_EQ(expected, sepoch);
// Now test a requested precision beyond default. We should
if (precision == 1) {
expected.push_back('.');
expected.push_back('5');
- } else if (precision > 1) {
+ } else if (precision > 1) {
expected.push_back('0');
}
// Expected string should have same precision as default, so
// test the default.
- sbast = ptimeToText(pbast);
+ sbast = ptimeToText(pbast);
EXPECT_EQ(expected, sbast);
// Now test a requested precision beyond default. We should