NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.5: NDN, CCN, CCNx, content centric networks
API Documentation
ndn::AsHex Class Reference

Helper class to convert a number to hexadecimal format, for use with stream insertion operators. More...

#include <string-helper.hpp>

Public Member Functions

constexpr AsHex (uint64_t val) noexcept
 

Friends

std::ostream & operator<< (std::ostream &, const AsHex &)
 

Detailed Description

Helper class to convert a number to hexadecimal format, for use with stream insertion operators.

Example usage:

std::cout << AsHex{42}; // outputs "0x2a"
std::cout << std::uppercase << AsHex{42}; // outputs "0x2A"

Definition at line 48 of file string-helper.hpp.

Constructor & Destructor Documentation

◆ AsHex()

constexpr ndn::AsHex::AsHex ( uint64_t  val)
inlineexplicitconstexprnoexcept

Definition at line 52 of file string-helper.hpp.

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  ,
const AsHex  
)
friend

Definition at line 34 of file string-helper.cpp.


The documentation for this class was generated from the following file:
ndn::AsHex::AsHex
constexpr AsHex(uint64_t val) noexcept
Definition: string-helper.hpp:52