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

Formats a masked version 4 IP address with a subnet. More...

#include <ip.hpp>

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

Static Public Member Functions

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

Detailed Description

Formats a masked version 4 IP address with a subnet.

Definition at line 423 of file ip.hpp.

Member Function Documentation

◆ fmt()

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

Definition at line 425 of file ip.hpp.

425 {
426 if (!val.is_valid()) {
427 return print(writer, "[INVALID SUBNET V4]{}{}", val.ip, SubnetMaskV4::by_id(val.mask_id));
428 }
429 return print(writer, "{}{}", val.ip, SubnetMaskV4::by_id(val.mask_id));
430 }
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: