Overview   Class List   Class Hierarchy   Class Members   Functions & Constants   Defines   Header Files  

uima::util::DirectoryWalk Class Reference

List of all members.


Detailed Description

The class DirectoryWalk is used to iterate the entries of a directory in the file system.

       foo(const Location & crclLocation, bool bRecurseSubdirs)
       {
          DirectoryWalk  clDirWalk(crclLocation);

          while(clDirWalk.isValid())
             {
             if(clDirWalk.isDirectory())
                cout << "Directory entry: " << clDirWalk.getNameWithoutPath();
             else
                if(clDirWalk.isFile())
                   cout << "File: " << clDirWalk.getNameWithoutPath();
         else
                   cout << "Weird? " << clDirWalk.getNameWithoutPath();
             if(clDirWalk.matchesWildcardPattern("*.cpp"))
                cout << " C++ source file;";
             cout << endl
             clDirWalk.setToNext();
             }
       }

Public Member Functions

 ~DirectoryWalk (void)
Constructors
 DirectoryWalk (const char *crclDirectory)
 create a new instance of a directory walker based on a directory
Properties
bool isValid (void) const
 return TRUE if the current entry is a valid directory entry
bool isFile (void) const
 return TRUE if the current entry represents a regular file entry
bool isDirectory (void) const
 return TRUE if the current entry represents a directory entry
const char * getNameWithoutPath (void) const
 return the name part of the filename of the current entry
bool matchesWildcardPattern (const char *cpszPattern) const
 return TRUE if the current entry matches the specified wildcard pattern
Miscellaneous
bool setToNext (void)
 walk to the next directory entry and return TRUE if there is one

Constructor & Destructor Documentation

uima::util::DirectoryWalk::DirectoryWalk ( const char *  crclDirectory  )  [inline]

create a new instance of a directory walker based on a directory

References setToNext(), UIMA_ERR_ENGINE_OUT_OF_MEMORY, UIMA_EXC_THROW_NEW, and uima::ErrorInfo::unrecoverable.

uima::util::DirectoryWalk::~DirectoryWalk ( void   )  [inline]


Member Function Documentation

bool uima::util::DirectoryWalk::isValid ( void   )  const [inline]

return TRUE if the current entry is a valid directory entry

bool uima::util::DirectoryWalk::isFile ( void   )  const [inline]

return TRUE if the current entry represents a regular file entry

bool uima::util::DirectoryWalk::isDirectory ( void   )  const [inline]

return TRUE if the current entry represents a directory entry

const char * uima::util::DirectoryWalk::getNameWithoutPath ( void   )  const [inline]

return the name part of the filename of the current entry

bool uima::util::DirectoryWalk::matchesWildcardPattern ( const char *  cpszPattern  )  const [inline]

return TRUE if the current entry matches the specified wildcard pattern

bool uima::util::DirectoryWalk::setToNext ( void   )  [inline]

walk to the next directory entry and return TRUE if there is one

Referenced by DirectoryWalk().


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

Generated on Mon Oct 1 11:15:09 2012 for UIMACPP API by  doxygen 1.5.6