File Coverage

/usr/local/lib/perl5/site_perl/5.26.1/x86_64-linux/XS/libpanda.x/i/panda/from_chars.h
Criterion Covered Total %
statement 2 2 100.0
branch n/a
condition n/a
subroutine n/a
pod n/a
total 2 2 100.0


line stmt bran cond sub pod time code
1             #pragma once
2             #include
3             #include
4             #include
5             #include
6             #include
7              
8             //#if __cpp_lib_to_chars >= 201611L
9             //# include
10             //#else
11              
12             namespace panda {
13              
14             struct from_chars_result {
15             const char* ptr;
16             std::error_code ec;
17             };
18              
19             struct to_chars_result {
20             char* ptr;
21             std::error_code ec;
22             };
23              
24             from_chars_result from_chars (const char* first, const char* last, int8_t& value, int base = 10);
25             from_chars_result from_chars (const char* first, const char* last, int16_t& value, int base = 10);
26             from_chars_result from_chars (const char* first, const char* last, int& value, int base = 10);
27             from_chars_result from_chars (const char* first, const char* last, long& value, int base = 10);
28             from_chars_result from_chars (const char* first, const char* last, long long& value, int base = 10);
29             from_chars_result from_chars (const char* first, const char* last, uint8_t& value, int base = 10);
30             from_chars_result from_chars (const char* first, const char* last, uint16_t& value, int base = 10);
31             from_chars_result from_chars (const char* first, const char* last, unsigned& value, int base = 10);
32             from_chars_result from_chars (const char* first, const char* last, unsigned long& value, int base = 10);
33             from_chars_result from_chars (const char* first, const char* last, unsigned long long& value, int base = 10);
34              
35             to_chars_result to_chars (char* first, char* last, int8_t value, int base = 10);
36             to_chars_result to_chars (char* first, char* last, int16_t value, int base = 10);
37             to_chars_result to_chars (char* first, char* last, int value, int base = 10);
38             to_chars_result to_chars (char* first, char* last, long value, int base = 10);
39             to_chars_result to_chars (char* first, char* last, long long value, int base = 10);
40             to_chars_result to_chars (char* first, char* last, uint8_t value, int base = 10);
41             to_chars_result to_chars (char* first, char* last, uint16_t value, int base = 10);
42             to_chars_result to_chars (char* first, char* last, unsigned value, int base = 10);
43             to_chars_result to_chars (char* first, char* last, unsigned long value, int base = 10);
44             to_chars_result to_chars (char* first, char* last, unsigned long long value, int base = 10);
45              
46             template
47             constexpr typename std::enable_if::value, size_t>::type to_chars_maxsize (int base = 10) {
48             return std::ceil(std::numeric_limits::digits * (std::log(2) / std::log(base)));
49             }
50              
51             template
52 4           constexpr typename std::enable_if::value, size_t>::type to_chars_maxsize (int base = 10) {
53 4           return std::ceil(std::numeric_limits::digits * (std::log(2) / std::log(base)) + 1);
54             }
55              
56             }