aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/backend/ebook/e-card.c
diff options
context:
space:
mode:
Diffstat (limited to 'addressbook/backend/ebook/e-card.c')
-rw-r--r--addressbook/backend/ebook/e-card.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/addressbook/backend/ebook/e-card.c b/addressbook/backend/ebook/e-card.c
index eea5c16dc1..2f0f05b97f 100644
--- a/addressbook/backend/ebook/e-card.c
+++ b/addressbook/backend/ebook/e-card.c
@@ -17,6 +17,7 @@
#include <libversit/vcc.h>
#include "e-card.h"
#include "e-card-pairs.h"
+#include "e-name-western.h"
#define is_a_prop_of(obj,prop) (isAPropertyOf ((obj),(prop)))
#define str_val(obj) (the_str = (vObjectValueType (obj))? fakeCString (vObjectUStringZValue (obj)) : calloc (1, 1))
@@ -994,6 +995,23 @@ e_card_name_to_string(const ECardName *name)
return g_strjoinv(" ", strings);
}
+ECardName *
+e_card_name_from_string(const char *full_name)
+{
+ ECardName *name = g_new(ECardName, 1);
+ ENameWestern *western = e_name_western_parse (full_name);
+
+ name->prefix = g_strdup (western->prefix);
+ name->given = g_strdup (western->first );
+ name->additional = g_strdup (western->middle);
+ name->family = g_strdup (western->last );
+ name->suffix = g_strdup (western->suffix);
+
+ e_name_western_free(western);
+
+ return name;
+}
+
/*
* ECard lifecycle management and vCard loading/saving.
*/