Public Member Functions | List of all members

#include <ldrtypes.h>

Inheritance diagram for LDRfileName:
Inheritance graph

Public Member Functions

 LDRfileName ()
 LDRfileName (const STD_string &filename, const STD_string &name="")
 LDRfileName (const LDRfileName &jf)
LDRfileNameoperator= (const STD_string &filename)
LDRfileNameoperator= (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
LDRfileNameset_suffix (const STD_string &suff)
STD_string get_defaultdir () const
LDRfileNameset_defaultdir (const STD_string &defdir)
bool is_dir () const
LDRfileNameset_dir (bool flag)
bool parsevalstring (const STD_string &parstring, const LDRserBase *ser=0)
STD_string get_typeInfo (bool parx_equivtype=false) const
LDRbasecreate_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)
LDRstringoperator= (const STD_string &ss)
LDRstringoperator= (const char *charptr)
LDRstringoperator= (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
LDRbaseset_description (const STD_string &descr)
virtual svector get_alternatives () const
const STD_string & get_unit () const
LDRbaseset_unit (const STD_string &un)
virtual parameterMode get_parmode () const
virtual LDRbaseset_parmode (parameterMode parameter_mode)
virtual fileMode get_filemode () const
virtual LDRbaseset_filemode (fileMode file_mode)
virtual GuiProps get_gui_props () const
virtual LDRbaseset_gui_props (const GuiProps &)
JcampDxProps get_jdx_props () const
LDRbaseset_jdx_props (const JcampDxProps &jp)
- Public Member Functions inherited from Labeled
 Labeled (const STD_string &label="unnamed")
Labeledset_label (const STD_string &label)
const STD_string & get_label () const
Labeledoperator= (const Labeled &l)

Detailed Description

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.

Constructor & Destructor Documentation

§ LDRfileName() [1/3]

LDRfileName::LDRfileName ( )

Default constructor

Definition at line 395 of file ldrtypes.h.

§ LDRfileName() [2/3]

LDRfileName::LDRfileName ( const STD_string &  filename,
const STD_string &  name = "" 

Constructor with the following arguments:

  • filename: Initial value for the file name
  • name: The label of the parameter

§ LDRfileName() [3/3]

LDRfileName::LDRfileName ( const LDRfileName jf)

Copy constructor

Member Function Documentation

§ create_copy()

LDRbase* LDRfileName::create_copy ( ) const

Returns a deep copy of the parameter

Reimplemented from LDRstring.

Definition at line 475 of file ldrtypes.h.

§ exists()

bool LDRfileName::exists ( ) const

Returns 'true' only if the file/directory exists

§ get_basename()

STD_string LDRfileName::get_basename ( ) const

Returns the filename without preceeding directories

Definition at line 427 of file ldrtypes.h.

§ get_basename_nosuffix()

STD_string LDRfileName::get_basename_nosuffix ( ) const

Returns the filename without preceeding directories and without a previously specified suffix (file extension)

§ get_defaultdir()

STD_string LDRfileName::get_defaultdir ( ) const

Returns the default location of the filename

Definition at line 453 of file ldrtypes.h.

§ get_dirname()

STD_string LDRfileName::get_dirname ( ) const

Returns the directory of the filename

Definition at line 438 of file ldrtypes.h.

§ get_suffix()

STD_string LDRfileName::get_suffix ( ) const

Returns the suffix (file extension) of the filename

Definition at line 443 of file ldrtypes.h.

§ get_typeInfo()

STD_string LDRfileName::get_typeInfo ( bool  parx_equivtype = false) const

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.

§ is_dir()

bool LDRfileName::is_dir ( ) const

Returns whether used exclusively for directory names

Definition at line 464 of file ldrtypes.h.

§ operator=() [1/2]

LDRfileName& LDRfileName::operator= ( const STD_string &  filename)

Assignment from a string

§ operator=() [2/2]

LDRfileName& LDRfileName::operator= ( const LDRfileName jf)

Assignment operator

§ parsevalstring()

bool LDRfileName::parsevalstring ( const STD_string &  ,
const LDRserBase ser = 0 

Parses and assigns the value in the given string, optionally using format 'ser'

Reimplemented from LDRstring.

§ set_defaultdir()

LDRfileName& LDRfileName::set_defaultdir ( const STD_string &  defdir)

Sets the default location of the filename

§ set_dir()

LDRfileName& LDRfileName::set_dir ( bool  flag)

Specifies whether used exclusively for directory names

Definition at line 469 of file ldrtypes.h.

§ set_suffix()

LDRfileName& LDRfileName::set_suffix ( const STD_string &  suff)

Sets/overwrites the suffix (file extension) of the filename

Definition at line 448 of file ldrtypes.h.

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