# Gio Namespace Reference

## Classes

class | AppLaunchContext
| This is used to handle, for instance, startup notification and launching of the new application on the same screen as the launching window. More...
class | AppInfo
| Application information, to describe applications installed on the system, and launch them. More...
class | AsyncResult
| Provides a base class for implementing asynchronous function results. More...
class | BufferedInputStream
| The buffered input stream implements FilterInputStream and provides for buffered reads. More...
class | BufferedOutputStream
| The buffered output stream implements FilterOutputStream and provides for buffered writes. More...
class | Cancellable
| Allows actions to be cancelled. More...
class | DataInputStream
| An implementation of BufferedInputStream that allows for high-level data manipulation of arbitrary data (including binary operations). More...
class | DataOutputStream
| An implementation of BufferedOutputStream that allows for high-level data manipulation of arbitrary data (including binary operations). More...
class | Drive
| Virtual File System drive management. More...
class | Emblem
| An object for emblems. More...
class | EmblemedIcon
| Icons with Emblems. More...
class | Error
| Exception class for giomm errors. More...
class | File
| File and directory handling. More...
class | FileAttributeInfo
| Information about a specific attribute - see FileAttributeInfoList. More...
class | FileAttributeInfoList
| Key-Value paired file attributes. More...
class | FileEnumerator
| Enumerated Files Routines. More...
class | FileIcon
| FileIcon specifies an icon by pointing to an image file to be used as icon. More...
class | FileAttributeMatcher
| FileAttributeMatcher allows for searching through a FileInfo for attributes. More...
class | FileInfo
| FileInfo implements methods for getting information that all files should contain, and allows for manipulation of extended attributes. More...
class | FileInputStream
| FileInputStream provides input streams that take their content from a file. More...
class | FileIOStream
| FileIOStream provides input streams that take their content from a file. More...
class | FileMonitor
| Monitors a file or directory for changes. More...
class | FilenameCompleter
| Completes partial file and directory names given a partial string by looking in the file system for clues. More...
class | FileOutputStream
| FileOutputStream provides output streams that write their content to a file. More...
class | FilterInputStream
| Filter Input Stream. More...
class | FilterOutputStream
| Filter Output Stream. More...
class | Icon
| This is a very minimal interface for icons. More...
class | InetAddress
| An IPv4/IPv6 address. More...
class | InetSocketAddress
| Internet SocketAddress. More...
class | Initable
| Failable object initialization interface. More...
class | InputStream
| Base class for implementing streaming input. More...
class | IOStream
class | LoadableIcon
| Extends the Icon interface and adds the ability to load icons from streams. More...
class | MemoryInputStream
| MemoryInputStream implements InputStream for arbitrary memory chunks. More...
class | MemoryOutputStream
| Streaming output operations on memory chunks. More...
class | Mount
| The Mount interface represents user-visible mounts. More...
class | MountOperation
| Authentication methods for mountable locations. More...
class | NetworkAddress
| A SocketConnectable for resolving hostnames. More...
class | NetworkService
| A GSocketConnectable for resolving SRV records. More...
class | OutputStream
| Base class for implementing streaming output. More...
class | Resolver
| Asynchronous and cancellable DNS resolver. More...
class | Seekable
| Stream seeking interface. More...
class | Socket
| Low-level socket object. More...
class | SocketAddress
| Abstract base class representing endpoints for socket communication. More...
class | SocketAddressEnumerator
| Enumerator type for objects that contain or generate SocketAddresses. More...
class | SocketConnectable
| Interface for potential socket endpoints. More...
class | SrvTarget
| DNS SRV record target. More...
class | ThemedIcon
| Icon theming support ThemedIcon is an implementation of Gio::Icon that supports icon themes. More...
class | Volume
| The Volume interface represents user-visible objects that can be mounted. More...
class | VolumeMonitor
| Monitors a file or directory for changes. More...
class | DesktopAppInfo
| DesktopAppInfo is an implementation of AppInfo based on desktop files. More...
class | UnixInputStream
| UnixInputStream implements InputStream for reading from a unix file descriptor, including asynchronous operations. More...
class | UnixOutputStream
| UnixOutputStream implements OutputStream for writing to a a unix file descriptor, including asynchronous operations. More...

## Typedefs

typedef sigc::slot< void, Glib::RefPtr< AsyncResult >& > | SlotAsyncReady
| A function that will be called when an asynchronous operation within GIO has been completed.
typedef Glib::ListHandle < Gio::SrvTarget, SrvTargetListTraits > | ListHandle_SrvTarget

