Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

Filename Class Reference

#include <filename.h>

List of all members.

Public Types

enum  Flags { F_type = 0x0f, F_binary = 0x10, F_text = 0x20 }

Public Member Functions

INLINE Filename (const char *filename)
INLINE Filename (const Filename &copy)
 Filename (const Filename &dirname, const Filename &basename)
INLINE ~Filename ()
INLINE Filename & operator= (const string &filename)
INLINE Filename & operator= (const char *filename)
INLINE Filename & operator= (const Filename &copy)
INLINE operator const string & () const
INLINE const char * c_str () const
INLINE bool empty () const
INLINE size_t length () const
INLINE char operator[] (int n) const
INLINE string get_fullpath () const
INLINE string get_dirname () const
INLINE string get_basename () const
INLINE string get_fullpath_wo_extension () const
INLINE string get_basename_wo_extension () const
INLINE string get_extension () const
void set_fullpath (const string &s)
void set_dirname (const string &s)
void set_basename (const string &s)
void set_fullpath_wo_extension (const string &s)
void set_basename_wo_extension (const string &s)
void set_extension (const string &s)
INLINE void set_binary ()
INLINE void set_text ()
INLINE bool is_binary () const
INLINE bool is_text () const
INLINE void set_type (Type type)
INLINE Type get_type () const
void extract_components (vector_string &components) const
void standardize ()
INLINE bool is_local () const
INLINE bool is_fully_qualified () const
void make_absolute ()
void make_absolute (const Filename &start_directory)
bool make_canonical ()
string to_os_specific () const
string to_os_generic () const
bool exists () const
bool is_regular_file () const
bool is_directory () const
bool is_executable () const
int compare_timestamps (const Filename &other, bool this_missing_is_old=true, bool other_missing_is_old=true) const
bool resolve_filename (const DSearchPath &searchpath, const string &default_extension=string())
bool make_relative_to (Filename directory, bool allow_backups=true)
int find_on_searchpath (const DSearchPath &searchpath)
bool scan_directory (vector_string &contents) const
bool open_read (ifstream &stream) const
bool open_write (ofstream &stream, bool truncate=true) const
bool open_append (ofstream &stream) const
bool open_read_write (fstream &stream) const
bool touch () const
bool unlink () const
bool rename_to (const Filename &other) const
bool make_dir () const
INLINE bool operator== (const string &other) const
INLINE bool operator!= (const string &other) const
INLINE bool operator< (const string &other) const
INLINE void output (ostream &out) const

Static Public Member Functions

INLINE Filename text_filename (const string &filename)
INLINE Filename binary_filename (const string &filename)
INLINE Filename dso_filename (const string &filename)
INLINE Filename executable_filename (const string &filename)
Filename from_os_specific (const string &os_specific, Type type=T_general)
Filename expand_from (const string &user_string, Type type=T_general)
Filename temporary (const string &dirname, const string &prefix, Type type=T_general)

Public Attributes

PUBLISHED __pad1__: INLINE Filename(const string &filename = "")

Private Member Functions

void locate_basename ()
void locate_extension ()
size_t get_common_prefix (const string &other) const

Static Private Member Functions

int count_slashes (const string &str)

Private Attributes

PUBLISHED __pad0__: enum Type { T_general = 0x00
PUBLISHED T_dso = 0x01
PUBLISHED T_executable = 0x02
string _filename
size_t _dirname_end
size_t _basename_start
size_t _basename_end
size_t _extension_start
int _flags


Member Enumeration Documentation

enum Filename::Flags
 

Enumeration values:
F_type 
F_binary 
F_text 

Definition at line 57 of file filename.h.


Constructor & Destructor Documentation

INLINE Filename::Filename const char *  filename  ) 
 

Referenced by make_absolute().

INLINE Filename::Filename const Filename &  copy  ) 
 

Filename::Filename const Filename &  dirname,
const Filename &  basename
 

Definition at line 255 of file filename.cxx.

References _flags, empty(), and get_fullpath().

INLINE Filename::~Filename  ) 
 


Member Function Documentation

INLINE Filename Filename::binary_filename const string &  filename  )  [static]
 

INLINE const char* Filename::c_str  )  const
 

