2 * Copyright 2004-2006, Jérôme Duval. All rights reserved.
3 * Distributed under the terms of the MIT License.
7 #ifndef _EXPANDER_RULES_H
8 #define _EXPANDER_RULES_H
11 #include <FilePanel.h>
19 ExpanderRule(const char* mimetype
,
20 const BString
& filenameExtension
,
21 const BString
& listingCommand
,
22 const BString
& expandCommand
);
24 const BMimeType
& MimeType() const
26 const BString
& FilenameExtension() const
27 { return fFilenameExtension
; }
28 const BString
& ListingCmd() const
29 { return fListingCmd
; }
30 const BString
& ExpandCmd() const
31 { return fExpandCmd
; }
35 BString fFilenameExtension
;
46 ExpanderRule
* MatchingRule(BString
& fileName
,
47 const char* filetype
);
48 ExpanderRule
* MatchingRule(const entry_ref
* ref
);
51 void _LoadRulesFiles();
52 void _LoadRulesFile(const char* path
);
54 bool _AddRule(const char* mimetype
,
55 const BString
& filenameExtension
,
56 const BString
& listingCommand
,
57 const BString
& expandCommand
);
64 class RuleRefFilter
: public BRefFilter
{
66 RuleRefFilter(ExpanderRules
& rules
);
67 bool Filter(const entry_ref
* ref
, BNode
* node
,
68 struct stat_beos
* stat
,
69 const char* filetype
);
72 ExpanderRules
& fRules
;
76 #endif // _EXPANDER_RULES_H