1.2 <GBookmarkFile>

Structure: <GBookmarkFile>

<GBookmarkFile> lets you parse, edit or create files containing bookmarks.

Bookmarks refer to a URI, along with some meta-data about the resource pointed by the URI like its MIME type, the application that is registering the bookmark and the icon that should be used to represent the bookmark. The data is stored using the Desktop Bookmark Specification.

The syntax of the bookmark files is described in detail inside the Desktop Bookmark Specification, here is a quick summary: bookmark files use a sub-class of the XML Bookmark Exchange Language specification, consisting of valid UTF-8 encoded XML, under the <xbel> root element; each bookmark is stored inside a <bookmark> element, using its URI: no relative paths can be used inside a bookmark file. The bookmark may have a user defined title and description, to be used instead of the URI. Under the <metadata> element, with its owner attribute set to http://freedesktop.org, is stored the meta-data about a resource pointed by its URI. The meta-data consists of the resource’s MIME type; the applications that have registered a bookmark; the groups to which a bookmark belongs to; a visibility flag, used to set the bookmark as "private" to the applications and groups that has it registered; the URI and MIME type of an icon, to be used when displaying the bookmark inside a GUI.

Here is an example of a bookmark file: bookmarks.xbel

A bookmark file might contain more than one bookmark; each bookmark is accessed through its URI.

The important caveat of bookmark files is that when you add a new bookmark you must also add the application that is registering it, using bookmark-file:add-application or bookmark-file:set-application-info?. If a bookmark has no applications then it won’t be dumped when creating the on disk representation, using bookmark-file:to-data or bookmark-file:to-file?.

Procedures

Method: bookmark-file:add-application self uri [name] [exec]
Method: add-application self uri [name] [exec]

Adds the application with name and exec to the list of applications that have registered a bookmark for uri into self.

Every bookmark inside a <GBookmarkFile> must have at least an application registered. Each application must provide a name, a command line useful for launching the bookmark, the number of times the bookmark has been registered by the application and the last time the application registered this bookmark.

If name is #f, the name of the application will be the same returned by get-application-name; if exec is #f, the command line will be a composition of the program name as returned by get-prgname and the "\%u" modifier, which will be expanded to the bookmark’s URI.

This function will automatically take care of updating the registrations count and timestamping in case an application with the same name had already registered a bookmark for uri inside self.

If no bookmark for uri is found, one is created.

self

Passed: a <GBookmarkFile>.

a <GBookmarkFile>

uri

Passed: a string.

a valid URI

name

Passed, or left out: a string, or #f.

the name of the application registering the bookmark or #f

exec

Passed, or left out: a string, or #f.

command line to be used to launch the bookmark or #f

Method: bookmark-file:add-group self uri group
Method: add-group self uri group

Adds group to the list of groups to which the bookmark for uri belongs to.

If no bookmark for uri is found then it is created.

self

Passed: a <GBookmarkFile>.

a <GBookmarkFile>

uri

Passed: a string.

a valid URI

group

Passed: a string.

the group name to be added

Method: bookmark-file:copy self ⇒ %return
Method: copy self ⇒ %return

Deeply copies a self <GBookmarkFile> object to a new one.

self

Passed: a <GBookmarkFile>.

A <GBookmarkFile>

%return

Returned: a <GBookmarkFile>.

the copy of self. Use g_bookmark_free() when finished using it.

Procedure: bookmark-file:error-quark ⇒ %return
%return

Returned: an unsigned 32-bit integer.

Method: bookmark-file:free self
Method: free self

Frees a <GBookmarkFile>.

self

Passed: a <GBookmarkFile>.

a <GBookmarkFile>

Method: bookmark-file:get-added self uri ⇒ %return
Method: get-added self uri ⇒ %return

Gets the time the bookmark for uri was added to self

In the event the URI cannot be found, -1 is returned and error is set to uri-not-found.

self

Passed: a <GBookmarkFile>.

a <GBookmarkFile>

uri

Passed: a string.

a valid URI

%return

Returned: a 64-bit integer.

