18 #include <glog/logging.h> 31 inline std::string dirname_s(
const std::string& path) {
32 char* path_copy = strdup(path.c_str());
33 char* dir = dirname(path_copy);
34 return std::string(dir);
37 inline std::string basename_s(
const std::string& path) {
38 char* path_copy = strdup(path.c_str());
39 char* base = basename(path_copy);
40 return std::string(base);
43 int mkdir_p(
const char* path, mode_t mode);
45 void temp_file(FILE** file, std::string& name);
47 void temp_file(std::string& name);
49 void temp_dir(std::string& name);
51 std::string done_file_path(
const std::string& path);
53 void download(
const std::string& url,
const std::string& local_path);
55 std::string download_temp(
const std::string& url);
57 void delete_file(
const std::string& path);
59 std::vector<uint8_t> read_entire_file(
const std::string& file_name);
62 void cached_dir(
const std::string& name, std::string& full_path);
64 void download_if_uncached(
const std::string& url,
65 const std::string& cache_path);
Definition: database.cpp:36