|
Motion Master 6.0.0-alpha.86
Next-generation motion control software
|
#include <algorithm>#include <array>#include <bit>#include <charconv>#include <cstddef>#include <cstdint>#include <format>#include <optional>#include <span>#include <string>#include <string_view>#include <type_traits>#include <vector>Go to the source code of this file.
Namespaces | |
| namespace | mm |
| namespace | mm::core |
Functions | |
| bool | mm::core::isUrlSafeId (std::string_view s) |
Whether s is a valid URL-safe identifier usable as a path segment and pub/sub topic. | |
| template<typename T > | |
| std::optional< T > | mm::core::parseHexOrDec (std::string_view s) |
| Parses an unsigned integer from a string in decimal or hexadecimal notation. | |
| std::string | mm::core::toHex (std::span< const uint8_t > bytes, std::string_view separator={}) |
| Formats bytes as uppercase hexadecimal. | |
| std::optional< std::vector< uint8_t > > | mm::core::fromHex (std::string_view hex) |
Decodes a continuous hexadecimal string into bytes — the inverse of toHex. | |
| template<typename T > | |
| std::array< uint8_t, sizeof(T)> | mm::core::toBytes (T value, std::endian order=std::endian::little) |
| Encodes an integer into a fixed-width byte array in the given byte order. | |
| template<typename T > | |
| T | mm::core::fromBytes (std::span< const uint8_t > bytes, std::endian order=std::endian::little) |
| Decodes an integer from a raw byte buffer interpreted in the given byte order. | |