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> // for UT_StringList
20 #include <UT/UT_StringSet.h>
21 
22 class UT_String;
23 class UT_StringArray;
24 
26 {
27 public:
28  /// Constructs an object corresponding to a directory specified by the
29  /// path parameter, and fills the member symbol table with entries
30  /// corresponding to files matched by a given pattern.
31  /// If includeDots is true, the hidden files (that start with a dot '.')
32  /// are also added to the member symbol table.
33  UT_Directory(const char *path, const char *pattern=0, int includeDots=1);
34 
35  /// Returns 1 if the file is found in the directory.
36  int findFile(const char *filename) const;
37 
38 
39  /// @{
40  /// Returns a list of files matching the pattern passed in. The result
41  /// contains each matching file separated by a space (or a list of files).
42  int getFiles(const char *pattern, UT_String &result) const;
43  int getFiles(const char *pattern, UT_StringList &list) const;
44  int getFiles(const char *pattern, UT_StringArray &array) const;
45  /// @}
46 
47  /// Returns the number of files in the member symbol table.
48  int entries() const;
49 
50  /// Traverse all the files and call the 'func' callback on the
51  /// file names that match a given pattern.
52  void traverseFiles(int (*func)(const char *filename, void *data),
53  void *data = 0, const char *pattern = 0) const;
54 
55 private:
56  UT_StringSet myFiles;
57 };
58 
59 #endif
GT_API const UT_StringHolder filename
GLsizei const GLchar *const * path
Definition: glcorearb.h:3341
**But if you need a result
Definition: thread.h:613
GLushort pattern
Definition: glad.h:2583
GLenum func
Definition: glcorearb.h:783
Definition: format.h:895
#define FS_API
Definition: FS_API.h:10