NAME
OUX_Pathname -
Class for deriving information about a pathname.
SYNOPSIS
#include <OUX/files/pathname.hh>
class OUX_Pathname : public OTC_Pathname
{
public:
static os_typespec* get_os_typespec();
~OUX_Pathname();
OUX_Pathname();
OUX_Pathname(char const* thePath);
OUX_Pathname(OTC_String const& thePath);
OUX_Pathname(OTC_Pathname const& thePath);
OUX_Pathname(OUX_Pathname const& thePath);
OUX_Pathname& operator=(OTC_String const& thePath);
OUX_Pathname& operator=(OTC_Pathname const& thePath);
OUX_Pathname& operator=(OUX_Pathname const& thePath);
OUX_Pathname absolute() const;
OUX_Pathname dirname() const;
OUX_Pathname basename() const;
OTC_String basename(char const* theSuffix) const;
OTC_Boolean isAbsolute() const;
OTC_Boolean isRelative() const;
};
CLASS TYPE
Concrete
DESCRIPTION
This class extends OTC_Pathname to allow information
specific to UNIX to be derived from the pathname.
INITIALISATION
OUX_Pathname();
Creates an empty pathname.
OUX_Pathname(char const* thePath);
Creates a pathname using thePath.
OUX_Pathname(OTC_String const& thePath);
Creates a pathname using thePath.
OUX_Pathname(OTC_Pathname const& thePath);
Creates a pathname using thePath.
OUX_Pathname(OUX_Pathname const& thePath);
Creates a pathname using thePath.
OUX_Pathname& operator=(OTC_String const& thePath);
Initialises this path to thePath.
OUX_Pathname& operator=(OTC_Pathname const& thePath);
Initialises this path to thePath.
OUX_Pathname& operator=(OUX_Pathname const& thePath);
Initialises this path to thePath.
QUERY
OUX_Pathname absolute() const;
Returns the pathname as an absolute path.
If the path was already absolute then
it is returned unchanged. If it was
relative, the current working directory is
prepended to it and the result returned.
In the case of the pathname being ".", the
current working directory is returned
without a trailing "/.". If the pathname
is empty, an empty pathname is returned.
OUX_Pathname dirname() const;
Behaves like dirname(1), returning
the directory portion of the pathname.
OUX_Pathname basename() const;
Behaves like basename(1), returning
the filename portion of the pathname.
OTC_String basename(char const* theSuffix) const;
Behaves like basename(1), returning the
filename portion of the pathname less
theSuffix if the file did in fact end in
that suffix.
Note that if the pathname is empty both isAbsolute() and
isRelative() will return OTCLIB_FALSE.
OTC_Boolean isAbsolute() const;
Returns OTCLIB_TRUE if the pathname
commences with a /.
OTC_Boolean isRelative() const;
Returns OTCLIB_TRUE if the pathname
doesn't commence with a /.
SEE ALSO
OTC_Pathname, dirname(1), basename(1)
LIBRARY
OUX
AUTHOR(S)
Graham Dumpleton
COPYRIGHT
Copyright 1992 OTC LIMITED
Copyright 1994 DUMPLETON SOFTWARE CONSULTING PTY LIMITED