GnuCash  5.6-150-g038405b370+
Macros | Functions
gnc-uri-utils.h File Reference

Utility functions for convert uri in separate components and back. More...

#include "platform.h"

Go to the source code of this file.

Macros

#define GNC_DATAFILE_EXT   ".gnucash"
 
#define GNC_LOGFILE_EXT   ".log"
 

Functions

gboolean gnc_uri_is_uri (const gchar *uri)
 Checks if the given uri is a valid uri. More...
 
void gnc_uri_get_components (const gchar *uri, gchar **scheme, gchar **hostname, gint32 *port, gchar **username, gchar **password, gchar **path)
 Converts a uri in separate components. More...
 
gchar * gnc_uri_get_scheme (const gchar *uri)
 Extracts the scheme from a uri. More...
 
gchar * gnc_uri_get_path (const gchar *uri)
 Extracts the path part from a uri. More...
 
gchar * gnc_uri_create_uri (const gchar *scheme, const gchar *hostname, gint32 port, const gchar *username, const gchar *password, const gchar *path)
 Composes a normalized uri starting from its separate components. More...
 
gchar * gnc_uri_normalize_uri (const gchar *uri, gboolean allow_password)
 Composes a normalized uri starting from any uri (filename, db spec,...). More...
 
gboolean gnc_uri_is_known_scheme (const gchar *scheme)
 Checks if there is a backend that explicitly stated to handle the given scheme. More...
 
gboolean gnc_uri_is_file_scheme (const gchar *scheme)
 Checks if the given scheme is used to refer to a file (as opposed to a network service like a database or web url) More...
 
gboolean gnc_uri_is_file_uri (const gchar *uri)
 Checks if the given uri defines a file (as opposed to a network service like a database or web url) More...
 
gboolean gnc_uri_targets_local_fs (const gchar *uri)
 Checks if the given uri is either a valid file uri or a local filesystem path. More...
 
gchar * gnc_uri_add_extension (const gchar *uri, const gchar *extension)
 Adds an extension to the uri if: More...
 

Detailed Description

Utility functions for convert uri in separate components and back.

Author
Copyright (C) 2010 Geert Janssens janss.nosp@m.ens-.nosp@m.geert.nosp@m.@tel.nosp@m.enet..nosp@m.be

These functions help you convert a uri into its separate components (being scheme, host name, port, user name, password and path) or to compose a uri from these separate components.

For GnuCash' purposes a full uri can be described as:

Anything in square brackets is optional.

While not strictly uris this function will also accept input in the form of a local file system path for convenience:

The local path will then be considered as the path component of a uri where appropriate. In case of conversion from a file system path to a uri the relative paths will be converted to absolute paths as uris don't allow relative paths.

Definition in file gnc-uri-utils.h.