Referenced by CPPFile::c_str().

int Filename::compare_timestamps const Filename &  other,
bool  this_missing_is_old = true,
bool  other_missing_is_old = true
const
 

Definition at line 954 of file filename.cxx.

References assert, and to_os_specific().

int Filename::count_slashes const string &  str  )  [static, private]
 

Definition at line 1707 of file filename.cxx.

References count.

Referenced by make_relative_to().

INLINE Filename Filename::dso_filename const string &  filename  )  [static]
 

Referenced by main().

INLINE bool Filename::empty  )  const
 

Referenced by CPPFile::empty(), Filename(), InterrogateDatabase::load_latest(), main(), make_canonical(), make_dir(), InterrogateBuilder::make_module_def(), make_relative_to(), scan_directory(), to_os_generic(), and to_os_specific().

INLINE Filename Filename::executable_filename const string &  filename  )  [static]
 

bool Filename::exists  )  const
 

Definition at line 830 of file filename.cxx.

References DWORD, exists(), and to_os_specific().

Referenced by exists(), DSearchPath::find_all_files(), DSearchPath::find_file(), is_executable(), open_write(), resolve_filename(), and temporary().

Filename Filename::expand_from const string &  user_string,
Type  type = T_general
[static]
 

Definition at line 348 of file filename.cxx.

References ExecutionEnvironment::expand_string(), from_os_specific(), and type.

void Filename::extract_components vector_string components  )  const
 

Definition at line 556 of file filename.cxx.

References _filename, p, q, and size_t.

int Filename::find_on_searchpath const DSearchPath searchpath  ) 
 

Definition at line 1152 of file filename.cxx.

References _filename, DSearchPath::get_directory(), DSearchPath::get_num_directories(), and make_relative_to().

Filename Filename::from_os_specific const string &  os_specific,
Type  type = T_general
[static]
 

Definition at line 290 of file filename.cxx.

References assert, back_to_front_slash(), c, p, set_type(), size_t, and type.

Referenced by expand_from(), ExecutionEnvironment::get_cwd(), and Config::ConfigTable::ReadConfigFile().

INLINE string Filename::get_basename  )  const
 

Referenced by main().

INLINE string Filename::get_basename_wo_extension  )  const
 

size_t Filename::get_common_prefix const string &  other  )  const [private]
 

Definition at line 1683 of file filename.cxx.

References _filename, len, length(), and size_t.

Referenced by make_relative_to().

INLINE string Filename::get_dirname  )  const
 

Referenced by make_canonical().

INLINE string Filename::get_extension  )  const
 

Referenced by CPPFile::is_c_file(), CPPFile::is_c_or_i_file(), is_executable(), and resolve_filename().

INLINE string Filename::get_fullpath  )  const
 

Referenced by Filename(), make_canonical(), make_relative_to(), resolve_filename(), to_os_generic(), and to_os_specific().

INLINE string Filename::get_fullpath_wo_extension  )  const
 

INLINE Type Filename::get_type  )  const
 

Referenced by to_os_generic(), and to_os_specific().

INLINE bool Filename::is_binary  )  const
 

Referenced by open_append(), open_read(), open_read_write(), and open_write().

bool Filename::is_directory  )  const
 

Definition at line 891 of file filename.cxx.

References DWORD, and to_os_specific().

Referenced by make_canonical().

bool Filename::is_executable  )  const
 

Definition at line 920 of file filename.cxx.

References exists(), get_extension(), and to_os_specific().

Referenced by Config::ConfigTable::ReadConfigFile().

INLINE bool Filename::is_fully_qualified  )  const
 

Referenced by DSearchPath::find_all_files(), and DSearchPath::find_file().

INLINE bool Filename::is_local  )  const
 

Referenced by DSearchPath::find_all_files(), DSearchPath::find_file(), make_absolute(), and resolve_filename().

bool Filename::is_regular_file  )  const
 

Definition at line 861 of file filename.cxx.

References DWORD, and to_os_specific().

Referenced by Config::ConfigTable::ReadConfigFile().

INLINE bool Filename::is_text  )  const
 

Referenced by open_append(), open_read(), open_read_write(), and open_write().

