![]() |
libtld 2.0.14
A library to determine the Top-Level Domain name of any Internet URI.
|
Implementation of the TLD file data handling. More...
#include "libtld/tld_file.h"
#include "libtld/tld.h"
#include "libtld/tld_data.h"
#include <fstream>
#include <iostream>
#include <sstream>
#include <limits.h>
#include <string.h>
Go to the source code of this file.
Functions | |
tld_description const * | tld_file_description (tld_file const *file, uint32_t id) |
const char * | tld_file_errstr (tld_file_error err) |
void | tld_file_free (tld_file **file) |
enum tld_file_error | tld_file_load (char const *filename, tld_file **file) |
tld_file_error | tld_file_load_stream (tld_file **file, std::istream &in) |
char const * | tld_file_string (tld_file const *file, uint32_t id, uint32_t *length) |
tld_tag const * | tld_file_tag (tld_file const *file, uint32_t id) |
char * | tld_file_to_json (tld_file const *file) |
Transform a tld_file to a JSON string. | |
This file handles the loading of the TLDs from an RIFF file.
Definition in file tld_file.cpp.
tld_description const * tld_file_description | ( | tld_file const * | file, |
uint32_t | id | ||
) |
Definition at line 352 of file tld_file.cpp.
const char * tld_file_errstr | ( | tld_file_error | err | ) |
Definition at line 298 of file tld_file.cpp.
void tld_file_free | ( | tld_file ** | file | ) |
Definition at line 490 of file tld_file.cpp.
enum tld_file_error tld_file_load | ( | char const * | filename, |
tld_file ** | file | ||
) |
Definition at line 275 of file tld_file.cpp.
tld_file_error tld_file_load_stream | ( | tld_file ** | file, |
std::istream & | in | ||
) |
Definition at line 51 of file tld_file.cpp.
char const * tld_file_string | ( | tld_file const * | file, |
uint32_t | id, | ||
uint32_t * | length | ||
) |
Definition at line 372 of file tld_file.cpp.
Definition at line 362 of file tld_file.cpp.
char * tld_file_to_json | ( | tld_file const * | file | ) |
This function transforms a tld_file in a JSON string which gets returned. If something goes wrong, then the function may return a nullptr instead.
The returned strings must be freed by you with the free()
function.
[in] | file | The tld_file to transform to a JSON. |
Definition at line 414 of file tld_file.cpp.
References tld_description::f_end_offset, tld_description::f_exception_apply_to, tld_description::f_start_offset, tld_description::f_status, tld_description::f_tags, tld_description::f_tags_count, tld_description::f_tld, tld(), and tld_status_to_string().
This document is part of the Snap! Websites Project.
Copyright by Made to Order Software Corp.