|
glibmm 2.66.8
|
A content type is a platform specific string that defines the type of a file. More...
Functions | |
| bool | Gio::content_type_equals (const Glib::ustring & type1, const Glib::ustring & type2) |
| Compares two content types for equality. | |
| bool | Gio::content_type_is_a (const Glib::ustring & type, const Glib::ustring & supertype) |
| Determines if type is a subset of supertype. | |
| bool | Gio::content_type_is_unknown (const Glib::ustring & type) |
| Checks if the content type is the generic "unknown" type. | |
| Glib::ustring | Gio::content_type_get_description (const Glib::ustring & type) |
| Gets the human readable description of the content type. | |
| Glib::ustring | Gio::content_type_get_mime_type (const Glib::ustring & type) |
| Gets the mime-type for the content type, if one is registered. | |
| Glib::RefPtr< Icon > | Gio::content_type_get_icon (const Glib::ustring & type) |
| Gets the icon for a content type. | |
| Glib::RefPtr< Icon > | Gio::content_type_get_symbolic_icon (const Glib::ustring & type) |
| Gets the symbolic icon for a content type. | |
| bool | Gio::content_type_can_be_executable (const Glib::ustring & type) |
| Checks if a content type can be executable. | |
| Glib::ustring | Gio::content_type_from_mime_type (const Glib::ustring & mime_type) |
| Tries to find a content type based on the mime type name. | |
| Glib::ustring | Gio::content_type_guess (const std::string & filename, const guchar * data, gsize data_size, bool & result_uncertain) |
| Guesses the content type based on example data. | |
| Glib::ustring | Gio::content_type_guess (const std::string & filename, const std::string & data, bool & result_uncertain) |
| Guesses the content type based on example data. | |
| Glib::StringArrayHandle | Gio::content_type_guess_for_tree (const Glib::RefPtr< const File > & root) |
| Tries to guess the type of the tree with root root, by looking at the files it contains. | |
| Glib::ListHandle< Glib::ustring > | Gio::content_types_get_registered () |
| Gets a list of strings containing all the registered content types known to the system. | |
A content type is a platform specific string that defines the type of a file.
On UNIX it is a mime type like "text/plain" or "image/png". On Win32 it is an extension string like ".doc", ".txt" or a perceived string like "audio". Such strings can be looked up in the registry at HKEY_CLASSES_ROOT.
| bool Gio::content_type_can_be_executable | ( | const Glib::ustring & | 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).
| type | a content type string. |
| bool Gio::content_type_equals | ( | const Glib::ustring & | type1, |
| const Glib::ustring & | type2 ) |
Compares two content types for equality.
| type1 | A content type string. |
| type2 | A content type string. |
| Glib::ustring Gio::content_type_from_mime_type | ( | const Glib::ustring & | mime_type | ) |
Tries to find a content type based on the mime type name.
| mime_type | a mime type string. |
| Glib::ustring Gio::content_type_get_description | ( | const Glib::ustring & | type | ) |
Gets the human readable description of the content type.
| type | A content type string. |
| Glib::RefPtr< Icon > Gio::content_type_get_icon | ( | const Glib::ustring & | type | ) |
Gets the icon for a content type.
| type | A content type string. |
| Glib::ustring Gio::content_type_get_mime_type | ( | const Glib::ustring & | type | ) |
Gets the mime-type for the content type, if one is registered.
| type | A content type string. |
| Glib::RefPtr< Icon > Gio::content_type_get_symbolic_icon | ( | const Glib::ustring & | type | ) |
Gets the symbolic icon for a content type.
| type | A content type string. |
| Glib::ustring Gio::content_type_guess | ( | const std::string & | filename, |
| const guchar * | data, | ||
| gsize | data_size, | ||
| bool & | result_uncertain ) |
Guesses the content type based on example data.
If the function is uncertain, result_uncertain will be set to true. Either filename may be an empty string or data may be 0, in which case the guess will be based solely on the other argument.
| filename | a string. | |
| data | A stream of data. | |
| data_size | The size of data. | |
| [out] | result_uncertain | A flag indicating the certainty of the result. |
| Glib::ustring Gio::content_type_guess | ( | const std::string & | filename, |
| const std::string & | data, | ||
| bool & | result_uncertain ) |
Guesses the content type based on example data.
If the function is uncertain, result_uncertain will be set to true. filename may be an empty string, in which case the guess will be based solely on data.
| filename | a string. | |
| data | A stream of data. | |
| [out] | result_uncertain | A flag indicating the certainty of the result. |
| Glib::StringArrayHandle Gio::content_type_guess_for_tree | ( | const Glib::RefPtr< const File > & | root | ) |
Tries to guess the type of the tree with root root, by looking at the files it contains.
The result is a list of content types, with the best guess coming first.
The types returned all have the form x-content/foo, e.g. x-content/audio-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.
| root | The root of the tree to guess a type for. |
| bool Gio::content_type_is_a | ( | const Glib::ustring & | type, |
| const Glib::ustring & | supertype ) |
Determines if type is a subset of supertype.
| type | A content type string. |
| supertype | A content type string. |
| bool Gio::content_type_is_unknown | ( | const Glib::ustring & | 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 "*".
| type | A content type string. |
| Glib::ListHandle< Glib::ustring > Gio::content_types_get_registered | ( | ) |
Gets a list of strings containing all the registered content types known to the system.