JDXfileName Class Reference
[JCAMP-DX implementation (odinpara library)]

#include <jdxtypes.h>

Inheritance diagram for JDXfileName:

Inheritance graph
[legend]

List of all members.

Public Member Functions

 JDXfileName ()
 JDXfileName (const STD_string &filename, const STD_string &name="", bool userParameter=true, compatMode mode=notBroken, parameterMode parameter_mode=edit)
 JDXfileName (const JDXfileName &jf)
JDXfileNameoperator= (const STD_string &filename)
JDXfileNameoperator= (const JDXfileName &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
JDXfileNameset_suffix (const STD_string &suff)
STD_string get_defaultdir () const
JDXfileNameset_defaultdir (const STD_string &defdir)
bool is_dir () const
JDXfileNameset_dir (bool flag)
bool parsevalstring (const STD_string &parstring)
const char * get_typeInfo () const
JcampDxClasscreate_copy () const


Detailed Description

JCAMP-DX class for representing file names. Besides using JDXfileName 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=JDXfileName(myfile).get_basename();
  STD_cout << "myfile_base=" << myfile_base << STD_endl;

  STD_string myfile_base_nosuffix=JDXfileName(myfile).get_basename_nosuffix();
  STD_cout << "myfile_base_nosuffix=" << myfile_base_nosuffix << STD_endl;

  STD_string myfile_dir= JDXfileName(myfile).get_dirname();
  STD_cout << "myfile_dir=" << myfile_dir << STD_endl;
      

Definition at line 421 of file jdxtypes.h.


Constructor & Destructor Documentation

JDXfileName::JDXfileName (  )  [inline]

Default constructor

Definition at line 428 of file jdxtypes.h.

JDXfileName::JDXfileName ( const STD_string &  filename,
const STD_string &  name = "",
bool  userParameter = true,
compatMode  mode = notBroken,
parameterMode  parameter_mode = edit 
)

Constructor with the following arguments:

  • filename: Initial value for the file name
  • name: The label of the JCAMP-DX parameter
  • userParameter: Whether this is a user defined JCAMP-DX parameter
  • mode: Mode for ASCII representation of strings or arrays of strings
  • parameter_mode: Mode for GUI accesibility of the parameter

JDXfileName::JDXfileName ( const JDXfileName jf  ) 

Copy constructor


Member Function Documentation

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

Assignment from a string

Reimplemented from JDXstring.

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

Assignment operator

bool JDXfileName::exists (  )  const

Returns 'true' only if the file/directory exists

STD_string JDXfileName::get_basename (  )  const [inline]

Returns the filename without preceeding directories

Definition at line 465 of file jdxtypes.h.

STD_string JDXfileName::get_basename_nosuffix (  )  const

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

STD_string JDXfileName::get_dirname (  )  const [inline]

Returns the directory of the filename

Definition at line 476 of file jdxtypes.h.

STD_string JDXfileName::get_suffix (  )  const [inline]

Returns the suffix (file extension) of the filename

Definition at line 481 of file jdxtypes.h.

JDXfileName& JDXfileName::set_suffix ( const STD_string &  suff  )  [inline]

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

Definition at line 486 of file jdxtypes.h.

STD_string JDXfileName::get_defaultdir (  )  const [inline]

Returns the default location of the filename

Definition at line 491 of file jdxtypes.h.

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

Sets the default location of the filename

bool JDXfileName::is_dir (  )  const [inline]

Returns whether used exclusively for directory names

Definition at line 502 of file jdxtypes.h.

JDXfileName& JDXfileName::set_dir ( bool  flag  )  [inline]

Specifies whether used exclusively for directory names

Definition at line 507 of file jdxtypes.h.

bool JDXfileName::parsevalstring ( const STD_string &   )  [virtual]

Parses and assigns the value in the given string

Reimplemented from JDXstring.

const char* JDXfileName::get_typeInfo (  )  const [inline, virtual]

Returns a string describing the type of the parameter

Reimplemented from JDXstring.

Definition at line 512 of file jdxtypes.h.

JcampDxClass* JDXfileName::create_copy (  )  const [inline, virtual]

Returns a deep copy of the parameter

Reimplemented from JDXstring.

Definition at line 513 of file jdxtypes.h.


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

Generated on Wed Sep 30 15:33:06 2009 by  doxygen 1.5.6