INLINE size_t Filename::length  )  const
 

Referenced by get_common_prefix().

void Filename::locate_basename  )  [private]
 

Definition at line 1589 of file filename.cxx.

References _basename_start, _dirname_end, and _filename.

void Filename::locate_extension  )  [private]
 

Definition at line 1643 of file filename.cxx.

References _basename_end, _basename_start, _extension_start, _filename, and dot().

Referenced by set_basename().

void Filename::make_absolute const Filename &  start_directory  ) 
 

Definition at line 668 of file filename.cxx.

References _filename, Filename(), is_local(), and standardize().

void Filename::make_absolute  ) 
 

Definition at line 654 of file filename.cxx.

References ExecutionEnvironment::get_cwd().

bool Filename::make_canonical  ) 
 

Definition at line 701 of file filename.cxx.

References empty(), ExecutionEnvironment::get_cwd(), get_dirname(), get_fullpath(), is_directory(), set_dirname(), and to_os_specific().

bool Filename::make_dir  )  const
 

Definition at line 1537 of file filename.cxx.

References _filename, empty(), path, size_t, and to_os_specific().

bool Filename::make_relative_to Filename  directory,
bool  allow_backups = true
 

Definition at line 1098 of file filename.cxx.

References _filename, count_slashes(), empty(), get_common_prefix(), get_fullpath(), size_t, and standardize().

Referenced by find_on_searchpath().

bool Filename::open_append ofstream &  stream  )  const
 

Definition at line 1350 of file filename.cxx.

References assert, ios_openmode, is_binary(), is_text(), and to_os_specific().

Referenced by touch().

bool Filename::open_read ifstream &  stream  )  const
 

Definition at line 1265 of file filename.cxx.

References assert, ios_openmode, is_binary(), is_text(), and to_os_specific().

Referenced by InterrogateDatabase::load_latest(), main(), and CPPPreprocessor::InputFile::open().

bool Filename::open_read_write fstream &  stream  )  const
 

Definition at line 1386 of file filename.cxx.

References assert, ios_openmode, is_binary(), is_text(), and to_os_specific().

bool Filename::open_write ofstream &  stream,
bool  truncate = true
const
 

Definition at line 1300 of file filename.cxx.

References assert, exists(), ios_openmode, is_binary(), is_text(), and to_os_specific().

Referenced by Notify::config_initialized(), and main().

INLINE Filename::operator const string &  )  const
 

INLINE bool Filename::operator!= const string &  other  )  const
 

INLINE bool Filename::operator< const string &  other  )  const
 

INLINE Filename& Filename::operator= const Filename &  copy  ) 
 

INLINE Filename& Filename::operator= const char *  filename  ) 
 

INLINE Filename& Filename::operator= const string &  filename  ) 
 

INLINE bool Filename::operator== const string &  other  )  const
 

INLINE char Filename::operator[] int  n  )  const
 

INLINE void Filename::output ostream out  )  const
 

bool Filename::rename_to const Filename &  other  )  const
 

Definition at line 1516 of file filename.cxx.

References to_os_specific().

bool Filename::resolve_filename const DSearchPath searchpath,
const string &  default_extension = string()
 

Definition at line 1029 of file filename.cxx.

References exists(), DSearchPath::find_file(), get_extension(), get_fullpath(), is_local(), and set_extension().

bool Filename::scan_directory vector_string contents  )  const
 

Definition at line 1184 of file filename.cxx.

References _filename, empty(), HANDLE(), NULL, root, size_t, and to_os_specific().

void Filename::set_basename const string &  s  ) 
 

Definition at line 469 of file filename.cxx.

References _basename_start, _filename, locate_extension(), and s.

Referenced by temporary().

void Filename::set_basename_wo_extension const string &  s  ) 
 

Definition at line 501 of file filename.cxx.

References _basename_end, _basename_start, _extension_start, _filename, and s.

INLINE void Filename::set_binary  ) 
 

void Filename::set_dirname const string &  s  ) 
 

Definition at line 417 of file filename.cxx.

References _basename_end, _basename_start, _dirname_end, _extension_start, _filename, and s.

Referenced by make_canonical().

void Filename::set_extension const string &  s  ) 
 

