Parsing.h File Reference
#include "ip/Address.h"
Include dependency graph for Parsing.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.


double xatof (const char *token)
int xatoi (const char *token)
unsigned int xatoui (const char *token, char eov='\0')
long xatol (const char *token)
int64_t xatoll (const char *token, int base, char eov='\0')
unsigned short xatos (const char *token)
int64_t GetInteger64 (void)
int GetInteger (void)
double GetPercentage (bool limit=true)
unsigned short GetShort (void)
bool StringToInt (const char *str, int &result, const char **p, int base)
bool StringToInt64 (const char *str, int64_t &result, const char **p, int base)
bool GetHostWithPort (char *token, Ip::Address *ipa)

Function Documentation

◆ GetHostWithPort()

bool GetHostWithPort ( char *  token,
Ip::Address ipa 

Parse a socket address (host:port), fill the given Ip::Address object

Return values
trueSuccess. Destroys token during parse.

Definition at line 251 of file

References Ip::Address::GetHostByName(), NULL, port, Ip::Address::port(), Ip::Address::setAnyAddr(), and xatos().

Referenced by logfile_mod_udp_open(), Log::TcpLogger::Open(), and parse_IpAddress_list().

◆ GetInteger()

int GetInteger ( void  )

Parses an integer value. Uses a method that obeys hexadecimal 0xN syntax needed for certain bitmasks. self_destruct() will be called to abort when invalid tokens are encountered.

Definition at line 142 of file

References DBG_IMPORTANT, DBG_PARSE_NOTE, debugs, int, ConfigParser::NextToken(), self_destruct(), and xatoll().

Referenced by parse_icap_service_failure_limit(), parse_int(), parse_refreshpattern(), parse_wccp2_service(), parse_wccp2_service_info(), ConfigParser::ParseBool(), ClientDelayConfig::parsePoolRates(), Rock::SwapDir::parseSize(), and Fs::Ufs::UFSSwapDir::parseSizeL1L2().

◆ GetInteger64()

int64_t GetInteger64 ( void  )

Parse a 64-bit integer value.

Definition at line 126 of file

References ConfigParser::NextToken(), self_destruct(), and xatoll().

Referenced by parse_int64_t(), and ClientDelayConfig::parsePoolRates().

◆ GetPercentage()

double GetPercentage ( bool  limit = true)

Parse a percentage value, e.g., 20%. The behavior of this function is similar as GetInteger(). The difference is that the token might contain '' as percentage symbol (%), and we may further check whether the value is in the range of [0, 100]. For example, 20% and 20 are both valid tokens, while 101%, 101, -1 are invalid.

limitwhether to check the value is within 0-100% limit
the percentage as a decimal number. ie 100% = 1.00, 50% = 0.5

Definition at line 172 of file

References DBG_CRITICAL, debugs, ConfigParser::NextToken(), self_destruct(), and xatoi().

Referenced by parse_refreshpattern().

◆ GetShort()

unsigned short GetShort ( void  )

Definition at line 199 of file

References ConfigParser::NextToken(), self_destruct(), and xatos().

Referenced by ConfigParser::ParseUShort().

◆ StringToInt()

bool StringToInt ( const char *  str,
int result,
const char **  p,
int  base 

Definition at line 211 of file

References int.

Referenced by DelaySpec::parse().

◆ StringToInt64()

bool StringToInt64 ( const char *  str,
int64_t &  result,
const char **  p,
int  base 

Definition at line 231 of file

References strtoll().

Referenced by DelaySpec::parse().

◆ xatof()

double xatof ( const char *  token)

◆ xatoi()

◆ xatol()

long xatol ( const char *  token)

Definition at line 75 of file

References DBG_IMPORTANT, DBG_PARSE_NOTE, debugs, self_destruct(), and xatoll().

Referenced by xatos().

◆ xatoll()

int64_t xatoll ( const char *  token,
int  base,
char  eov = '\0' 

◆ xatos()

◆ xatoui()

unsigned int xatoui ( const char *  token,
char  eov = '\0' 






Web Site Translations