#include <algorithm>
#include <cstdlib>
#include <cstring>
#include <iterator>
#include <sstream>
#include <string>
Go to the source code of this file.
◆ align() [1/2]
template<typename Ptr >
constexpr Ptr plywoot::detail::align |
( |
Ptr |
ptr, |
|
|
std::size_t |
alignment |
|
) |
| |
|
constexpr |
Aligns the given input pointer. Implementation is taken from GCCs std::align
implementation. The given alignment value should be a power of two.
- Parameters
-
ptr | pointer to align |
alignment | alignment requirements of the given pointer |
- Returns
ptr
aligned according to the given alignment requirements
Definition at line 50 of file std.hpp.
◆ align() [2/2]
template<>
constexpr std::size_t plywoot::detail::align |
( |
std::size_t |
ptr, |
|
|
std::size_t |
alignment |
|
) |
| |
|
constexpr |
Aligns the given input pointer. Implementation is taken from GCCs std::align
implementation. The given alignment value should be a power of two.
- Parameters
-
ptr | pointer to align |
alignment | alignment requirements of the given pointer |
- Returns
ptr
aligned according to the given alignment requirements
Definition at line 69 of file std.hpp.
◆ starts_with()
bool plywoot::detail::starts_with |
( |
const std::string & |
s, |
|
|
const char * |
prefix |
|
) |
| |
|
inline |
Returns whether the given string starts with the given prefix.
- Parameters
-
s | string to check for the given prefix |
prefix | prefix text to find |
- Returns
true
in case the given string starts with the given prefix, false
otherwise
Definition at line 151 of file std.hpp.
◆ to_number() [1/2]
template<typename Number >
Number plywoot::detail::to_number |
( |
const char * |
first, |
|
|
const char * |
last, |
|
|
const char ** |
end |
|
) |
| |
|
inline |
Converts a text to an integer number. The fast_int library will be used to perform the conversion in case it was found during the configuration stage.
- Template Parameters
-
Number | integer number type |
- Parameters
-
first | start of the text range |
last | end of the text range |
end | position in the text range that denotes the end of the number text |
- Returns
- converted integer number
Definition at line 90 of file std.hpp.
◆ to_number() [2/2]
template<>
float plywoot::detail::to_number |
( |
const char * |
first, |
|
|
const char * |
last, |
|
|
const char ** |
end |
|
) |
| |
|
inline |
Converts a text to a single precision floating point number. The fast_float library will be used to perform the conversion in case it was found during the configuration stage.
- Parameters
-
first | start of the text range |
last | end of the text range |
end | position in the text range that denotes the end of the number text |
- Returns
- converted single precision floating point number
Definition at line 112 of file std.hpp.
◆ to_number< double >()
Converts a text to a double precision floating point number. The fast_float library will be used to perform the conversion in case it was found during the configuration stage.
- Parameters
-
first | start of the text range |
last | end of the text range |
end | position in the text range that denotes the end of the number text |
- Returns
- converted double precision floating point number
Definition at line 134 of file std.hpp.
◆ to_string()
template<typename T >
std::string plywoot::detail::to_string |
( |
const T & |
t | ) |
|
Generic type to string conversion functionality, requiring that an std::ostream
<< operator is defined for the type. This should only be used in contexts where performance does not matter.
- Parameters
-
t | object to convert to string |
- Returns
t
converted to string
Definition at line 160 of file std.hpp.