Definition at line 524 of file filename.cxx.

References _basename_end, _extension_start, _filename, and s.

Referenced by main(), and resolve_filename().

void Filename::set_fullpath const string &  s  ) 
 

Definition at line 405 of file filename.cxx.

References s.

void Filename::set_fullpath_wo_extension const string &  s  ) 
 

Definition at line 482 of file filename.cxx.

References _basename_end, _extension_start, _filename, and s.

INLINE void Filename::set_text  ) 
 

Referenced by Notify::config_initialized(), CPPFile::CPPFile(), CPPPreprocessor::handle_include_directive(), InterrogateDatabase::load_latest(), and main().

INLINE void Filename::set_type Type  type  ) 
 

Referenced by from_os_specific(), main(), and temporary().

void Filename::standardize  ) 
 

Definition at line 587 of file filename.cxx.

References _filename, assert, p, and size_t.

Referenced by make_absolute(), make_relative_to(), to_os_generic(), and to_os_specific().

Filename Filename::temporary const string &  dirname,
const string &  prefix,
Type  type = T_general
[static]
 

Definition at line 367 of file filename.cxx.

References exists(), NULL, set_basename(), set_type(), and type.

INLINE Filename Filename::text_filename const string &  filename  )  [static]
 

string Filename::to_os_generic  )  const
 

Definition at line 800 of file filename.cxx.

References empty(), get_fullpath(), get_type(), standardize(), T_dso, and T_executable.

string Filename::to_os_specific  )  const
 

Definition at line 763 of file filename.cxx.

References empty(), get_fullpath(), get_type(), standardize(), T_dso, and T_executable.

Referenced by compare_timestamps(), exists(), is_directory(), is_executable(), is_regular_file(), load_dso(), make_canonical(), make_dir(), open_append(), open_read(), open_read_write(), open_write(), Config::ConfigTable::ReadConfigFile(), rename_to(), scan_directory(), touch(), and unlink().

bool Filename::touch  )  const
 

Definition at line 1419 of file filename.cxx.

References HANDLE(), NULL, open_append(), and to_os_specific().

Referenced by main().

bool Filename::unlink  )  const
 

Definition at line 1501 of file filename.cxx.

References to_os_specific().


Member Data Documentation

PUBLISHED Filename::__pad0__ [private]
 

Definition at line 50 of file filename.h.

PUBLISHED Filename::__pad1__
 

Definition at line 64 of file filename.h.

size_t Filename::_basename_end [private]
 

Definition at line 184 of file filename.h.

Referenced by locate_extension(), set_basename_wo_extension(), set_dirname(), set_extension(), and set_fullpath_wo_extension().

size_t Filename::_basename_start [private]
 

Definition at line 183 of file filename.h.

Referenced by locate_basename(), locate_extension(), set_basename(), set_basename_wo_extension(), and set_dirname().

size_t Filename::_dirname_end [private]
 

Definition at line 182 of file filename.h.

Referenced by locate_basename(), and set_dirname().

size_t Filename::_extension_start [private]
 

Definition at line 185 of file filename.h.

Referenced by locate_extension(), set_basename_wo_extension(), set_dirname(), set_extension(), and set_fullpath_wo_extension().

string Filename::_filename [private]
 

Definition at line 179 of file filename.h.

Referenced by extract_components(), find_on_searchpath(), get_common_prefix(), locate_basename(), locate_extension(), make_absolute(), make_dir(), make_relative_to(), scan_directory(), set_basename(), set_basename_wo_extension(), set_dirname(), set_extension(), set_fullpath_wo_extension(), and standardize().

int Filename::_flags [private]
 

Definition at line 187 of file filename.h.

Referenced by Filename().

PUBLISHED Filename::T_dso = 0x01 [private]
 

Definition at line 51 of file filename.h.

Referenced by main(), to_os_generic(), and to_os_specific().

PUBLISHED Filename::T_executable = 0x02 [private]
 

Definition at line 52 of file filename.h.

Referenced by to_os_generic(), and to_os_specific().


The documentation for this class was generated from the following files:
Generated on Fri Apr 18 01:34:56 2003 for DTool by doxygen1.3