ContentType

Members

Static functions

canBeExecutable
bool canBeExecutable(string type)

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).

contentTypesGetRegistered
ListG contentTypesGetRegistered()

Gets a list of strings containing all the registered content types known to the system. The list and its data should be freed using g_list_free_full (list, g_free).

equals
bool equals(string type1, string type2)

Compares two content types for equality.

fromMimeType
string fromMimeType(string mimeType)

Tries to find a content type based on the mime type name.

getDescription
string getDescription(string type)

Gets the human readable description of the content type.

getGenericIconName
string getGenericIconName(string type)

Gets the generic icon name for a content type.

getIcon
IconIF getIcon(string type)

Gets the icon for a content type.

getMimeDirs
string[] getMimeDirs()

Get the list of directories which MIME data is loaded from. See Content.typeSetMimeDirs for details.

getMimeType
string getMimeType(string type)

Gets the mime type for the content type, if one is registered.

getSymbolicIcon
IconIF getSymbolicIcon(string type)

Gets the symbolic icon for a content type.

guessForTree
string[] guessForTree(FileIF root)

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.

isA
bool isA(string type, string supertype)

Determines if type is a subset of supertype.

isMimeType
bool isMimeType(string type, string mimeType)

Determines if type is a subset of mime_type. Convenience wrapper around Content.typeIsA.

isUnknown
bool isUnknown(string type)

Checks if the content type is the generic "unknown" type. On UNIX this is the "application/octet-stream" mimetype, while on win32 it is "*" and on OSX it is a dynamic type or octet-stream.

setMimeDirs
void setMimeDirs(string[] dirs)

Set the list of directories used by GIO to load the MIME database. If dirs is NULL, the directories used are the default:

typeGuess
string typeGuess(string filename, char[] data, bool resultUncertain)

Guesses the content type based on example data. If the function is uncertain, result_uncertain will be set to TRUE. Either filename or data may be NULL, in which case the guess will be based solely on the other argument.