Kyoto Tycoon
|
utility functions More...
#include <ktcommon.h>
Namespaces | |
namespace | kyototycoon |
All symbols of Kyoto Tycoon. | |
Functions | |
bool | kyototycoon::setkillsignalhandler (void(*handler)(int)) |
Set the signal handler for termination signals. | |
bool | kyototycoon::maskthreadsignal () |
Set the signal mask of the current to ignore all. | |
bool | kyototycoon::daemonize () |
Switch the process into the background. | |
int32_t | kyototycoon::executecommand (const std::vector< std::string > &args) |
Execute a shell command. | |
const char * | kyototycoon::strmapget (const std::map< std::string, std::string > &map, const char *key, size_t *sp=NULL) |
Get the C-style string value of a record in a string map. | |
void | kyototycoon::printstrvec (const std::vector< std::string > &vec, std::ostream &strm=std::cout) |
Print all records in a string vector. | |
void | kyototycoon::printstrmap (const std::map< std::string, std::string > &map, std::ostream &strm=std::cout) |
Print all records in a string map. | |
void | kyototycoon::urlbreak (const char *url, std::map< std::string, std::string > *elems) |
Break up a URL into elements. | |
char * | kyototycoon::xmlescape (const char *str) |
Escape meta characters in a string with the entity references of XML. | |
char * | kyototycoon::xmlunescape (const char *str) |
Unescape meta characters in a string with the entity references of XML. | |
void | kyototycoon::wwwformtomap (const std::string &str, std::map< std::string, std::string > *map) |
Parse a www-form-urlencoded string and store each records into a map. | |
void | kyototycoon::maptowwwform (const std::map< std::string, std::string > &map, std::string *str) |
Serialize a string map into a www-form-urlencoded string. | |
void | kyototycoon::tsvtomap (const std::string &str, std::map< std::string, std::string > *map) |
Parse a TSV string and store each records into a map. | |
void | kyototycoon::maptotsv (const std::map< std::string, std::string > &map, std::string *str) |
Serialize a string map into a TSV string. | |
void | kyototycoon::tsvmapencode (std::map< std::string, std::string > *map, int32_t mode) |
Encode each record of a string map. | |
void | kyototycoon::tsvmapdecode (std::map< std::string, std::string > *map, int32_t mode) |
Decode each record of a string map. | |
int32_t | kyototycoon::checkmapenc (const std::map< std::string, std::string > &map) |
Check the best suited encoding of a string map. | |
char * | kyototycoon::strcapitalize (char *str) |
Capitalize letters of a string. | |
bool | kyototycoon::strisalnum (const char *str) |
Check a string is composed of alphabets or numbers only. | |
void | kyototycoon::strtokenize (const char *str, std::vector< std::string > *tokens) |
Tokenize a string separating by space characters. | |
void | kyototycoon::getcalendar (int64_t t, int32_t jl, int32_t *yearp=NULL, int32_t *monp=NULL, int32_t *dayp=NULL, int32_t *hourp=NULL, int32_t *minp=NULL, int32_t *secp=NULL) |
Get the Gregorian calendar of a time. | |
void | kyototycoon::datestrwww (int64_t t, int32_t jl, char *buf) |
Format a date as a string in W3CDTF. | |
void | kyototycoon::datestrwww (double t, int32_t jl, int32_t acr, char *buf) |
Format a date as a string in W3CDTF with the fraction part. | |
void | kyototycoon::datestrhttp (int64_t t, int32_t jl, char *buf) |
Format a date as a string in RFC 1123 format. | |
int64_t | kyototycoon::strmktime (const char *str) |
Get the time value of a date string. | |
int32_t | kyototycoon::jetlag () |
Get the jet lag of the local time. | |
int32_t | kyototycoon::dayofweek (int32_t year, int32_t mon, int32_t day) |
Get the day of week of a date. | |
bool | kyototycoon::getlocaltime (time_t time, struct std::tm *result) |
Get the local time of a time. | |
bool | kyototycoon::getgmtime (time_t time, struct std::tm *result) |
Get the GMT local time of a time. | |
time_t | kyototycoon::mkgmtime (struct std::tm *tm) |
Make the GMT from a time structure. | |
Variables | |
const char *const | kyototycoon::VERSION |
The package version. | |
const int32_t | kyototycoon::LIBVER |
The library version. | |
const int32_t | kyototycoon::LIBREV |
The library revision. | |
const char *const | kyototycoon::FEATURES |
The extra feature list. | |
const int32_t | kyototycoon::DEFPORT = 1978 |
The default port number. |
utility functions