a timestamp

Method: bookmark-file:get-added-date-time self uri ⇒ %return
Method: get-added-date-time self uri ⇒ %return

Gets the time the bookmark for uri was added to self

In the event the URI cannot be found, #f is returned and error is set to uri-not-found.

self

Passed: a <GBookmarkFile>.

a <GBookmarkFile>

uri

Passed: a string.

a valid URI

%return

Returned: a <GDateTime>.

a <GDateTime>

Method: bookmark-file:get-app-info self uri name ⇒ %return exec count stamp
Method: get-app-info self uri name ⇒ %return exec count stamp

Gets the registration information of app-name for the bookmark for uri. See bookmark-file:set-application-info? for more information about the returned data.

The string returned in app-exec must be freed.

In the event the URI cannot be found, #f is returned and error is set to uri-not-found. In the event that no application with name app-name has registered a bookmark for uri, #f is returned and error is set to app-not-registered. In the event that unquoting the command line fails, an error of the G_SHELL_ERROR domain is set and #f is returned.

self

Passed: a <GBookmarkFile>.

a <GBookmarkFile>

uri

Passed: a string.

a valid URI

name

Passed: a string.

an application’s name

%return

Returned: a boolean.

#t on success.

exec

Returned: a string.

return location for the command line of the application, or #f

count

Returned: an unsigned 32-bit integer.

return location for the registration count, or #f

stamp

Returned: a 64-bit integer.

return location for the last registration time, or #f

Method: bookmark-file:get-application-info self uri name ⇒ %return exec count stamp
Method: get-application-info self uri name ⇒ %return exec count stamp

Gets the registration information of app-name for the bookmark for uri. See bookmark-file:set-application-info? for more information about the returned data.

The string returned in app-exec must be freed.

In the event the URI cannot be found, #f is returned and error is set to uri-not-found. In the event that no application with name app-name has registered a bookmark for uri, #f is returned and error is set to app-not-registered. In the event that unquoting the command line fails, an error of the G_SHELL_ERROR domain is set and #f is returned.

self

Passed: a <GBookmarkFile>.

a <GBookmarkFile>

uri

Passed: a string.

a valid URI

name

Passed: a string.

an application’s name

%return

Returned: a boolean.

#t on success.

exec

Returned: a string.

return location for the command line of the application, or #f

count

Returned: an unsigned 32-bit integer.

return location for the registration count, or #f

stamp

Returned: a <GDateTime>.

return location for the last registration time, or #f

Method: bookmark-file:get-applications self uri ⇒ %return
Method: get-applications self uri ⇒ %return

Retrieves the names of the applications that have registered the bookmark for uri.

In the event the URI cannot be found, #f is returned and error is set to uri-not-found.

self

Passed: a <GBookmarkFile>.

a <GBookmarkFile>

uri

Passed: a string.

a valid URI

%return

Returned: a vector, each a string.

a newly allocated #f-terminated array of strings. Use strfreev to free it.

length

Not returned: it is the length of %return.

return location of the length of the returned list, or #f

Method: bookmark-file:get-description self uri ⇒ %return
Method: get-description self uri ⇒ %return

Retrieves the description of the bookmark for uri.

In the event the URI cannot be found, #f is returned and error is set to uri-not-found.

self

Passed: a <GBookmarkFile>.

a <GBookmarkFile>

uri

Passed: a string.

a valid URI

%return

Returned: a string.

a newly allocated string or #f if the specified URI cannot be found.

Method: bookmark-file:get-groups self uri ⇒ %return
Method: get-groups self uri ⇒ %return

Retrieves the list of group names of the bookmark for uri.

In the event the URI cannot be found, #f is returned and error is set to uri-not-found.

The returned array is #f terminated, so length may optionally be #f.

self

Passed: a <GBookmarkFile>.

a <GBookmarkFile>

uri

Passed: a string.

a valid URI

%return

Returned: a vector, each a string.

a newly allocated #f-terminated array of group names. Use strfreev to free it.

length

Not returned: it is the length of %return.

