Babel
Epitech's C++ VoIP project
Functions
Babel::Utils Namespace Reference

Functions

bool getString (Message< RFCCodes > &m, std::string &str, std::pair< uint8_t, uint8_t > minMaxSize)
 get a string from a message the data layout of the message must be uint8 string_length and the string More...
 
bool getString (Message< RFCCodes > &m, std::string &str)
 get a string from a message the data layout of the message must be uint8 string_length and the string More...
 
template<typename T >
static bool tryParse (const std::string &s, T &f)
 return true if parsing has been successful result ill be in i More...
 
Message< RFCCodesresponse (uint16_t code, std::string description)
 Create a reply type message, used as a convenient way to quickly construct response description messages. More...
 
Message< RFCCodes > & appendConnectionIpPort (Message< RFCCodes > &m, ITCPConnection< RFCCodes > &c)
 add the address and port of a tcp connection to a message More...
 

Function Documentation

◆ appendConnectionIpPort()

Message<RFCCodes>& Babel::Utils::appendConnectionIpPort ( Message< RFCCodes > &  m,
ITCPConnection< RFCCodes > &  c 
)
inline

add the address and port of a tcp connection to a message

◆ getString() [1/2]

bool Babel::Utils::getString ( Message< RFCCodes > &  m,
std::string &  str 
)
inline

get a string from a message the data layout of the message must be uint8 string_length and the string

◆ getString() [2/2]

bool Babel::Utils::getString ( Message< RFCCodes > &  m,
std::string &  str,
std::pair< uint8_t, uint8_t >  minMaxSize 
)
inline

get a string from a message the data layout of the message must be uint8 string_length and the string

◆ response()

Message<RFCCodes> Babel::Utils::response ( uint16_t  code,
std::string  description 
)
inline

Create a reply type message, used as a convenient way to quickly construct response description messages.

◆ tryParse()

template<typename T >
static bool Babel::Utils::tryParse ( const std::string &  s,
T &  f 
)
static

return true if parsing has been successful result ill be in i