Maintainer | gtk2hs-devel@lists.sourceforge.net |
---|---|
Stability | alpha |
Portability | portable (depends on GHC) |
Safe Haskell | None |
Language | Haskell98 |
System.GIO.File.ContentType
Description
- contentTypeEquals :: GlibString string => string -> string -> Bool
- contentTypeIsA :: GlibString string => string -> string -> Bool
- contentTypeIsUnknown :: GlibString string => string -> Bool
- contentTypeGetDescription :: GlibString string => string -> string
- contentTypeGetMimeType :: GlibString string => string -> string
- contentTypeGetIcon :: GlibString string => string -> Icon
- contentTypeCanBeExecutable :: GlibString string => string -> Bool
- contentTypeFromMimeType :: GlibString string => string -> string
- contentTypeGuess :: (GlibFilePath fp, GlibString string) => fp -> string -> Int -> IO (Bool, string)
- contentTypeGuessForTree :: (FileClass file, GlibString string) => file -> IO [string]
- contentTypesGetRegistered :: GlibString string => IO [string]
Details
A content type is a platform specific string that defines the type of a file. On 1 it is a mime type, on win32 it is an extension string like ".doc", ".txt" or a percieved string like "audio". Such strings can be looked up in the registry at HkeyClassesRoot.
Methods
Arguments
:: GlibString string | |
=> string | |
-> string | |
-> Bool | returns |
Compares two content types for equality.
Arguments
:: GlibString string | |
=> string | |
-> string | |
-> Bool | returns |
Determines if type is a subset of supertype.
Arguments
:: GlibString string | |
=> string | |
-> Bool | returns |
Checks if the content type is the generic "unknown" type. On 1 this is the "application/octet-stream" mimetype, while on win32 it is "*".
contentTypeGetDescription Source
Arguments
:: GlibString string | |
=> string | |
-> string | returns a short description of the content type type. |
Gets the human readable description of the content type.
Arguments
:: GlibString string | |
=> string | |
-> string | returns the registered mime-type for the given type, or |
Gets the mime-type for the content type. If one is registered
Arguments
:: GlibString string | |
=> string | |
-> Icon | returns |
Gets the icon for a content type.
contentTypeCanBeExecutable Source
Arguments
:: GlibString string | |
=> string | |
-> Bool | returns |
Checks if a content type can be executable. Note that for instance things like text files can be executables (i.e. scripts and batch files).
contentTypeFromMimeType Source
Arguments
:: GlibString string | |
=> string |
|
-> string |
Tries to find a content type based on the mime type name.
Arguments
:: (GlibFilePath fp, GlibString string) | |
=> fp | |
-> string |
|
-> Int |
|
-> IO (Bool, string) | returns a string indicating a guessed content type for the given data. |
contentTypeGuessForTree Source
Arguments
:: (FileClass file, GlibString string) | |
=> file |
|
-> IO [string] | returns a list of possible content types |
Tries to guess the type of the tree with root root, by looking at the files it contains. The result is an array of content types, with the best guess coming first.
The types returned all have the form x-contentfoo, e.g. x-contentaudio-cdda (for audio CDs) or x-content/image-dcf (for a camera memory card). See the shared-mime-info specification for more on x-content types.
This function is useful in the implementation of mountGuessContentType
.
contentTypesGetRegistered Source
Arguments
:: GlibString string | |
=> IO [string] | returns GList of the registered content types. |
Gets a list of strings containing all the registered content types known to the system.