return location for the length of the returned string, or #f

Method: bookmark-file:get-icon self uri ⇒ %return href mime-type
Method: get-icon self uri ⇒ %return href mime-type

Gets the icon of the bookmark for uri.

In the event the URI cannot be found, #f is returned and error is set to uri-not-found.

self

Passed: a <GBookmarkFile>.

a <GBookmarkFile>

uri

Passed: a string.

a valid URI

%return

Returned: a boolean.

#t if the icon for the bookmark for the URI was found. You should free the returned strings.

href

Returned: a string.

return location for the icon’s location or #f

mime-type

Returned: a string.

return location for the icon’s MIME type or #f

Method: bookmark-file:get-is-private? self uri ⇒ %return
Method: get-is-private? self uri ⇒ %return

Gets whether the private flag of the bookmark for uri is set.

In the event the URI cannot be found, #f is returned and error is set to uri-not-found. In the event that the private flag cannot be found, #f is returned and error is set to invalid-value.

self

Passed: a <GBookmarkFile>.

a <GBookmarkFile>

uri

Passed: a string.

a valid URI

%return

Returned: a boolean.

#t if the private flag is set, #f otherwise.

Method: bookmark-file:get-mime-type self uri ⇒ %return
Method: get-mime-type self uri ⇒ %return

Retrieves the MIME type of the resource pointed by uri.

In the event the URI cannot be found, #f is returned and error is set to uri-not-found. In the event that the MIME type cannot be found, #f is returned and error is set to invalid-value.

self

Passed: a <GBookmarkFile>.

a <GBookmarkFile>

uri

Passed: a string.

a valid URI

%return

Returned: a string.

a newly allocated string or #f if the specified URI cannot be found.

Method: bookmark-file:get-modified self uri ⇒ %return
Method: get-modified self uri ⇒ %return

Gets the time when the bookmark for uri was last modified.

In the event the URI cannot be found, -1 is returned and error is set to uri-not-found.

self

Passed: a <GBookmarkFile>.

a <GBookmarkFile>

uri

Passed: a string.

a valid URI

%return

Returned: a 64-bit integer.

a timestamp

Method: bookmark-file:get-modified-date-time self uri ⇒ %return
Method: get-modified-date-time self uri ⇒ %return

Gets the time when the bookmark for uri was last modified.

In the event the URI cannot be found, #f is returned and error is set to uri-not-found.

self

Passed: a <GBookmarkFile>.

a <GBookmarkFile>

uri

Passed: a string.

a valid URI

%return

Returned: a <GDateTime>.

a <GDateTime>

Method: bookmark-file:get-size self ⇒ %return
Method: get-size self ⇒ %return

Gets the number of bookmarks inside self.

self

Passed: a <GBookmarkFile>.

a <GBookmarkFile>

%return

Returned: a 32-bit integer.

the number of bookmarks

Method: bookmark-file:get-title self [uri] ⇒ %return
Method: get-title self [uri] ⇒ %return

Returns the title of the bookmark for uri.

If uri is #f, the title of self is returned.

In the event the URI cannot be found, #f is returned and error is set to uri-not-found.

self

Passed: a <GBookmarkFile>.

a <GBookmarkFile>

uri

Passed, or left out: a string, or #f.

a valid URI or #f

%return

Returned: a string.

a newly allocated string or #f if the specified URI cannot be found.

Method: bookmark-file:get-uris self ⇒ %return
Method: get-uris self ⇒ %return

Returns all URIs of the bookmarks in the bookmark file self. The array of returned URIs will be #f-terminated, so length may optionally be #f.

self

Passed: a <GBookmarkFile>.

a <GBookmarkFile>

%return

Returned: a vector, each a string.

a newly allocated #f-terminated array of strings. Use strfreev to free it.

length

Not returned: it is the length of %return.

return location for the number of returned URIs, or #f

Method: bookmark-file:get-visited self uri ⇒ %return
Method: get-visited self uri ⇒ %return

Gets the time the bookmark for uri was last visited.

