OpenShot Library | OpenShotAudio  0.2.1
juce_WildcardFileFilter.h
1 
2 /** @weakgroup juce_core-files
3  * @{
4  */
5 /*
6  ==============================================================================
7 
8  This file is part of the JUCE library.
9  Copyright (c) 2017 - ROLI Ltd.
10 
11  JUCE is an open source library subject to commercial or open-source
12  licensing.
13 
14  The code included in this file is provided under the terms of the ISC license
15  http://www.isc.org/downloads/software-support-policy/isc-license. Permission
16  To use, copy, modify, and/or distribute this software for any purpose with or
17  without fee is hereby granted provided that the above copyright notice and
18  this permission notice appear in all copies.
19 
20  JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
21  EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
22  DISCLAIMED.
23 
24  ==============================================================================
25 */
26 
27 namespace juce
28 {
29 
30 //==============================================================================
31 /**
32  A type of FileFilter that works by wildcard pattern matching.
33 
34  This filter only allows files that match one of the specified patterns, but
35  allows all directories through.
36 
37  @see FileFilter, DirectoryContentsList, FileListComponent, FileBrowserComponent
38 
39  @tags{Core}
40 */
42 {
43 public:
44  //==============================================================================
45  /**
46  Creates a wildcard filter for one or more patterns.
47 
48  The wildcardPatterns parameter is a comma or semicolon-delimited set of
49  patterns, e.g. "*.wav;*.aiff" would look for files ending in either .wav
50  or .aiff.
51 
52  Passing an empty string as a pattern will fail to match anything, so by leaving
53  either the file or directory pattern parameter empty means you can control
54  whether files or directories are found.
55 
56  The description is a name to show the user in a list of possible patterns, so
57  for the wav/aiff example, your description might be "audio files".
58  */
59  WildcardFileFilter (const String& fileWildcardPatterns,
60  const String& directoryWildcardPatterns,
61  const String& filterDescription);
62 
63  /** Destructor. */
64  ~WildcardFileFilter() override;
65 
66  //==============================================================================
67  /** Returns true if the filename matches one of the patterns specified. */
68  bool isFileSuitable (const File& file) const override;
69 
70  /** This always returns true. */
71  bool isDirectorySuitable (const File& file) const override;
72 
73 private:
74  //==============================================================================
75  StringArray fileWildcards, directoryWildcards;
76 
77  JUCE_LEAK_DETECTOR (WildcardFileFilter)
78 };
79 
80 } // namespace juce
81 
82 /** @}*/
#define JUCE_API
This macro is added to all JUCE public class declarations.
A special array for holding a list of strings.
The JUCE String class!
Definition: juce_String.h:42
A type of FileFilter that works by wildcard pattern matching.
Interface for deciding which files are suitable for something.
Represents a local file or directory.
Definition: juce_File.h:44