#line 1 "/user/cvsspst/ees1cg/RAVL/RAVL-0.7/OS/FileSystem/Directory.hh" // This file is part of RAVL, Recognition And Vision Library // Copyright (C) 2001, University of Surrey // This code may be redistributed under the terms of the GNU Lesser // General Public License (LGPL). See the lgpl.licence file for details or // see http://www.gnu.org/copyleft/lesser.html // file-header-ends-here #ifndef RAVL_FILEDIRECTORY_HEADER #define RAVL_FILEDIRECTORY_HEADER /////////////////////////////////////////////////////////////////////// //! userlevel=Normal //! author="Charles Galambos" //! docentry="Ravl.OS.File System" //! lib=RavlOS //! rcsid="$Id: Directory.hh,v 1.5 2002/03/21 18:05:52 craftit Exp $" //! file="Ravl/OS/FileSystem/Directory.hh" //! date="07/05/98" #include "Ravl/OS/Filename.hh" #include "Ravl/DList.hh" namespace RavlN { //: Directory handling. // Used for querying and changing the contents of directories.
// The class is designed to be thread safe where different
// instances of DirectoryC are used simulatiously and between
// 'const' methods of this class.
class DirectoryC : public FilenameC {
public:
inline DirectoryC(const StringC &name = StringC("."));
//: Construct from a string.
inline DirectoryC(const DirectoryC &name);
//: Copy constructor.
inline bool Create(const FilePermissionC &Acc = FilePermissionC()) const
{ return FilenameC::MakeDir(Acc); }
//: Create a directory by this name.
inline bool IsValid() const
{ return FilenameC::IsDirectory(); }
//: Is this really a directory ?
DListC
// '..' and '.' are not returned in the list.
DListC
// Will return an empty list if anything goes wrong.
DListC
// if lazy is true, files are only updated if they have a later
// date than the target.
// if sync is true, all files that are not in the source directory
// are removed.
protected:
static bool MatchFilt(const char *filter,const char *str);
//: Simple test if 'x' matches filter.
// Wild cards are '*','?' and '\' escapes.
};
////////////////////////////////////////////////////////////
inline
DirectoryC::DirectoryC(const StringC &name)
: FilenameC(name)
{}
inline
DirectoryC::DirectoryC(const DirectoryC &name)
: FilenameC(name)
{}
}
#endif