ANNA Suite  2020b
Multipurpose development suite for Telco applications
Public Member Functions | Public Attributes | List of all members
anna::iana_address_t Struct Reference

#include <defines.hpp>

Public Member Functions

const U16getVersion () const
 
const char * getValue () const
 
bool isIPv4 () const
 
bool isIPv6 () const
 
bool isE164 () const
 
void setIPv4 (const char *value)
 
void setIPv6 (const char *value)
 
void setE164 (const char *value)
 
std::string asString () const
 

Public Attributes

U16 Version
 
std::string Value
 

Detailed Description

Struct for IANA Addresses

Member Function Documentation

◆ asString()

std::string anna::iana_address_t::asString ( void  ) const
inline

Class string representation

Returns
String with class content
480  {
481  std::string result;
482  result += Value.c_str(); // assume that all IANA addresses have a printable representation
483  result += " (";
485 
486  if(versionAsText) {
487  result += versionAsText;
488  result += ", ";
489  }
490 
491  result += "IANA version '";
492  char aux [16];
493  sprintf(aux, "%d", Version);
494  result += aux;
495  result += "')";
496  return result;
497  }
_v
Definition: defines.hpp:380
U16 Version
Definition: defines.hpp:443
static const char * asText(const _v v)
Definition: defines.hpp:424
std::string Value
Definition: defines.hpp:446
Here is the call graph for this function:

◆ getValue()

const char* anna::iana_address_t::getValue ( ) const
inline

Gets the address printable value

453 { return Value.c_str(); }
std::string Value
Definition: defines.hpp:446

◆ getVersion()

const U16& anna::iana_address_t::getVersion ( ) const
inline

Gets the address version

450 { return Version; }
U16 Version
Definition: defines.hpp:443

◆ isE164()

bool anna::iana_address_t::isE164 ( ) const
inline

Return true when is an E164 (SMDS, Frame Relay, ATM) address

_v
Definition: defines.hpp:380
U16 Version
Definition: defines.hpp:443
Definition: defines.hpp:391

◆ isIPv4()

bool anna::iana_address_t::isIPv4 ( ) const
inline

Return true when is an IPv4 address

Definition: defines.hpp:384
_v
Definition: defines.hpp:380
U16 Version
Definition: defines.hpp:443

◆ isIPv6()

bool anna::iana_address_t::isIPv6 ( ) const
inline

Return true when is an IPv6 address

Definition: defines.hpp:385
_v
Definition: defines.hpp:380
U16 Version
Definition: defines.hpp:443

◆ setE164()

void anna::iana_address_t::setE164 ( const char *  value)
inline

Sets version for E164 address and address itself. Checking is not performed ...

472 { Version = iana_address_version_t::E164; Value = value ? value : ""; }
U16 Version
Definition: defines.hpp:443
Definition: defines.hpp:391
std::string Value
Definition: defines.hpp:446

◆ setIPv4()

void anna::iana_address_t::setIPv4 ( const char *  value)
inline

Sets version for IPv4 address and address itself. Checking is not performed (could assign IPv6 instead ...)

466 { Version = iana_address_version_t::IPv4; Value = value ? value : ""; }
Definition: defines.hpp:384
U16 Version
Definition: defines.hpp:443
std::string Value
Definition: defines.hpp:446

◆ setIPv6()

void anna::iana_address_t::setIPv6 ( const char *  value)
inline

Sets version for IPv6 address and address itself. Checking is not performed (could assign IPv4 instead ...)

469 { Version = iana_address_version_t::IPv6; Value = value ? value : ""; }
Definition: defines.hpp:385
U16 Version
Definition: defines.hpp:443
std::string Value
Definition: defines.hpp:446

Member Data Documentation

◆ Value

std::string anna::iana_address_t::Value

address printable value. No checkings are done regarding specific version (application responsability)

◆ Version

U16 anna::iana_address_t::Version

address version


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