file Class Reference

#include <file.hpp>

Inheritance diagram for file:

Inheritance graph
[legend]
Collaboration diagram for file:

Collaboration graph
[legend]

List of all members.


Detailed Description

Represents a file on disk.

Todo:
Implement file information.

Definition at line 52 of file file.hpp.


Public Member Functions

 file (const file &f)
 file (const gsgl::string &fname)
 file ()
const stringget_base_name () const
 Returns the name without any path information.
const stringget_dir_name () const
 Returns the name of the file's parent directory. Guaranteed to end in a path separator.
const directoryget_directory () const
 Returns the directory in which the file resides.
const stringget_full_path () const
 Returns the full path name of the file.
const stringget_name () const
 Returns a pointer to a stream opened on a file. Calling code must delete the stream.
gsgl::io::ft_streamopen_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
fileoperator= (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

Constructor & Destructor Documentation

file (  ) 

Definition at line 59 of file file.cpp.

file ( const gsgl::string fname  ) 

~file (  ) 

Definition at line 95 of file file.cpp.

file ( const file f  ) 

Definition at line 90 of file file.cpp.


Member Function Documentation

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]

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

Returns the directory in which the file resides.

Definition at line 154 of file file.cpp.

References file::dir.

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

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 118 of file file.cpp.

References file::full_path.

file & operator= ( const file f  ) 

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

Definition at line 112 of file file.cpp.

References file::full_path.

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().


Member Data Documentation

string base_name [private]

Definition at line 56 of file file.hpp.

Referenced by file::file(), file::get_base_name(), and file::operator=().

directory dir [private]

Definition at line 60 of file file.hpp.

Referenced by file::file(), file::get_directory(), and file::operator=().

string dir_name [private]

Definition at line 57 of file file.hpp.

Referenced by file::file(), file::get_dir_name(), and file::operator=().

string full_path [private]

string name [private]

Definition at line 55 of file file.hpp.

Referenced by file::get_name(), file::open_text(), and file::operator=().


The documentation for this class was generated from the following files:

Generated on Sat Mar 1 13:50:06 2008 for Periapsis Project by  doxygen 1.5.5