#include <file.hpp>
Definition at line 52 of file file.hpp.
Public Member Functions | |
file (const file &f) | |
file (const gsgl::string &fname) | |
file () | |
const string & | get_base_name () const |
Returns the name without any path information. | |
const string & | get_dir_name () const |
Returns the name of the file's parent directory. Guaranteed to end in a path separator. | |
const directory & | get_directory () const |
Returns the directory in which the file resides. | |
const string & | get_full_path () const |
Returns the full path name of the file. | |
const string & | get_name () const |
Returns a pointer to a stream opened on a file. Calling code must delete the stream. | |
gsgl::io::ft_stream * | open_text (gsgl::flags_t mode=FILE_OPEN_READ) |
Returns a pointer to a stream opened on the file. Calling code must delete the stream. | |
bool | operator!= (const file &f) const |
file & | operator= (const file &f) |
bool | operator== (const file &f) const |
~file () | |
Static Public Member Functions | |
static void | copy (const gsgl::string &src_path, const gsgl::string &dest_path) |
Copy a file. | |
static bool | exists (const gsgl::string &fname) |
Returns true if the file exists. | |
static string | get_full_path (const gsgl::string &fname) |
Returns the full path name of the file. | |
static void | remove (const gsgl::string &fname) |
Delete a file on disk. | |
Private Attributes | |
string | base_name |
directory | dir |
string | dir_name |
string | full_path |
string | name |
file | ( | const gsgl::string & | fname | ) |
Definition at line 64 of file file.cpp.
References file::base_name, file::dir, file::dir_name, file::full_path, countable::is_empty(), gsgl::io::MAX_PATH_SIZE, string::right_substring(), directory::SEPARATOR, and string::w_string().
void copy | ( | const gsgl::string & | src_path, | |
const gsgl::string & | dest_path | |||
) | [static] |
Copy a file.
Definition at line 183 of file file.cpp.
References string::c_string().
Referenced by application::get_config_overrides().
bool exists | ( | const gsgl::string & | fname | ) | [static] |
Returns true if the file exists.
Definition at line 168 of file file.cpp.
References string::c_string().
Referenced by application::application(), config_record::config_record(), application::get_config_overrides(), heightmap::init(), mapped_file::mapped_file(), rgba_buffer::rgba_buffer(), and texture_impl::texture_impl().
const string & get_base_name | ( | ) | const |
Returns the name without any path information.
Definition at line 139 of file file.cpp.
References file::base_name.
const string & get_dir_name | ( | ) | const |
Returns the name of the file's parent directory. Guaranteed to end in a path separator.
Definition at line 144 of file file.cpp.
References file::dir_name.
Referenced by material_file::load_mtl_file(), and mesh_file::load_obj_file().
const directory & get_directory | ( | ) | const |
string get_full_path | ( | const gsgl::string & | fname | ) | [static] |
Returns the full path name of the file.
Definition at line 161 of file file.cpp.
References file::get_full_path().
const string & get_full_path | ( | ) | const |
Returns the full path name of the file.
Definition at line 149 of file file.cpp.
References file::full_path.
Referenced by shader_program::add_fragment_shader(), shader_program::add_vertex_shader(), file::get_full_path(), application::load_objects(), mapped_file::mapped_file(), material_file::material_file(), mesh_file::mesh_file(), model_part::model_part(), rgba_buffer::rgba_buffer(), simulation::simulation(), solar_system::solar_system(), and texture::texture().
const string & get_name | ( | ) | const |
Returns a pointer to a stream opened on a file. Calling code must delete the stream.
Returns the name that the file was initialized with.
Definition at line 134 of file file.cpp.
References file::name.
ft_stream * open_text | ( | gsgl::flags_t | mode = FILE_OPEN_READ |
) |
Returns a pointer to a stream opened on the file. Calling code must delete the stream.
Definition at line 124 of file file.cpp.
References file::name.
bool operator!= | ( | const file & | f | ) | const |
Definition at line 99 of file file.cpp.
References file::base_name, file::dir, file::dir_name, file::full_path, and file::name.
bool operator== | ( | const file & | f | ) | const |
void remove | ( | const gsgl::string & | fname | ) | [static] |
Delete a file on disk.
Definition at line 174 of file file.cpp.
References string::c_string(), and string::w_string().
Definition at line 56 of file file.hpp.
Referenced by file::file(), file::get_base_name(), and file::operator=().
Definition at line 60 of file file.hpp.
Referenced by file::file(), file::get_directory(), and file::operator=().
Definition at line 57 of file file.hpp.
Referenced by file::file(), file::get_dir_name(), and file::operator=().
Definition at line 58 of file file.hpp.
Referenced by file::file(), file::get_full_path(), file::operator!=(), file::operator=(), and file::operator==().
Definition at line 55 of file file.hpp.
Referenced by file::get_name(), file::open_text(), and file::operator=().