SklavaBot 0.1.0
Telegram Bot in C++
Loading...
Searching...
No Matches
tools Namespace Reference

Functions

std::string getMetar (std::string ICAO)
 Get METAR information from stations.
 
std::string getTextFromImage (Pix *image)
 
void flush ()
 Flush stdin.
 
void log_cmd (std::string command, std::string user, std::int32_t timestamp, const std::string log_type)
 Function to print a better log.
 
size_t writeFunction (void *ptr, size_t size, size_t nmemb, std::string *data)
 Write function for CURL.
 

Function Documentation

◆ flush()

void tools::flush ( )

Flush stdin.

flush()

Definition at line 12 of file utils.cpp.

◆ getMetar()

std::string tools::getMetar ( std::string  ICAO)

Get METAR information from stations.

getMetar(ICAO)

Parameters
ICAOThe station's ICAO code
Returns
metarInfo Station response

Definition at line 28 of file metar.cpp.

◆ getTextFromImage()

std::string tools::getTextFromImage ( Pix *  image)

getTextFromImage(*image)

Parameters
imagePointer to a Pix object of leptonica
Returns
outText OCR String

Definition at line 13 of file ocr.cpp.

◆ log_cmd()

void tools::log_cmd ( std::string  command,
std::string  user,
std::int32_t  timestamp,
const std::string  log_type 
)

Function to print a better log.

log_cmd(command, user, timestamp, log_type)

Parameters
commandCommand string
userUser or entity who sent log
timestampUnix epoch of when log was generated
log_typeLog type, see LOG namespace

Definition at line 17 of file utils.cpp.

◆ writeFunction()

size_t tools::writeFunction ( void *  ptr,
size_t  size,
size_t  nmemb,
std::string *  data 
)

Write function for CURL.

writeFunction(*ptr, size, nmemb, *data)

Parameters
*ptrPointer to response data
sizeAlways 1
nmembResponse data size
*dataPointer to destination variable
Returns
size*nmemb Size of data

Definition at line 23 of file metar.cpp.