pornsieve
0.0.0
Search porn sites and filter the results using regular expressions
|
The namespace containing the pornsieve library. More...
Namespaces | |
redtube | |
Namespace for the RedTube API. | |
Classes | |
class | CURLException |
Exception for libcurl errors. More... | |
class | HTTPException |
Exception for HTTP errors. More... | |
struct | search_result |
Search results. More... | |
Typedefs | |
using | time_point = std::chrono::system_clock::time_point |
In this lib we use the system clock for our time points. More... | |
Enumerations | |
enum | result_order { none, newest, mostviewed, rating, longest, shortest, popular, popular_week, popular_month } |
Order of the search results. More... | |
enum | media_type { video } |
Which type of media to search for. More... | |
Functions | |
void | configure_curl (CURL *curl_easy_handle) |
Set some options for curl connections. More... | |
vector< string > | json_to_vector (string_view json, string_view key) |
Converts a JSON array into a vector. More... | |
std::chrono::seconds | string_to_duration (string_view duration_string) |
Converts a duration from string to chrono seconds. More... | |
time_point | string_to_timepoint (string_view time_string) |
Converts a time from string to time_point. More... | |
string | timepoint_to_string (const system_clock::time_point &timepoint, string_view format="%FT%T") |
Return date and time as string in UTC. More... | |
void | init () |
Global pornsieve initialization. More... | |
void | cleanup () |
Global pornsieve cleanup. More... | |
The namespace containing the pornsieve library.
typedef std::chrono::system_clock::time_point pornsieve::time_point |
In this lib we use the system clock for our time points.
|
strong |
|
strong |
void pornsieve::cleanup | ( | ) |
Global pornsieve cleanup.
This function must be called, only once, after you are done using pornsieve. Calls curl_global_cleanup(3). Not thread-safe.
void pornsieve::configure_curl | ( | CURL * | curl_easy_handle | ) |
Set some options for curl connections.
This function is called every time a curl handle is created. It sets the user-agent and the proxy (if set in config::proxy).
pornsieve::CURLException |
void pornsieve::init | ( | ) |
Global pornsieve initialization.
This function must be called, only once, before anything else from the library is used. Calls curl_global_init(3). Not thread-safe.
pornsieve::CURLException | Thrown if curl_global_init() fails. |
vector< string > pornsieve::json_to_vector | ( | string_view | json, |
string_view | key | ||
) |
Converts a JSON array into a vector.
json | The JSON array as string. |
key | The key which value to put into the vector. |
nlohmann::detail::type_error | Thrown if the format of the JSON is different than expected. |
std::chrono::seconds pornsieve::string_to_duration | ( | string_view | duration_string | ) |
Converts a duration from string to chrono seconds.
duration_string | Format: SS or MM:SS or HH:MM:SS. |
- | See std::stoul |
time_point pornsieve::string_to_timepoint | ( | string_view | time_string | ) |
Converts a time from string to time_point.
string pornsieve::timepoint_to_string | ( | const system_clock::time_point & | timepoint, |
string_view | format = "%FT%T" |
||
) |
Return date and time as string in UTC.
timepoint | The point in time to convert. |
format | Format of the string (optional, defaults to %FT%T). |
See strftime(3) for information on how to construct a valid format string.