NAME

Text::vCard::Precisely::V4 - Read, Write and Edit vCards 4.0

SYNOPSIS

You can unlock types that will be available in vCard 4.0

my $vc = Text::vCard::Precisely->new( version => '4.0' );
# Or you can write like below:
#my $vc = Text::vCard::Precisely::V4->new();

The Usage is same with Text::vCard::Precisely::V3

DESCRIPTION

This module is an additional version for reading/writing for vCard 4.0. it's just a wrapper of Text::vCard::Precisely::V3 with Moose.

Caution! It's NOT be recommended because some reasons below:

  • Mac OS X and iOS can't parse vCard4.0 with UTF-8 precisely.

  • Android 4.4.x can't parse vCard4.0.

Note that the vCard RFC requires FN type. And this module does not check or warn if these conditions have not been met.

Constructors

load_hashref($HashRef)

SAME as 3.0

loadfile($filename)

SAME as 3.0

load_string($vCard)

SAME as 3.0

METHODS

as_string()

Returns the vCard as a string. You HAVE TO use encode_utf8() if your vCard is written in utf8

as_file($filename)

Write data in vCard format to $filename.

Dies if not successful.

SIMPLE GETTERS/SETTERS

These methods accept and return strings.

version()

Returns Version number of the vcard. Defaults to '3.0'

It is READONLY method. So you can NOT downgrade it to 3.0

rev()

To specify revision information about the current vCard

The format in as_string() is different from 3.0, but the interface is SAME

COMPLEX GETTERS/SETTERS

They are based on Moose with coercion

So these methods accept not only ArrayRef[HashRef] but also ArrayRef[Str], single HashRef or single Str

Read source if you were confused

n()

The format is SAME as 3.0

tel()

The format in as_string() is different from 3.0, but the interface is SAME

adr(), address()

Both are same method with Alias

LABEL param and GEO param are now available

email()

The format is SAME as 3.0

url()

The format is SAME as 3.0

photo(), logo()

The format is SAME as 3.0

note()

The format is SAME as 3.0

org(), title(), role(), categories()

The format is SAME as 3.0

fn(), full_name(), fullname()

They are same method at all with Alias

The format is SAME as 3.0

nickname()

The format is SAME as 3.0

lang()

To specify the language(s) that may be used for contacting the entity associated with the vCard

It's the new method in 4.0

impp(), xml()

I don't think they are so popular paramater, but here are the methods!

They are the new method in 4.0

geo(), key()

The format is SAME as 3.0

source(), sound()

The formats are SAME as 3.0

fburl(), caladruri(), caluri()

I don't think they are so popular types, but here are the methods!

They are the new method in 4.0

kind()

To specify the kind of object the vCard represents

It's the new method in 4.0

member(), clientpidmap()

I don't think they are so popular types, but here are the methods!

It's the new method in 4.0

tz(), timezone()

Both are same method with Alias

The format is SAME as 3.0

bday(), birthday()

Both are same method with Alias

The format is SAME as 3.0

anniversary()

The date of marriage, or equivalent, of the object the vCard represents

It's the new method in 4.0

gender()

To specify the components of the sex and gender identity of the object the vCard represents

It's the new method in 4.0

prodid()

The format is SAME as 3.0

DEPRECATED Methods

They're DEPRECATED in 4.0

sort_string()

Use SORT-AS param instead of it

label()

Use LABEL param in ADR instead of it

class(), name(), profile(), mailer()

There is no method for these, just warn if you use them

agent()

Use AGENT param in RELATED instead of it

aroud UTF-8

If you want to send precisely the vCard with UTF-8 characters to the ALMOST of smartphones, Use 3.0

It seems to be TOO EARLY to use 4.0

for under perl-5.12.5

This module uses \P{ascii} in regexp so You have to use 5.12.5 and later

And this module uses Data::Validate::URI and it has bug on 5.8.x. so I can't support them

SEE ALSO

AUTHOR

Yuki Yoshida(worthmine)

LICENSE

This is free software; you can redistribute it and/or modify it under the same terms as Perl.