## Enumerations

enum | AppInfoCreateFlags { APP_INFO_CREATE_NONE = 0, APP_INFO_CREATE_NEEDS_TERMINAL = 1 << 0, APP_INFO_CREATE_SUPPORTS_URIS = 1 << 1 }
enum | DriveStartFlags { DRIVE_START_NONE }
enum | DriveStartStopType { DRIVE_START_STOP_TYPE_UNKNOWN, DRIVE_START_STOP_TYPE_SHUTDOWN, DRIVE_START_STOP_TYPE_NETWORK, DRIVE_START_STOP_TYPE_MULTIDISK, DRIVE_START_STOP_TYPE_PASSWORD }
enum | EmblemOrigin { EMBLEM_ORIGIN_UNKNOWN, EMBLEM_ORIGIN_DEVICE, EMBLEM_ORIGIN_LIVEMETADATA, EMBLEM_ORIGIN_TAG }
enum | DataStreamByteOrder { DATA_STREAM_BYTE_ORDER_BIG_ENDIAN, DATA_STREAM_BYTE_ORDER_LITTLE_ENDIAN, DATA_STREAM_BYTE_ORDER_HOST_ENDIAN }
enum | DataStreamNewlineType { DATA_STREAM_NEWLINE_TYPE_LF, DATA_STREAM_NEWLINE_TYPE_CR, DATA_STREAM_NEWLINE_TYPE_CR_LF, DATA_STREAM_NEWLINE_TYPE_ANY }
enum | SocketFamily { SOCKET_FAMILY_INVALID = 0, SOCKET_FAMILY_IPV6 = 3 }
enum | FileQueryInfoFlags { FILE_QUERY_INFO_NONE = 0, FILE_QUERY_INFO_NOFOLLOW_SYMLINKS = 1 << 0 }
enum | FileCreateFlags { FILE_CREATE_NONE = 0, FILE_CREATE_PRIVATE = 1 << 0, FILE_CREATE_REPLACE_DESTINATION = 1 << 1 }
enum | FileCopyFlags { FILE_COPY_NONE = 0, FILE_COPY_OVERWRITE = 1 << 0, FILE_COPY_BACKUP = 1 << 1, FILE_COPY_NOFOLLOW_SYMLINKS = 1 << 2, FILE_COPY_ALL_METADATA = 1 << 3, FILE_COPY_NO_FALLBACK_FOR_MOVE = 1 << 4, FILE_COPY_TARGET_DEFAULT_PERMS = 1 << 5 }
enum | FileMonitorFlags { FILE_MONITOR_NONE = 0, FILE_MONITOR_WATCH_MOUNTS = 1 << 0 }
enum | MountUnmountFlags { MOUNT_UNMOUNT_NONE = 0, MOUNT_UNMOUNT_FORCE = 1 << 0 }
enum | MountMountFlags { MOUNT_MOUNT_NONE }
enum | FileAttributeType { FILE_ATTRIBUTE_TYPE_INVALID, FILE_ATTRIBUTE_TYPE_STRING, FILE_ATTRIBUTE_TYPE_BYTE_STRING, FILE_ATTRIBUTE_TYPE_BOOLEAN, FILE_ATTRIBUTE_TYPE_UINT32, FILE_ATTRIBUTE_TYPE_INT32, FILE_ATTRIBUTE_TYPE_UINT64, FILE_ATTRIBUTE_TYPE_INT64, FILE_ATTRIBUTE_TYPE_OBJECT, FILE_ATTRIBUTE_TYPE_STRINGV }
enum | FileAttributeInfoFlags { FILE_ATTRIBUTE_INFO_NONE = 0, FILE_ATTRIBUTE_INFO_COPY_WITH_FILE = 1 << 0, FILE_ATTRIBUTE_INFO_COPY_WHEN_MOVED = 1 << 1 }
enum | FileAttributeStatus { FILE_ATTRIBUTE_STATUS_UNSET, FILE_ATTRIBUTE_STATUS_SET, FILE_ATTRIBUTE_STATUS_ERROR_SETTING }
enum | FileType { FILE_TYPE_NOT_KNOWN, FILE_TYPE_REGULAR, FILE_TYPE_DIRECTORY, FILE_TYPE_SYMBOLIC_LINK, FILE_TYPE_SPECIAL, FILE_TYPE_SHORTCUT, FILE_TYPE_MOUNTABLE }
enum | FileMonitorEvent { FILE_MONITOR_EVENT_CHANGED, FILE_MONITOR_EVENT_CHANGES_DONE_HINT, FILE_MONITOR_EVENT_DELETED, FILE_MONITOR_EVENT_CREATED, FILE_MONITOR_EVENT_ATTRIBUTE_CHANGED, FILE_MONITOR_EVENT_PRE_UNMOUNT, FILE_MONITOR_EVENT_UNMOUNTED }
enum | AskPasswordFlags { ASK_PASSWORD_NEED_PASSWORD = 1 << 0, ASK_PASSWORD_NEED_USERNAME = 1 << 1, ASK_PASSWORD_NEED_DOMAIN = 1 << 2, ASK_PASSWORD_SAVING_SUPPORTED = 1 << 3, ASK_PASSWORD_ANONYMOUS_SUPPORTED = 1 << 4 }
enum | PasswordSave { PASSWORD_SAVE_NEVER, PASSWORD_SAVE_FOR_SESSION, PASSWORD_SAVE_PERMANENTLY }
enum | MountOperationResult { MOUNT_OPERATION_HANDLED, MOUNT_OPERATION_ABORTED, MOUNT_OPERATION_UNHANDLED }
enum | OutputStreamSpliceFlags { OUTPUT_STREAM_SPLICE_NONE = 0, OUTPUT_STREAM_SPLICE_CLOSE_SOURCE = 1 << 0, OUTPUT_STREAM_SPLICE_CLOSE_TARGET = 1 << 1 }
enum | SocketType { SOCKET_TYPE_INVALID, SOCKET_TYPE_STREAM, SOCKET_TYPE_DATAGRAM, SOCKET_TYPE_SEQPACKET }
enum | SocketProtocol { SOCKET_PROTOCOL_UNKNOWN = -1, SOCKET_PROTOCOL_DEFAULT = 0, SOCKET_PROTOCOL_TCP = 6, SOCKET_PROTOCOL_UDP = 17, SOCKET_PROTOCOL_SCTP = 132 }
enum | SocketMsgFlags { SOCKET_MSG_NONE, SOCKET_MSG_OOB, SOCKET_MSG_PEEK = SOCKET_MSG_OOB, SOCKET_MSG_DONTROUTE = SOCKET_MSG_OOB }