In the event the URI cannot be found, -1 is returned and error is set to uri-not-found.

self

Passed: a <GBookmarkFile>.

a <GBookmarkFile>

uri

Passed: a string.

a valid URI

%return

Returned: a 64-bit integer.

a timestamp.

Method: bookmark-file:get-visited-date-time self uri ⇒ %return
Method: get-visited-date-time self uri ⇒ %return

Gets the time the bookmark for uri was last visited.

In the event the URI cannot be found, #f is returned and error is set to uri-not-found.

self

Passed: a <GBookmarkFile>.

a <GBookmarkFile>

uri

Passed: a string.

a valid URI

%return

Returned: a <GDateTime>.

a <GDateTime>

Method: bookmark-file:has-application? self uri name ⇒ %return
Method: has-application? self uri name ⇒ %return

Checks whether the bookmark for uri inside self has been registered by application name.

In the event the URI cannot be found, #f is returned and error is set to uri-not-found.

self

Passed: a <GBookmarkFile>.

a <GBookmarkFile>

uri

Passed: a string.

a valid URI

name

Passed: a string.

the name of the application

%return

Returned: a boolean.

#t if the application name was found

Method: bookmark-file:has-group? self uri group ⇒ %return
Method: has-group? self uri group ⇒ %return

Checks whether group appears in the list of groups to which the bookmark for uri belongs to.

In the event the URI cannot be found, #f is returned and error is set to uri-not-found.

self

Passed: a <GBookmarkFile>.

a <GBookmarkFile>

uri

Passed: a string.

a valid URI

group

Passed: a string.

the group name to be searched

%return

Returned: a boolean.

#t if group was found.

Method: bookmark-file:has-item? self uri ⇒ %return
Method: has-item? self uri ⇒ %return

Looks whether the desktop bookmark has an item with its URI set to uri.

self

Passed: a <GBookmarkFile>.

a <GBookmarkFile>

uri

Passed: a string.

a valid URI

%return

Returned: a boolean.

#t if uri is inside self, #f otherwise

Method: bookmark-file:load-from-data-dirs self file ⇒ %return full-path
Method: load-from-data-dirs self file ⇒ %return full-path

This function looks for a desktop bookmark file named file in the paths returned from get-user-data-dir and get-system-data-dirs, loads the file into self and returns the file’s full path in full-path. If the file could not be loaded then error is set to either a <%GFileError> or <%GBookmarkFileError>.

self

Passed: a <GBookmarkFile>.

a <GBookmarkFile>

file

Passed: a file name, as a string.

a relative path to a filename to open and parse

%return

Returned: a boolean.

#t if a key file could be loaded, #f otherwise

full-path

Returned: a file name, as a string.

return location for a string containing the full path of the file, or #f

Method: bookmark-file:load-from-data? self data ⇒ %return
Method: load-from-data? self data ⇒ %return

Loads a bookmark file from memory into an empty <GBookmarkFile> structure. If the object cannot be created then error is set to a <%GBookmarkFileError>.

self

Passed: a <GBookmarkFile>.

an empty <GBookmarkFile> struct

data

Passed: a bytevector, or a list or vector, each an unsigned 8-bit integer.

desktop bookmarks loaded in memory

%return

Returned: a boolean.

#t if a desktop bookmark could be loaded.

length

Not passed: guile-gi gives the length of data.

the length of data in bytes

Method: bookmark-file:load-from-file? self filename ⇒ %return
Method: load-from-file? self filename ⇒ %return

Loads a desktop bookmark file into an empty <GBookmarkFile> structure. If the file could not be loaded then error is set to either a <%GFileError> or <%GBookmarkFileError>.

self

Passed: a <GBookmarkFile>.

an empty <GBookmarkFile> struct

filename

Passed: a file name, as a string.

the path of a filename to load, in the GLib file name encoding

%return

Returned: a boolean.

#t if a desktop bookmark file could be loaded

Method: bookmark-file:move-item? self old-uri [new-uri] ⇒ %return
Method: move-item? self old-uri [new-uri] ⇒ %return

