Motion Master 6.0.0-alpha.50
Next-generation motion control software
Loading...
Searching...
No Matches
util.h File Reference
#include <algorithm>
#include <array>
#include <bit>
#include <charconv>
#include <cstddef>
#include <cstdint>
#include <optional>
#include <span>
#include <string_view>
#include <type_traits>
Include dependency graph for util.h:
This graph shows which files directly or indirectly include this file:

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.
 
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 >
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.