## Functions

AppInfoCreateFlags | operator| (AppInfoCreateFlags lhs, AppInfoCreateFlags rhs)
AppInfoCreateFlags | operator& (AppInfoCreateFlags lhs, AppInfoCreateFlags rhs)
AppInfoCreateFlags | operator^ (AppInfoCreateFlags lhs, AppInfoCreateFlags rhs)
AppInfoCreateFlags | operator~ (AppInfoCreateFlags flags)
AppInfoCreateFlags& | operator|= (AppInfoCreateFlags& lhs, AppInfoCreateFlags rhs)
AppInfoCreateFlags& | operator&= (AppInfoCreateFlags& lhs, AppInfoCreateFlags rhs)
AppInfoCreateFlags& | operator^= (AppInfoCreateFlags& lhs, AppInfoCreateFlags rhs)
FileQueryInfoFlags | operator| (FileQueryInfoFlags lhs, FileQueryInfoFlags rhs)
FileQueryInfoFlags | operator& (FileQueryInfoFlags lhs, FileQueryInfoFlags rhs)
FileQueryInfoFlags | operator^ (FileQueryInfoFlags lhs, FileQueryInfoFlags rhs)
FileQueryInfoFlags | operator~ (FileQueryInfoFlags flags)
FileQueryInfoFlags& | operator|= (FileQueryInfoFlags& lhs, FileQueryInfoFlags rhs)
FileQueryInfoFlags& | operator&= (FileQueryInfoFlags& lhs, FileQueryInfoFlags rhs)
FileQueryInfoFlags& | operator^= (FileQueryInfoFlags& lhs, FileQueryInfoFlags rhs)
FileCreateFlags | operator| (FileCreateFlags lhs, FileCreateFlags rhs)
FileCreateFlags | operator& (FileCreateFlags lhs, FileCreateFlags rhs)
FileCreateFlags | operator^ (FileCreateFlags lhs, FileCreateFlags rhs)
FileCreateFlags | operator~ (FileCreateFlags flags)
FileCreateFlags& | operator|= (FileCreateFlags& lhs, FileCreateFlags rhs)
FileCreateFlags& | operator&= (FileCreateFlags& lhs, FileCreateFlags rhs)
FileCreateFlags& | operator^= (FileCreateFlags& lhs, FileCreateFlags rhs)
FileCopyFlags | operator| (FileCopyFlags lhs, FileCopyFlags rhs)
FileCopyFlags | operator& (FileCopyFlags lhs, FileCopyFlags rhs)
FileCopyFlags | operator^ (FileCopyFlags lhs, FileCopyFlags rhs)
FileCopyFlags | operator~ (FileCopyFlags flags)
FileCopyFlags& | operator|= (FileCopyFlags& lhs, FileCopyFlags rhs)
FileCopyFlags& | operator&= (FileCopyFlags& lhs, FileCopyFlags rhs)
FileCopyFlags& | operator^= (FileCopyFlags& lhs, FileCopyFlags rhs)
FileMonitorFlags | operator| (FileMonitorFlags lhs, FileMonitorFlags rhs)
FileMonitorFlags | operator& (FileMonitorFlags lhs, FileMonitorFlags rhs)
FileMonitorFlags | operator^ (FileMonitorFlags lhs, FileMonitorFlags rhs)
FileMonitorFlags | operator~ (FileMonitorFlags flags)
FileMonitorFlags& | operator|= (FileMonitorFlags& lhs, FileMonitorFlags rhs)
FileMonitorFlags& | operator&= (FileMonitorFlags& lhs, FileMonitorFlags rhs)
FileMonitorFlags& | operator^= (FileMonitorFlags& lhs, FileMonitorFlags rhs)
MountUnmountFlags | operator| (MountUnmountFlags lhs, MountUnmountFlags rhs)
MountUnmountFlags | operator& (MountUnmountFlags lhs, MountUnmountFlags rhs)
MountUnmountFlags | operator^ (MountUnmountFlags lhs, MountUnmountFlags rhs)
MountUnmountFlags | operator~ (MountUnmountFlags flags)
MountUnmountFlags& | operator|= (MountUnmountFlags& lhs, MountUnmountFlags rhs)
MountUnmountFlags& | operator&= (MountUnmountFlags& lhs, MountUnmountFlags rhs)
MountUnmountFlags& | operator^= (MountUnmountFlags& lhs, MountUnmountFlags rhs)
FileAttributeInfoFlags | operator| (FileAttributeInfoFlags lhs, FileAttributeInfoFlags rhs)
FileAttributeInfoFlags | operator& (FileAttributeInfoFlags lhs, FileAttributeInfoFlags rhs)
FileAttributeInfoFlags | operator^ (FileAttributeInfoFlags lhs, FileAttributeInfoFlags rhs)
FileAttributeInfoFlags | operator~ (FileAttributeInfoFlags flags)
FileAttributeInfoFlags& | operator|= (FileAttributeInfoFlags& lhs, FileAttributeInfoFlags rhs)
FileAttributeInfoFlags& | operator&= (FileAttributeInfoFlags& lhs, FileAttributeInfoFlags rhs)
FileAttributeInfoFlags& | operator^= (FileAttributeInfoFlags& lhs, FileAttributeInfoFlags rhs)
AskPasswordFlags | operator| (AskPasswordFlags lhs, AskPasswordFlags rhs)
AskPasswordFlags | operator& (AskPasswordFlags lhs, AskPasswordFlags rhs)
AskPasswordFlags | operator^ (AskPasswordFlags lhs, AskPasswordFlags rhs)
AskPasswordFlags | operator~ (AskPasswordFlags flags)
AskPasswordFlags& | operator|= (AskPasswordFlags& lhs, AskPasswordFlags rhs)
AskPasswordFlags& | operator&= (AskPasswordFlags& lhs, AskPasswordFlags rhs)
AskPasswordFlags& | operator^= (AskPasswordFlags& lhs, AskPasswordFlags rhs)
OutputStreamSpliceFlags | operator| (OutputStreamSpliceFlags lhs, OutputStreamSpliceFlags rhs)
OutputStreamSpliceFlags | operator& (OutputStreamSpliceFlags lhs, OutputStreamSpliceFlags rhs)
OutputStreamSpliceFlags | operator^ (OutputStreamSpliceFlags lhs, OutputStreamSpliceFlags rhs)
OutputStreamSpliceFlags | operator~ (OutputStreamSpliceFlags flags)
OutputStreamSpliceFlags& | operator|= (OutputStreamSpliceFlags& lhs, OutputStreamSpliceFlags rhs)
OutputStreamSpliceFlags& | operator&= (OutputStreamSpliceFlags& lhs, OutputStreamSpliceFlags rhs)
OutputStreamSpliceFlags& | operator^= (OutputStreamSpliceFlags& lhs, OutputStreamSpliceFlags rhs)
bool | content_type_equals (const Glib::ustring& type1, const Glib::ustring& type2)
| Compares two content types for equality.
bool | content_type_is_a (const Glib::ustring& type, const Glib::ustring& supertype)
| Determines if type is a subset of supertype.
bool | content_type_is_unknown (const Glib::ustring& type)
| Checks if the content type is the generic "unknown" type.
Glib::ustring | content_type_get_description (const Glib::ustring& type)
| Gets the human readable description of the content type.
Glib::ustring | content_type_get_mime_type (const Glib::ustring& type)
| Gets the mime-type for the content type.
Glib::RefPtr< Icon > | content_type_get_icon (const Glib::ustring& type)
bool | content_type_can_be_executable (const Glib::ustring& type)
| Checks if a content type can be executable.
Glib::ustring | content_type_from_mime_type (const Glib::ustring& mime_type)
| Tries to find a content type based on the mime type name.
Glib::ustring | 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 | content_type_guess (const std::string& filename, const std::string& data, bool& result_uncertain)
| Guesses the content type based on example data.
Glib::StringArrayHandle | 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 > | content_types_get_registered ()
| Gets a list of strings containing all the registered content types known to the system.
void | init ()
| Initialize giomm.