Changes the URI of a bookmark item from old-uri to new-uri. Any existing bookmark for new-uri will be overwritten. If new-uri is #f, then the bookmark is removed.

In the event the URI cannot be found, #f is returned and error is set to uri-not-found.

self

Passed: a <GBookmarkFile>.

a <GBookmarkFile>

old-uri

Passed: a string.

a valid URI

new-uri

Passed, or left out: a string, or #f.

a valid URI, or #f

%return

Returned: a boolean.

#t if the URI was successfully changed

Procedure: bookmark-file:new ⇒ %return

Creates a new empty <GBookmarkFile> object.

Use bookmark-file:load-from-file?, bookmark-file:load-from-data? or bookmark-file:load-from-data-dirs to read an existing bookmark file.

%return

Returned: a <GBookmarkFile>.

an empty <GBookmarkFile>

Method: bookmark-file:remove-application? self uri name ⇒ %return
Method: remove-application? self uri name ⇒ %return

Removes application registered with name from the list of applications that have registered a bookmark for uri inside self.

In the event the URI cannot be found, #f is returned and error is set to uri-not-found. In the event that no application with name app-name has registered a bookmark for uri, #f is returned and error is set to app-not-registered.

self

Passed: a <GBookmarkFile>.

a <GBookmarkFile>

uri

Passed: a string.

a valid URI

name

Passed: a string.

the name of the application

%return

Returned: a boolean.

#t if the application was successfully removed.

Method: bookmark-file:remove-group? self uri group ⇒ %return
Method: remove-group? self uri group ⇒ %return

Removes group from the list of groups to which the bookmark for uri belongs to.

In the event the URI cannot be found, #f is returned and error is set to uri-not-found. In the event no group was defined, #f is returned and error is set to invalid-value.

self

Passed: a <GBookmarkFile>.

a <GBookmarkFile>

uri

Passed: a string.

a valid URI

group

Passed: a string.

the group name to be removed

%return

Returned: a boolean.

#t if group was successfully removed.

Method: bookmark-file:remove-item? self uri ⇒ %return
Method: remove-item? self uri ⇒ %return

Removes the bookmark for uri from the bookmark file self.

self

Passed: a <GBookmarkFile>.

a <GBookmarkFile>

uri

Passed: a string.

a valid URI

%return

Returned: a boolean.

#t if the bookmark was removed successfully.

Method: bookmark-file:set-added self uri added
Method: set-added self uri added

Sets the time the bookmark for uri was added into self.

If no bookmark for uri is found then it is created.

self

Passed: a <GBookmarkFile>.

a <GBookmarkFile>

uri

Passed: a string.

a valid URI

added

Passed: a 64-bit integer.

a timestamp or -1 to use the current time

Method: bookmark-file:set-added-date-time self uri added
Method: set-added-date-time self uri added

Sets the time the bookmark for uri was added into self.

If no bookmark for uri is found then it is created.

self

Passed: a <GBookmarkFile>.

a <GBookmarkFile>

uri

Passed: a string.

a valid URI

added

Passed: a <GDateTime>.

a <GDateTime>

Method: bookmark-file:set-app-info? self uri name exec count stamp ⇒ %return
Method: set-app-info? self uri name exec count stamp ⇒ %return

Sets the meta-data of application name inside the list of applications that have registered a bookmark for uri inside self.

You should rarely use this function; use bookmark-file:add-application and bookmark-file:remove-application? instead.

name can be any UTF-8 encoded string used to identify an application. exec can have one of these two modifiers: "\%f", which will be expanded as the local file name retrieved from the bookmark’s URI; "\%u", which will be expanded as the bookmark’s URI. The expansion is done automatically when retrieving the stored command line using the bookmark-file:get-application-info function. count is the number of times the application has registered the bookmark; if is < 0, the current registration count will be increased by one, if is 0, the application with name will be removed from the list of registered applications. stamp is the Unix time of the last registration; if it is -1, the current time will be used.

