66 const std::string&
string);
67 friend std::string
operator+(
const std::string&
string,
82 operator std::string(
void)
const;
90 std::string
url(
void)
const;
92 std::string
path(
void)
const;
93 std::string
file(
void)
const;
94 std::string
type(
void)
const;
98 std::string
extname(
const std::string& defaultname =
"")
const;
100 int extno(
const int& defaultno = -1)
const;
101 int extver(
const int& defaultver = 0)
const;
136GFilename::operator std::string(
void)
const
150 return (
"GFilename");
176 return ((
int)
m_url.length());
307 return (std::string(filename)+
string);
321 return (
string+std::string(filename));
335 return (std::string(a) == std::string(b));
349 return (std::string(a) != std::string(b));
Definition of interface for all GammaLib classes.
std::string operator+(const GFilename &filename, const std::string &string)
String addition operator.
bool operator==(const GFilename &a, const GFilename &b)
Filename equality operator.
bool operator!=(const GFilename &a, const GFilename &b)
Filename inequality operator.
Interface class for all GammaLib classes.
std::string print(const GChatter &chatter=NORMAL) const
Print file name information.
GFilename * clone(void) const
Clone file name.
GFilename & operator=(const GFilename &filename)
Assignment operator.
void copy_members(const GFilename &filename)
Copy class members.
int m_extver
Extension version (0: not set)
std::string path(void) const
Return access path.
std::string m_path
Access path.
void free_members(void)
Delete class members.
std::string classname(void) const
Return class name.
std::string file(void) const
Return name of file.
int length(void) const
Return length of filename.
std::string m_file
Name of file.
bool has_expression(void) const
Signal if filename has an expression.
friend std::string operator+(const GFilename &filename, const std::string &string)
String addition operator.
std::string type(void) const
Return file type.
bool has_extname(void) const
Signal if filename has an extension name.
bool is_fits(void) const
Checks whether file is a FITS file.
GFilename(void)
Void constructor.
void set_filename(const std::string &filename)
Set file name.
bool has_extno(void) const
Signal if filename has an extension number.
std::string m_url
File name (with stripped extension info)
std::string url(void) const
Return Uniform Resource Locator (URL)
void remove(void) const
Remove file from disk.
std::string extname(const std::string &defaultname="") const
Return extension name.
friend bool operator==(const GFilename &a, const GFilename &b)
Filename equality operator.
bool exists(void) const
Checks whether file exists.
std::string m_filename
Full file name.
int extno(const int &defaultno=-1) const
Return extension number.
int m_extno
Extension number (-1: not set)
const std::string & expression(void) const
Return expression name.
std::string protocol(void) const
Return access protocol.
std::string m_extname
Extension name ("": not set)
int extver(const int &defaultver=0) const
Return extension version number.
void init_members(void)
Initialise class members.
bool has_extver(void) const
Signal if filename has an extension version.
std::string m_protocol
Access protocol.
bool is_empty(void) const
Signal if filename is empty.
std::string m_expression
Selection expression ("": not set)
virtual ~GFilename(void)
Destructor.
friend bool operator!=(const GFilename &a, const GFilename &b)
Filename inequality operator.
void clear(void)
Clear file name.
std::string expand_env(const std::string &arg)
Expand environment variables in string.