OpenShot Library | libopenshot-audio  0.2.0
juce_FileFilter.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  Interface for deciding which files are suitable for something.
33 
34  For example, this is used by DirectoryContentsList to select which files
35  go into the list.
36 
37  @see WildcardFileFilter, DirectoryContentsList, FileListComponent, FileBrowserComponent
38 
39  @tags{Core}
40 */
42 {
43 public:
44  //==============================================================================
45  /** Creates a filter with the given description.
46 
47  The description can be returned later with the getDescription() method.
48  */
49  FileFilter (const String& filterDescription);
50 
51  /** Destructor. */
52  virtual ~FileFilter();
53 
54  //==============================================================================
55  /** Returns the description that the filter was created with. */
56  const String& getDescription() const noexcept;
57 
58  //==============================================================================
59  /** Should return true if this file is suitable for inclusion in whatever context
60  the object is being used.
61  */
62  virtual bool isFileSuitable (const File& file) const = 0;
63 
64  /** Should return true if this directory is suitable for inclusion in whatever context
65  the object is being used.
66  */
67  virtual bool isDirectorySuitable (const File& file) const = 0;
68 
69 
70 protected:
71  //==============================================================================
72  String description;
73 };
74 
75 } // namespace juce
76 
77 /** @}*/
#define JUCE_API
This macro is added to all JUCE public class declarations.
The JUCE String class!
Definition: juce_String.h:42
Interface for deciding which files are suitable for something.
Represents a local file or directory.
Definition: juce_File.h:44