If you try to remove an application by setting its registration count to zero, and no bookmark for uri is found, #f is returned and error is set to uri-not-found; similarly, in the event that no application name has registered a bookmark for uri, #f is returned and error is set to app-not-registered. Otherwise, if no bookmark for uri is found, one is created.

self

Passed: a <GBookmarkFile>.

a <GBookmarkFile>

uri

Passed: a string.

a valid URI

name

Passed: a string.

an application’s name

exec

Passed: a string.

an application’s command line

count

Passed: a 32-bit integer.

the number of registrations done for this application

stamp

Passed: a 64-bit integer.

the time of the last registration for this application

%return

Returned: a boolean.

#t if the application’s meta-data was successfully changed.

Method: bookmark-file:set-application-info? self uri name exec count [stamp] ⇒ %return
Method: set-application-info? self uri name exec count [stamp] ⇒ %return

Sets the meta-data of application name inside the list of applications that have registered a bookmark for uri inside self.

You should rarely use this function; use bookmark-file:add-application and bookmark-file:remove-application? instead.

name can be any UTF-8 encoded string used to identify an application. exec can have one of these two modifiers: "\%f", which will be expanded as the local file name retrieved from the bookmark’s URI; "\%u", which will be expanded as the bookmark’s URI. The expansion is done automatically when retrieving the stored command line using the bookmark-file:get-application-info function. count is the number of times the application has registered the bookmark; if is < 0, the current registration count will be increased by one, if is 0, the application with name will be removed from the list of registered applications. stamp is the Unix time of the last registration.

If you try to remove an application by setting its registration count to zero, and no bookmark for uri is found, #f is returned and error is set to uri-not-found; similarly, in the event that no application name has registered a bookmark for uri, #f is returned and error is set to app-not-registered. Otherwise, if no bookmark for uri is found, one is created.

self

Passed: a <GBookmarkFile>.

a <GBookmarkFile>

uri

Passed: a string.

a valid URI

name

Passed: a string.

an application’s name

exec

Passed: a string.

an application’s command line

count

Passed: a 32-bit integer.

the number of registrations done for this application

stamp

Passed, or left out: a <GDateTime>, or #f.

the time of the last registration for this application, which may be #f if count is 0

%return

Returned: a boolean.

#t if the application’s meta-data was successfully changed.

Method: bookmark-file:set-description self uri description
Method: set-description self uri description

Sets description as the description of the bookmark for uri.

If uri is #f, the description of self is set.

If a bookmark for uri cannot be found then it is created.

self

Passed: a <GBookmarkFile>.

a <GBookmarkFile>

uri

Passed: a string, or #f.

a valid URI or #f

description

Passed: a string.

a string

Method: bookmark-file:set-groups self uri groups
Method: set-groups self uri groups

Sets a list of group names for the item with URI uri. Each previously set group name list is removed.

If uri cannot be found then an item for it is created.

self

Passed: a <GBookmarkFile>.

a <GBookmarkFile>

uri

Passed: a string.

an item’s URI

groups

Passed: a list or vector, each a string, or #f.

an array of group names, or #f to remove all groups

length

Not passed: guile-gi gives the length of groups.

number of group name values in groups

Method: bookmark-file:set-icon self uri href mime-type
Method: set-icon self uri href mime-type

Sets the icon for the bookmark for uri. If href is #f, unsets the currently set icon. href can either be a full URL for the icon file or the icon name following the Icon Naming specification.

If no bookmark for uri is found one is created.

self

Passed: a <GBookmarkFile>.

a <GBookmarkFile>

uri

Passed: a string.

a valid URI

href

Passed: a string, or #f.

the URI of the icon for the bookmark, or #f

mime-type

Passed: a string.

the MIME type of the icon for the bookmark

Method: bookmark-file:set-is-private self uri is-private
Method: set-is-private self uri is-private

Sets the private flag of the bookmark for uri.

If a bookmark for uri cannot be found then it is created.

self

Passed: a <GBookmarkFile>.

a <GBookmarkFile>

uri

Passed: a string.

a valid URI

is-private

Passed: a boolean.

