Astarte device API for C++ 0.8.1
Astarte device SDK for C++
Loading...
Searching...
No Matches
formatter.hpp File Reference

Data formatting utilities for Astarte types. More...

#include <chrono>
#include <cstddef>
#include <cstdint>
#include <ctime>
#include <string>
#include <string_view>
#include <type_traits>
#include <vector>
#include <spdlog/fmt/fmt.h>
#include <iomanip>
#include <sstream>

Go to the source code of this file.

Classes

struct  astarte_fmt::formatter< T >
 Base formatter struct declaration for Doxygen. More...
 

Namespaces

namespace  astarte_fmt
 Namespace alias for the formatting library (std or fmt).
 
namespace  astarte
 Global namespace for all Astarte related functionality.
 
namespace  astarte::device
 Umbrella namespace for the Astarte device library.
 
namespace  astarte::device::utils
 Utility functions for formatting data.
 

Functions

template<typename OutputIt>
void astarte::device::utils::format_base64 (OutputIt &out, const std::vector< uint8_t > &data)
 Format a vector of bytes into a Base64 string literal.
 
template<typename OutputIt>
void astarte::device::utils::format_timestamp (OutputIt &out, const std::chrono::system_clock::time_point &data)
 Format a timestamp into an ISO 8601 string literal.
 
template<typename OutputIt, typename T>
void astarte::device::utils::format_data (OutputIt &out, const T &data)
 Format a generic data type into an output iterator.
 
template<typename OutputIt, typename T>
void astarte::device::utils::format_vector (OutputIt &out, const std::vector< T > &data)
 Format a generic vector into a comma-separated list in brackets.
 

Detailed Description

Data formatting utilities for Astarte types.

This file provides utility functions and templates to format internal Astarte data types into strings or serialized formats (like Base64 and ISO 8601), facilitating logging and transmission.