aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/backend/ebook
diff options
context:
space:
mode:
Diffstat (limited to 'addressbook/backend/ebook')
-rw-r--r--addressbook/backend/ebook/e-card.c18
-rw-r--r--addressbook/backend/ebook/e-card.h1
2 files changed, 19 insertions, 0 deletions
diff --git a/addressbook/backend/ebook/e-card.c b/addressbook/backend/ebook/e-card.c
index 3845ac8227..55b91e26d7 100644
--- a/addressbook/backend/ebook/e-card.c
+++ b/addressbook/backend/ebook/e-card.c
@@ -2013,6 +2013,24 @@ e_card_load_cards_from_file(const char *filename)
return list;
}
+GList *
+e_card_load_cards_from_string(const char *str)
+{
+ VObject *vobj = Parse_MIME(str, strlen (str));
+ GList *list = NULL;
+ while(vobj) {
+ VObject *next;
+ ECard *card = E_CARD(gtk_type_new(e_card_get_type()));
+ parse(card, vobj);
+ next = nextVObjectInList(vobj);
+ cleanVObject(vobj);
+ vobj = next;
+ list = g_list_prepend(list, card);
+ }
+ list = g_list_reverse(list);
+ return list;
+}
+
void
e_card_free_empty_lists (ECard *card)
{
diff --git a/addressbook/backend/ebook/e-card.h b/addressbook/backend/ebook/e-card.h
index 3714324081..ae0ab3c1ef 100644
--- a/addressbook/backend/ebook/e-card.h
+++ b/addressbook/backend/ebook/e-card.h
@@ -154,6 +154,7 @@ gboolean e_card_email_match_string (const ECard
/* Specialized functionality */
GList *e_card_load_cards_from_file (const char *filename);
+GList *e_card_load_cards_from_string (const char *str);
void e_card_free_empty_lists (ECard *card);
enum _ECardDisposition {