HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UT_Directory.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: FS library (C++)
7  *
8  * COMMENTS: UT_Directory creates a hash list for a directory
9  * This class makes no distinctions between the file types
10  * it leaves this to the user of the class.
11  *
12  * Originally taken from UT_Directory
13  */
14 
15 #ifndef __UT_Directory_h__
16 #define __UT_Directory_h__
17 
18 #include "FS_API.h"
19 #include <UT/UT_ValArray.h>
20 #include <UT/UT_String.h>
21 #include <UT/UT_StringArray.h>
22 #include <UT/UT_StringSet.h>
23 
25 public:
26  /// Constructs an object corresponding to a directory specified by the
27  /// path parameter, and fills the member symbol table with entries
28  /// corresponding to files matched by a given pattern.
29  /// If includeDots is true, the hidden files (that start with a dot '.')
30  /// are also added to the member symbol table.
31  UT_Directory(const char *path, const char *pattern=0, int includeDots=1);
32  ~UT_Directory();
33 
34  /// Returns 1 if the file is found in the directory.
35  int findFile(const char *filename) const;
36 
37 
38  /// @{
39  /// Returns a list of files matching the pattern passed in. The result
40  /// contains each matching file separated by a space (or a list of files).
41  int getFiles(const char *pattern, UT_String &result) const;
42  int getFiles(const char *pattern, UT_StringList &list) const;
43  int getFiles(const char *pattern, UT_StringArray &array) const;
44  /// @}
45 
46  /// Returns the number of files in the member symbol table.
47  int entries() const;
48 
49  /// Traverse all the files and call the 'func' callback on the
50  /// file names that match a given pattern.
51  void traverseFiles(int (*func)(const char *filename, void *data),
52  void *data = 0, const char *pattern = 0) const;
53 
54 private:
55  UT_StringSet myFiles;
56 };
57 
58 #endif
GT_API const UT_StringHolder filename
GLsizei const GLchar *const * path
Definition: glcorearb.h:3340
GLboolean * data
Definition: glcorearb.h:130
GLenum func
Definition: glcorearb.h:782
png_infop png_sPLT_tpp entries
Definition: png.h:2481
#define FS_API
Definition: FS_API.h:10