Release Notes Table of Contents | Release Notes Index |
Declared in: storage/Mime.h
|
GetSnifferRule() and SetSnifferRule() get and set the pattern-matching rule that the file type sniffer uses to detect the MIME type represented by this object. The sniffer rule is a string that follows this format:
rating [begin:end] ( [begin:end] 'pattern1' | [begin:end] 'pattern2' | ... )
If no byte range declaration is provided, [0:0] is assumed—i.e. the pattern(s) must start at the first byte.
For example, the following rule strings says that the content of an examined file must begin with the characters 'ABCD':
"1.0 ('ABCD')"
This rule says that the content must contain the characters 'ABCD' or 'abcd' starting somewhere in the first three bytes:
"1.0 [0:3] ('ABCD' | 'abcd')"
Here the content must contain 'ABCD' or 'abcd' starting in the first three bytes, or it must contain 'EFGH' starting at byte 13:
"1.0 [0:3] ('ABCD' | 'abcd' | [13] 'EFGH')"
The CheckSnifferRule() function is a debugging tool that checks your sniffer rule (independent of MIME type) and returns a string that describes the error. If the rule is correct, you get back (in result) a string that says "rule is correct". Otherwise, the result string contains an error message with a pointer to the offending part of the rule. The string is meant to be viewed in a monospace font.
|
B_SNIFFER_RULE_CHANGED is a new MIME database-watching bit vector value. If your application has called BMimeType::StartWatching() and someone changes a sniffer rule, your target will receive a B_META_MIME_CHANGED message that has, as in its "be:which" field, the value B_SNIFFER_RULE_CHANGED.
|
These new class functions ask the sniffer to identify the MIME type of a file or data. result must be allocated before it's passed in.
Declared in: storage/Node.h
|
New functions to more easily work with string-valued file attributes. WriteAttrString() writes a NULL-terminator at the end of the string.
Declared in: storage/Path.h
BPath has new versions of the constructor and the SetTo() function that accepts entry_ref arguments.
|
|
Declared in: storage/Query.h
|
This new version of GetPredicate() returns the query's predicate string as a BString object.
Release Notes Table of Contents | Release Notes Index |
Copyright © 2000 Be, Inc. All rights reserved..