xxtelebot  1.4.1.0
A simple Telegram Bot implementation in C++
Namespaces | Functions
tgbot::utils Namespace Reference

various utilities More...

Namespaces

 http
 HTTP utilities, meant for project internal usage.
 

Functions

void encode (std::stringstream &stream, const std::string &target)
 Encode URL paramter using a stringstream. More...
 
std::string encode (const std::string &target)
 Encode URL paramter and return a new std::string object. More...
 
std::string getFileName (const std::string &s)
 
template<typename PtrType , typename... TypeArgs>
types::Ptr< PtrType > makePtr (TypeArgs &&...args_fwd)
 Make a new tgbot::types::Ptr. More...
 
bool whenStarts (const std::string &target, const char *what)
 whenStarts (see RegisterCallback::callback() ) More...
 
bool whenContains (const std::string &target, const char *what)
 whenContains (see RegisterCallback::callback() ) More...
 
std::string get_current_time (const std::string &fmt)
 get current localtime, with specific formatting More...
 

Detailed Description

various utilities

Function Documentation

void tgbot::utils::encode ( std::stringstream &  stream,
const std::string &  target 
)

Encode URL paramter using a stringstream.

Parameters
stream
target
std::string tgbot::utils::encode ( const std::string &  target)

Encode URL paramter and return a new std::string object.

Parameters
target
Returns
encoded std::string
std::string tgbot::utils::get_current_time ( const std::string &  fmt)

get current localtime, with specific formatting

Parameters
fmtformat string for time
Returns
current localtime with "fmt" formatting
template<typename PtrType , typename... TypeArgs>
types::Ptr<PtrType> tgbot::utils::makePtr ( TypeArgs &&...  args_fwd)
inline

Make a new tgbot::types::Ptr.

Template Parameters
PtrType
TypeArgs
Parameters
args_fwd: argument to be forwarded to constructor
Returns
a new tgbot::types::Ptr holding your pointer
bool tgbot::utils::whenContains ( const std::string &  target,
const char *  what 
)
inline

whenContains (see RegisterCallback::callback() )

Parameters
target
what
Returns
true if 'target' contains 'what'
bool tgbot::utils::whenStarts ( const std::string &  target,
const char *  what 
)
inline

whenStarts (see RegisterCallback::callback() )

Parameters
target
what
Returns
true if 'target' starts with 'what'