MT Core (C++)
Core library for replacing C++ standard in project usage
Loading...
Searching...
No Matches
mtcore::io::Formatter< IPv4 > Struct Reference

Formats IPv4 addresses No formatting options are available. More...

#include <ip.hpp>

Inheritance diagram for mtcore::io::Formatter< IPv4 >:
Collaboration diagram for mtcore::io::Formatter< IPv4 >:

Static Public Member Functions

template<WriterImpl WI>
static Result< size_t, typename Writer< WI >::ErrType > fmt (Writer< WI > &writer, FormatOptions, const IPv4 &val)
 

Detailed Description

Formats IPv4 addresses No formatting options are available.

Definition at line 287 of file ip.hpp.

Member Function Documentation

◆ fmt()

template<WriterImpl WI>
static Result< size_t, typename Writer< WI >::ErrType > mtcore::io::Formatter< IPv4 >::fmt ( Writer< WI > & writer,
FormatOptions ,
const IPv4 & val )
inlinestatic

Definition at line 289 of file ip.hpp.

289 {
290 const auto p1 = (val.bits >> 24) & 0xff;
291 const auto p2 = (val.bits >> 16) & 0xff;
292 const auto p3 = (val.bits >> 8) & 0xff;
293 const auto p4 = (val.bits >> 0) & 0xff;
294 return print(writer, "{d}.{d}.{d}.{d}", p1, p2, p3, p4);
295 }
Result< size_t, typename Writer< WI >::ErrType > print(Writer< WI > &writer, const char *fmt, const Args &...args)
Prints arguments using a format string Element insert points are designated by a pair of curly braces...
Struct to override to specify how a type should be formatted.
Definition format.hpp:45
Here is the call graph for this function:

The documentation for this struct was generated from the following file: