ODIN
|
#include <ldrtypes.h>
Public Member Functions | |
LDRfileName () | |
LDRfileName (const STD_string &filename, const STD_string &name="") | |
LDRfileName (const LDRfileName &jf) | |
LDRfileName & | operator= (const STD_string &filename) |
LDRfileName & | operator= (const LDRfileName &jf) |
bool | exists () const |
STD_string | get_basename () const |
STD_string | get_basename_nosuffix () const |
STD_string | get_dirname () const |
STD_string | get_suffix () const |
LDRfileName & | set_suffix (const STD_string &suff) |
STD_string | get_defaultdir () const |
LDRfileName & | set_defaultdir (const STD_string &defdir) |
bool | is_dir () const |
LDRfileName & | set_dir (bool flag) |
bool | parsevalstring (const STD_string &parstring, const LDRserBase *ser=0) |
STD_string | get_typeInfo (bool parx_equivtype=false) const |
LDRbase * | create_copy () const |
Public Member Functions inherited from LDRstring | |
LDRstring () | |
LDRstring (const STD_string &ss, const STD_string &name="") | |
LDRstring (int i, const char c=' ') | |
LDRstring (const char *charptr) | |
LDRstring (const LDRstring &str) | |
LDRstring & | operator= (const STD_string &ss) |
LDRstring & | operator= (const char *charptr) |
LDRstring & | operator= (const LDRstring &ss) |
STD_string | printvalstring (const LDRserBase *ser=0) const |
STD_string | get_parx_code (parxCodeType type) const |
Public Member Functions inherited from LDRbase | |
virtual STD_string | print (const LDRserBase &serializer=LDRserJDX()) const |
virtual STD_ostream & | print2stream (STD_ostream &os, const LDRserBase &serializer) const |
virtual int | write (const STD_string &filename, const LDRserBase &serializer=LDRserJDX()) const |
virtual bool | parse (STD_string &parstring, const LDRserBase &serializer=LDRserJDX()) |
virtual int | load (const STD_string &filename, const LDRserBase &serializer=LDRserJDX()) |
virtual double | get_minval () const |
virtual double | get_maxval () const |
bool | has_minmax () const |
const STD_string & | get_description () const |
LDRbase & | set_description (const STD_string &descr) |
virtual svector | get_alternatives () const |
const STD_string & | get_unit () const |
LDRbase & | set_unit (const STD_string &un) |
virtual parameterMode | get_parmode () const |
virtual LDRbase & | set_parmode (parameterMode parameter_mode) |
virtual fileMode | get_filemode () const |
virtual LDRbase & | set_filemode (fileMode file_mode) |
virtual GuiProps | get_gui_props () const |
virtual LDRbase & | set_gui_props (const GuiProps &) |
JcampDxProps | get_jdx_props () const |
LDRbase & | set_jdx_props (const JcampDxProps &jp) |
Public Member Functions inherited from Labeled | |
Labeled (const STD_string &label="unnamed") | |
Labeled & | set_label (const STD_string &label) |
const STD_string & | get_label () const |
Labeled & | operator= (const Labeled &l) |
Labeled Data Record (LDR) class for representing file names. Besides using LDRfileName as a convenient way within the UI to display/retrieve/browse file names, it can be used to analyze file paths, for example in the following way:
STD_string myfile="/somedir/anotherdir/file.txt"; STD_string myfile_base=LDRfileName(myfile).get_basename(); STD_cout << "myfile_base=" << myfile_base << STD_endl; STD_string myfile_base_nosuffix=LDRfileName(myfile).get_basename_nosuffix(); STD_cout << "myfile_base_nosuffix=" << myfile_base_nosuffix << STD_endl; STD_string myfile_dir= LDRfileName(myfile).get_dirname(); STD_cout << "myfile_dir=" << myfile_dir << STD_endl;
Definition at line 388 of file ldrtypes.h.
|
inline |
Default constructor
Definition at line 395 of file ldrtypes.h.
LDRfileName::LDRfileName | ( | const STD_string & | filename, |
const STD_string & | name = "" |
||
) |
Constructor with the following arguments:
LDRfileName::LDRfileName | ( | const LDRfileName & | jf | ) |
Copy constructor
|
inlinevirtual |
Returns a deep copy of the parameter
Reimplemented from LDRstring.
Definition at line 475 of file ldrtypes.h.
bool LDRfileName::exists | ( | ) | const |
Returns 'true' only if the file/directory exists
|
inline |
Returns the filename without preceeding directories
Definition at line 427 of file ldrtypes.h.
STD_string LDRfileName::get_basename_nosuffix | ( | ) | const |
Returns the filename without preceeding directories and without a previously specified suffix (file extension)
|
inline |
Returns the default location of the filename
Definition at line 453 of file ldrtypes.h.
|
inline |
Returns the directory of the filename
Definition at line 438 of file ldrtypes.h.
|
inline |
Returns the suffix (file extension) of the filename
Definition at line 443 of file ldrtypes.h.
|
inlinevirtual |
Returns a string describing the type of the parameter. If 'parx_equivtype' is 'true', returns the equivalent PARX parameter type
Reimplemented from LDRstring.
Definition at line 474 of file ldrtypes.h.
|
inline |
Returns whether used exclusively for directory names
Definition at line 464 of file ldrtypes.h.
LDRfileName& LDRfileName::operator= | ( | const LDRfileName & | jf | ) |
Assignment operator
LDRfileName& LDRfileName::operator= | ( | const STD_string & | filename | ) |
Assignment from a string
|
virtual |
Parses and assigns the value in the given string, optionally using format 'ser'
Reimplemented from LDRstring.
LDRfileName& LDRfileName::set_defaultdir | ( | const STD_string & | defdir | ) |
Sets the default location of the filename
|
inline |
Specifies whether used exclusively for directory names
Definition at line 469 of file ldrtypes.h.
|
inline |
Sets/overwrites the suffix (file extension) of the filename
Definition at line 448 of file ldrtypes.h.