LibSWOC++ 1.5.14
Solid Wall of C++
Loading...
Searching...
No Matches
swoc_ip.cc File Reference
#include "swoc/swoc_ip.h"
#include "swoc/swoc_meta.h"
Include dependency graph for swoc_ip.cc:

Go to the source code of this file.

Classes

class  TextView
 

Namespaces

namespace  swoc
 For template deduction guides.
 

Functions

bool swoc::operator== (IPAddr const &lhs, sockaddr const *rhs)
 Equality.
 
intmax_t svtoi (TextView src, TextView *out, int base)
 
uintmax_t svtou (TextView src, TextView *out, int base)
 

Detailed Description

IP address support.

Definition in file swoc_ip.cc.

Function Documentation

◆ svtoi()

intmax_t swoc::svtoi ( TextView src,
TextView * parsed = nullptr,
int base = 0 )

Convert the text in TextView src to a signed numeric value.

If parsed is non-null then the part of the string actually parsed is placed there. base sets the conversion base. If not set base 10 is used with two special cases:

  • If the number starts with a literal '0' then it is treated as base 8.
  • If the number starts with the literal characters '0x' or '0X' then it is treated as base 16.

If base is explicitly set then any leading radix indicator is not supported.

Definition at line 45 of file TextView.cc.

◆ svtou()

uintmax_t swoc::svtou ( TextView src,
TextView * parsed = nullptr,
int base = 0 )

Convert the text in TextView src to an unsigned numeric value.

If parsed is non-null then the part of the string actually parsed is placed there. base sets the conversion base. If not set base 10 is used with two special cases:

  • If the number starts with a literal '0' then it is treated as base 8.
  • If the number starts with the literal characters '0x' or '0X' then it is treated as base 16.

If base is explicitly set then any leading radix indicator is not supported.

Definition at line 81 of file TextView.cc.