## CamelAddress CamelAddress |

## Synopsis

    struct              CamelAddress;
    CamelAddress *      camel_address_new                   (void);
    CamelAddress *      camel_address_new_clone             (const CamelAddress *addr);
    int                 camel_address_length                (CamelAddress *addr);
    int                 camel_address_decode                (CamelAddress *addr,
                                                             const char *raw);
    char *              camel_address_encode                (CamelAddress *addr);
    int                 camel_address_unformat              (CamelAddress *addr,
                                                             const char *raw);
    char *              camel_address_format                (CamelAddress *addr);
    int                 camel_address_cat                   (CamelAddress *dest,
                                                             const CamelAddress *source);
    int                 camel_address_copy                  (CamelAddress *dest,
                                                             const CamelAddress *source);
    void                camel_address_remove                (CamelAddress *addr,
                                                             int index);

## Description

## Details

### struct CamelAddress

    struct CamelAddress {
    	CamelObject parent;

    	GPtrArray *addresses;

    	struct _CamelAddressPrivate *priv;
    };

### camel_address_new ()

    CamelAddress *      camel_address_new                   (void);

Create a new CamelAddress object.

Returns : | a new CamelAddress object

### camel_address_new_clone ()

    CamelAddress *      camel_address_new_clone             (const CamelAddress *addr);

Clone an existing address type.

`addr` : | a CamelAddress object
Returns : | the cloned address

### camel_address_length ()

    int                 camel_address_length                (CamelAddress *addr);

Get the number of addresses stored in the address `addr`.

`addr` : | a CamelAddress object
Returns : | the number of addresses contained in `addr`

### camel_address_decode ()

    int                 camel_address_decode                (CamelAddress *addr,
                                                             const char *raw);

Construct a new address from a raw address field.

`addr` : | a CamelAddress object
`raw` : | raw address description
Returns : | the number of addresses parsed or `-1` on fail

### camel_address_encode ()

    char *              camel_address_encode                (CamelAddress *addr);

Encode an address in a format suitable for a raw header.

`addr` : | a CamelAddress object
Returns : | the encoded address

### camel_address_unformat ()

    int                 camel_address_unformat              (CamelAddress *addr,
                                                             const char *raw);

Attempt to convert a previously formatted and/or edited address back into internal form.

`addr` : | a CamelAddress object
`raw` : | raw address description
Returns : | the number of addresses parsed or `-1` on fail

### camel_address_format ()

    char *              camel_address_format                (CamelAddress *addr);

Format an address in a format suitable for display.

`addr` : | a CamelAddress object
Returns : | a newly allocated string containing the formatted addresses

### camel_address_cat ()

    int                 camel_address_cat                   (CamelAddress *dest,
                                                             const CamelAddress *source);

Concatenate one address onto another. The addresses must be of the same type.

`dest` : | destination CamelAddress object
`source` : | source CamelAddress object
Returns : | the number of addresses concatenated

### camel_address_copy ()

    int                 camel_address_copy                  (CamelAddress *dest,
                                                             const CamelAddress *source);

Copy the contents of one address into another.

`dest` : | destination CamelAddress object
`source` : | source CamelAddress object
Returns : | the number of addresses copied

### camel_address_remove ()

    void                camel_address_remove                (CamelAddress *addr,
                                                             int index);

Remove an address by index, or all addresses.

`addr` : | a CamelAddress object
`index` : | The address to remove, use `-1` to remove all address.