glibmm: Gio::FileMonitor Class Reference
Monitors a file or directory for changes. More...
#include <giomm/filemonitor.h>

Public Member Functions | |
| virtual | ~FileMonitor () |
| GFileMonitor* | gobj () |
| Provides access to the underlying C GObject. | |
| const GFileMonitor* | gobj () const |
| Provides access to the underlying C GObject. | |
| GFileMonitor* | gobj_copy () |
| Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. | |
| bool | cancel () |
| Cancels a file monitor. | |
| bool | is_cancelled () const |
| Returns whether the monitor is canceled. | |
| void | set_rate_limit (int limit_msecs) |
| Sets the rate limit to which the monitor will report consecutive change events to the same file. | |
| Glib::SignalProxy3< void, const Glib::RefPtr< File > &, const Glib::RefPtr< File > &, FileMonitorEvent > | signal_changed () |
| Glib::PropertyProxy< int > | property_rate_limit () |
| The limit of the monitor to watch for changes, in milliseconds. | |
| Glib::PropertyProxy_ReadOnly< int > | property_rate_limit () const |
| The limit of the monitor to watch for changes, in milliseconds. | |
| Glib::PropertyProxy_ReadOnly < bool > | property_cancelled () const |
| Whether the monitor has been cancelled. | |
Protected Member Functions | |
| virtual void | on_changed (const Glib::RefPtr< File >& file, const Glib::RefPtr< File >& other_file, FileMonitorEvent event_type) |
| This is a default handler for the signal signal_changed(). | |
Related Functions | |
(Note that these are not member functions.) | |
| Glib::RefPtr< Gio::FileMonitor > | wrap (GFileMonitor* object, bool take_copy=false) |
| A Glib::wrap() method for this object. | |
Detailed Description
Monitors a file or directory for changes.
To obtain a FileMonitor for a file or directory, use File::monitor_file() or File::monitor_directory().
To get informed about changes to the file or directory you are monitoring, connect to signal_changed().
Constructor & Destructor Documentation
| virtual Gio::FileMonitor::~FileMonitor | ( | ) | [virtual] |
Member Function Documentation
| bool Gio::FileMonitor::cancel | ( | ) |
Cancels a file monitor.
- Returns:
trueif monitor was cancelled.
| GFileMonitor* Gio::FileMonitor::gobj | ( | ) | [inline] |
Provides access to the underlying C GObject.
Reimplemented from Glib::ObjectBase.
| const GFileMonitor* Gio::FileMonitor::gobj | ( | ) | const [inline] |
Provides access to the underlying C GObject.
Reimplemented from Glib::ObjectBase.
| GFileMonitor* Gio::FileMonitor::gobj_copy | ( | ) |
Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
| bool Gio::FileMonitor::is_cancelled | ( | ) | const |
Returns whether the monitor is canceled.
- Returns:
trueif monitor is canceled.falseotherwise.
| virtual void Gio::FileMonitor::on_changed | ( | const Glib::RefPtr< File >& | file, |
| const Glib::RefPtr< File >& | other_file, | ||
| FileMonitorEvent | event_type | ||
| ) | [protected, virtual] |
This is a default handler for the signal signal_changed().
| Glib::PropertyProxy_ReadOnly< bool > Gio::FileMonitor::property_cancelled | ( | ) | const |
Whether the monitor has been cancelled.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
- Returns:
- A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.
The limit of the monitor to watch for changes, in milliseconds.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
- Returns:
- A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.
| Glib::PropertyProxy_ReadOnly< int > Gio::FileMonitor::property_rate_limit | ( | ) | const |
The limit of the monitor to watch for changes, in milliseconds.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
- Returns:
- A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.
| void Gio::FileMonitor::set_rate_limit | ( | int | limit_msecs | ) |
Sets the rate limit to which the monitor will report consecutive change events to the same file.
- Parameters:
-
limit_msecs A non-negative integer with the limit in milliseconds to poll for changes.
| Glib::SignalProxy3< void,const Glib::RefPtr<File>&,const Glib::RefPtr<File>&,FileMonitorEvent > Gio::FileMonitor::signal_changed | ( | ) |
- Slot Prototype:
void on_my_changed(const Glib::RefPtr<File>& file, const Glib::RefPtr<File>& other_file, FileMonitorEvent event_type)
Emitted when file has been changed.
If using FILE_MONITOR_SEND_MOVED flag and event_type is FILE_MONITOR_SEND_MOVED, file will be set to a File containing the old path, and other_file will be set to a File containing the new path.
In all the other cases, other_file will be set to #0.
Friends And Related Function Documentation
| Glib::RefPtr< Gio::FileMonitor > wrap | ( | GFileMonitor * | object, |
| bool | take_copy = false |
||
| ) | [related] |
A Glib::wrap() method for this object.
- Parameters:
-
object The C instance. take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
- Returns:
- A C++ instance that wraps this C instance.
