Function

EBookContactsPhoneNumberfrom_string

since: 3.8

Declaration [src]

EPhoneNumber*
e_phone_number_from_string (
  const gchar* phone_number,
  const gchar* region_code,
  GError** error
)

Description [src]

Parses the string passed in phone_number. Note that no validation is performed whether the recognized phone number is valid for a particular region.

The two-letter country code passed in region_code only is used if the phone_number is not written in international format. The application’s default region as returned by e_phone_number_get_default_region() is used if region_code is NULL.

If the number is guaranteed to start with a ‘+’ followed by the country calling code, then “ZZ” can be passed for region_code.

Available since: 3.8

Parameters

phone_number

Type: const gchar*

The phone number to parse.

The data is owned by the caller of the function.
The value is a NUL terminated UTF-8 string.
region_code

Type: const gchar*

A two-letter country code, or NULL.

The argument can be NULL.
The data is owned by the caller of the function.
The value is a NUL terminated UTF-8 string.
error

Type: GError **

The return location for a recoverable error.

The argument can be NULL.
If the return location is not NULL, then you must initialize it to a NULL GError*.
The argument will be left initialized to NULL by the function if there are no errors.
In case of error, the argument will be set to a newly allocated GError; the caller will take ownership of the data, and be responsible for freeing it.

Return value

Type: EPhoneNumber

A new EPhoneNumber instance on success, or NULL on error. Call e_phone_number_free() to release this instance.

The caller of the function takes ownership of the data, and is responsible for freeing it.