#include "SimpleGlob.h"
CSimpleGlob glob(FLAGS);
glob.Add("file*");
glob.Add(argc, argv);
for (int n = 0; n < glob.FileCount(); ++n) {
ProcessFile(glob.File(n));
}
Copyright (c) 2006-2007, Brodie Thiesfield
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Data Structures | |
| class | SimpleGlobUtil |
| String manipulation functions. More... | |
| struct | SimpleGlobBase< SOCHAR > |
| Unix glob implementation. More... | |
| class | CSimpleGlobTempl< SOCHAR > |
| Implementation of the SimpleGlob class. More... | |
Defines | |
| #define | MAX_PATH PATH_MAX |
| #define | sg_strchr ::strchr |
| #define | sg_strrchr ::strrchr |
| #define | sg_strlen ::strlen |
| #define | sg_strcpy_s(a, n, b) ::strcpy(a,b) |
| #define | sg_strcmp ::strcmp |
| #define | sg_strcasecmp ::strcasecmp |
| #define | SOCHAR_T char |
| #define | SG_ASSERT(b) |
| #define | SG_PATH_CHAR '/' |
| #define | CSimpleGlob CSimpleGlobA |
| TCHAR version dependent on if _UNICODE is defined. | |
Typedefs | |
| typedef CSimpleGlobTempl< char > | CSimpleGlobA |
| ASCII/MBCS version of CSimpleGlob. | |
| typedef CSimpleGlobTempl< wchar_t > | CSimpleGlobW |
| wchar_t version of CSimpleGlob | |
Enumerations | |
| enum | SG_Flags { SG_GLOB_ERR = 1 << 0, SG_GLOB_MARK = 1 << 1, SG_GLOB_NOSORT = 1 << 2, SG_GLOB_NOCHECK = 1 << 3, SG_GLOB_TILDE = 1 << 4, SG_GLOB_ONLYDIR = 1 << 5, SG_GLOB_ONLYFILE = 1 << 6, SG_GLOB_NODOT = 1 << 7, SG_GLOB_FULLSORT = 1 << 8 } |
| The operation of SimpleGlob is fine-tuned via the use of a combination of the following flags. More... | |
| enum | SG_Error { SG_SUCCESS = 0, SG_ERR_NOMATCH = 1, SG_ERR_MEMORY = -1, SG_ERR_FAILURE = -2 } |
| Error return codes. More... | |
| enum | SG_FileType { SG_FILETYPE_INVALID, SG_FILETYPE_FILE, SG_FILETYPE_DIR } |
|
|
TCHAR version dependent on if _UNICODE is defined.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ASCII/MBCS version of CSimpleGlob.
|
|
|
wchar_t version of CSimpleGlob
|
|
|
Error return codes.
00138 {
00139 SG_SUCCESS = 0,
00140 SG_ERR_NOMATCH = 1,
00141 SG_ERR_MEMORY = -1,
00142 SG_ERR_FAILURE = -2
00143 };
|
|
|
00250 {
00251 SG_FILETYPE_INVALID,
00252 SG_FILETYPE_FILE,
00253 SG_FILETYPE_DIR
00254 };
|
|
|
The operation of SimpleGlob is fine-tuned via the use of a combination of the following flags. The flags may be passed at initialization of the class and used for every filespec added, or alternatively they may optionally be specified in the call to Add() and be different for each filespec.
00125 {
00126 SG_GLOB_ERR = 1 << 0,
00127 SG_GLOB_MARK = 1 << 1,
00128 SG_GLOB_NOSORT = 1 << 2,
00129 SG_GLOB_NOCHECK = 1 << 3,
00130 SG_GLOB_TILDE = 1 << 4,
00131 SG_GLOB_ONLYDIR = 1 << 5,
00132 SG_GLOB_ONLYFILE = 1 << 6,
00133 SG_GLOB_NODOT = 1 << 7,
00134 SG_GLOB_FULLSORT = 1 << 8
00135 };
|
1.3.9.1