BMimeType

The BMimeType class provides three services:

All three services operate on MIME strings. In other words, they answer questions such as "Does this string have a supertype?", "Is this string installed in the database?", and so on. You can get the MIME strings from anywhere: from a file's file type attribute, from and application's signature, from the header of an e-mail message, you can even make them up.


Valid MIME Strings

A valid MIME string takes the form…

supertype/[subtype]

…where supertype is one of the seven "media" strings:

…and (the optional) subtype can be just about anything… Except it can't include spaces or any of these forbidden characters:

* / < > @ , ; : " ( ) [ ] ? =

When you initialize a BMimeType object (through the constructor or SetTo() function), you have to tell it what MIME string you want it to represent:

You can check the validity of a MIME string without constructing a BMimeType object by calling the static IsValid() function:

BMimeType::IsValid("text/qwerty");
Creative Commons License
Legal Notice
This work is licensed under a Creative Commons Attribution-Non commercial-No Derivative Works 3.0 License.