## Typedef Documentation

typedef Glib::ListHandle<Gio::SrvTarget, SrvTargetListTraits> Gio::ListHandle_SrvTarget

typedef sigc::slot<void, Glib::RefPtr<AsyncResult>& > Gio::SlotAsyncReady

A function that will be called when an asynchronous operation within GIO has been completed.

Parameters:

  | result | The asynchronous function's results.

For instance,

     void on_async_ready(Glib::RefPtr<AsyncResult>& result);

Since glibmm 2.16:

## Function Documentation

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

Parameters:

  | type | a content type string.

Returns:
  true if the file type corresponds to a type that can be executable, false otherwise.

bool Gio::content_type_equals | ( | const Glib::ustring& | type1,
|  | const Glib::ustring& | type2 |
| ) |  |  |

Compares two content types for equality.

Parameters:

  | type1 | A content type string.
  | type2 | A content type string.

Returns:
  true if the two strings are identical or equivalent, false otherwise.

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.

Parameters:

  | mime_type | a mime type string.

Returns:
  string with content type or empty when it does not know.

Since glibmm 2.20:

Glib::ustring Gio::content_type_get_description | ( | const Glib::ustring& | type | ) |

Gets the human readable description of the content type.

Parameters:

  | type | A content type string.

Returns:
  a short description of the content type type.