#t if the bookmark should be marked as private

Method: bookmark-file:set-mime-type self uri mime-type
Method: set-mime-type self uri mime-type

Sets mime-type as the MIME type of the bookmark for uri.

If a bookmark for uri cannot be found then it is created.

self

Passed: a <GBookmarkFile>.

a <GBookmarkFile>

uri

Passed: a string.

a valid URI

mime-type

Passed: a string.

a MIME type

Method: bookmark-file:set-modified self uri modified
Method: set-modified self uri modified

Sets the last time the bookmark for uri was last modified.

If no bookmark for uri is found then it is created.

The "modified" time should only be set when the bookmark’s meta-data was actually changed. Every function of <GBookmarkFile> that modifies a bookmark also changes the modification time, except for bookmark-file:set-visited-date-time.

self

Passed: a <GBookmarkFile>.

a <GBookmarkFile>

uri

Passed: a string.

a valid URI

modified

Passed: a 64-bit integer.

a timestamp or -1 to use the current time

Method: bookmark-file:set-modified-date-time self uri modified
Method: set-modified-date-time self uri modified

Sets the last time the bookmark for uri was last modified.

If no bookmark for uri is found then it is created.

The "modified" time should only be set when the bookmark’s meta-data was actually changed. Every function of <GBookmarkFile> that modifies a bookmark also changes the modification time, except for bookmark-file:set-visited-date-time.

self

Passed: a <GBookmarkFile>.

a <GBookmarkFile>

uri

Passed: a string.

a valid URI

modified

Passed: a <GDateTime>.

a <GDateTime>

Method: bookmark-file:set-title self uri title
Method: set-title self uri title

Sets title as the title of the bookmark for uri inside the bookmark file self.

If uri is #f, the title of self is set.

If a bookmark for uri cannot be found then it is created.

self

Passed: a <GBookmarkFile>.

a <GBookmarkFile>

uri

Passed: a string, or #f.

a valid URI or #f

title

Passed: a string.

a UTF-8 encoded string

Method: bookmark-file:set-visited self uri visited
Method: set-visited self uri visited

Sets the time the bookmark for uri was last visited.

If no bookmark for uri is found then it is created.

The "visited" time should only be set if the bookmark was launched, either using the command line retrieved by bookmark-file:get-application-info or by the default application for the bookmark’s MIME type, retrieved using bookmark-file:get-mime-type. Changing the "visited" time does not affect the "modified" time.

self

Passed: a <GBookmarkFile>.

a <GBookmarkFile>

uri

Passed: a string.

a valid URI

visited

Passed: a 64-bit integer.

a timestamp or -1 to use the current time

Method: bookmark-file:set-visited-date-time self uri visited
Method: set-visited-date-time self uri visited

Sets the time the bookmark for uri was last visited.

If no bookmark for uri is found then it is created.

The "visited" time should only be set if the bookmark was launched, either using the command line retrieved by bookmark-file:get-application-info or by the default application for the bookmark’s MIME type, retrieved using bookmark-file:get-mime-type. Changing the "visited" time does not affect the "modified" time.

self

Passed: a <GBookmarkFile>.

a <GBookmarkFile>

uri

Passed: a string.

a valid URI

visited

Passed: a <GDateTime>.

a <GDateTime>

Method: bookmark-file:to-data self ⇒ %return
Method: to-data self ⇒ %return

This function outputs self as a string.

self

Passed: a <GBookmarkFile>.

a <GBookmarkFile>

%return

Returned: a bytevector.

a newly allocated string holding the contents of the <GBookmarkFile>

length

Not returned: it is the length of %return.

return location for the length of the returned string, or #f

Method: bookmark-file:to-file? self filename ⇒ %return
Method: to-file? self filename ⇒ %return

This function outputs self into a file. The write process is guaranteed to be atomic by using file-set-contents? internally.

self

Passed: a <GBookmarkFile>.

a <GBookmarkFile>

filename

Passed: a file name, as a string.

path of the output file

%return

Returned: a boolean.

#t if the file was successfully written.