6#include <cgv/utils/lib_begin.h>
13 CGV_API
void* open(
const std::string& file_name,
const std::string& mode,
void* buf,
int length);
15 CGV_API
bool exists(
const std::string& file_name);
17 CGV_API
bool remove(
const std::string& file_name);
19 CGV_API
bool rename(
const std::string& before,
const char* after);
21 CGV_API std::string find_in_paths(
22 const std::string& file_name,
23 const std::string& path_list,
24 bool recursive =
true,
25 const std::string& sub_dir =
"");
27 CGV_API
bool copy(
const std::string& from,
const std::string& to);
29 CGV_API
size_t size(
const std::string& file_name,
bool ascii =
false);
31 CGV_API
bool read(
const std::string& file_name, std::string& content,
bool ascii =
false);
33 CGV_API
char* read(
const std::string& file_name,
bool ascii =
false,
size_t* size_ptr = 0,
size_t add_nr_bytes_to_buffer=0);
35 CGV_API
bool read(
const std::string& filename,
char* ptr,
size_t size,
bool ascii =
false,
size_t file_offset = 0);
37 CGV_API
bool write(
const std::string& filename,
const std::string& content,
bool ascii =
false);
39 CGV_API
bool write(
const std::string& filename,
const char* ptr,
size_t size,
bool ascii =
false);
41 CGV_API
bool append(
const std::string& filename,
const char* ptr,
size_t size,
bool ascii =
false);
43 CGV_API
bool append(
const std::string& file_name_1,
const std::string& file_name_2,
bool ascii =
false);
45 enum Result { EQUAL, DIFFERENT, FILE_ERROR };
47 CGV_API Result cmp(
const std::string& what,
const std::string& with);
49 CGV_API
void* find_first(
const std::string& filter);
51 CGV_API
void* find_next(
void* handle);
53 CGV_API
void find_close(
void* handle);
55 CGV_API std::string find_name(
void* handle);
57 CGV_API
long long find_last_write_time(
const void* handle);
59 CGV_API
bool find_read_only(
const void* handle);
61 CGV_API
bool find_directory(
const void* handle);
63 CGV_API
bool find_system(
const void* handle);
65 CGV_API
bool find_hidden(
const void* handle);
67 CGV_API
bool find_archive(
const void* handle);
69 CGV_API
bool find_normal(
const void* handle);
71 CGV_API
size_t find_size(
void* handle);
73 CGV_API
long long get_last_write_time(
const std::string& file_path);
75 CGV_API std::string get_extension(
const std::string& file_path);
77 CGV_API std::string drop_extension(
const std::string& file_path);
79 CGV_API std::string get_file_name(
const std::string& file_path);
81 CGV_API std::string get_path(
const std::string& file_path);
83 CGV_API
bool is_relative_path(
const std::string& file_path);
85 CGV_API std::string platform_path(
const std::string& file_path);
87 CGV_API std::string clean_path(
const std::string& file_path);
89 CGV_API
bool shorten_path(std::string& file_path,
const std::string& prefix_path);
91 CGV_API
bool read_string_bin(std::string& s, FILE* fp);
93 CGV_API
bool write_string_bin(
const std::string& s, FILE* fp);
98#include <cgv/config/lib_end.h>