Glib::RefPtr<Icon> Gio::content_type_get_icon | ( | const Glib::ustring& | type | ) |

Parameters:

  | type | A content type string.

Gets the icon for a content type.

Returns:
  Icon corresponding to 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

Parameters:

  | type | A content type string.

Returns:
  the registered mime-type for the given type, or NULL if unknown.

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

Parameters:

  | filename | a string.
  | data | A stream of data.
  | result_uncertain | A flag indicating the certainty of the result.

Returns:
  A string indicating a guessed content type for the given data.

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

Parameters:

  | filename | a string.
  | data | A stream of data.
  | data_size | The size of data.
  | result_uncertain | A flag indicating the certainty of the result.

Returns:
  A string indicating a guessed content type for the given 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.

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 <ulink url="http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec">shared-mime-info</ulink> specification for more on x-content types.

Parameters:

  | root | The root of the tree to guess a type for.

Returns:
  List of zero or more content types.

Since glibmm 2.18:

bool Gio::content_type_is_a | ( | const Glib::ustring& | type,
|  | const Glib::ustring& | supertype |
| ) |  |  |

Determines if type is a subset of supertype.

Parameters:

  | type | A content type string.
  | supertype | A string.

Returns:
  true if type is a kind of supertype, false otherwise.

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 "*".

Parameters:

  | type | A content type string.

Returns:
  true if the type is the unknown type.

Glib::ListHandle<Glib::ustring> Gio::content_types_get_registered | ( |  | ) |

Gets a list of strings containing all the registered content types known to the system.

Returns:
  List of the registered content types.

void Gio::init | ( |  | ) |

Initialize giomm.