aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-mime-part.c
diff options
context:
space:
mode:
authorbertrand <Bertrand.Guiheneuf@inria.fr>1999-06-22 22:19:24 +0800
committerBertrand Guiheneuf <bertrand@src.gnome.org>1999-06-22 22:19:24 +0800
commit5deed2f193e7ab91f159f1a764b78578861044cd (patch)
tree78830536944b4a030673a5cb43339aaef65e1112 /camel/camel-mime-part.c
parent4f689d0fb8e33e91fec8b8e0471d48f1e6993622 (diff)
downloadgsoc2013-evolution-5deed2f193e7ab91f159f1a764b78578861044cd.tar.gz
gsoc2013-evolution-5deed2f193e7ab91f159f1a764b78578861044cd.tar.zst
gsoc2013-evolution-5deed2f193e7ab91f159f1a764b78578861044cd.zip
new function, returns "type/subtype" mime type string.
* camel/gmime-content-field.c (gmime_content_field_get_mime_type): new function, returns "type/subtype" mime type string. (gmime_content_field_construct_from_string): new function, construbt a content_field object form a string. be used to set the mime_type from a string. * camel/camel-mime-part.c (_set_content_type): (camel_mime_part_set_content_type): (_get_content_type): (_get_content_type): new methods. 1999-06-21 bertrand <Bertrand.Guiheneuf@inria.fr> * camel/gmime-utils.c (get_header_table_from_stream): replace CR/LF+'\t' with ' ' * camel/camel-mime-message.c (_set_recipient_list_from_string): trim \t when splitting * camel/gmime-utils.c (get_header_table_from_file): corrected bug in scanning tabulations ('t' -> '\t') * tests/test2.c (main): read mail.test instead of mail1.test * camel/camel-mime-part.c (_add_header): added comments svn path=/trunk/; revision=984
Diffstat (limited to 'camel/camel-mime-part.c')
-rw-r--r--camel/camel-mime-part.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/camel/camel-mime-part.c b/camel/camel-mime-part.c
index 2d294b6b8b..489e6d0d27 100644
--- a/camel/camel-mime-part.c
+++ b/camel/camel-mime-part.c
@@ -68,6 +68,8 @@ static void _set_content_languages (CamelMimePart *mime_part, GList *content_lan
static GList *_get_content_languages (CamelMimePart *mime_part);
static void _set_header_lines (CamelMimePart *mime_part, GList *header_lines);
static GList *_get_header_lines (CamelMimePart *mime_part);
+static void _set_content_type (CamelMimePart *mime_part, GString *content_type);
+static GString *_get_content_type (CamelMimePart *mime_part);
static CamelDataWrapper *_get_content_object(CamelMimePart *mime_part);
static void _write_to_stream (CamelDataWrapper *data_wrapper, CamelStream *stream);
@@ -120,6 +122,8 @@ camel_mime_part_class_init (CamelMimePartClass *camel_mime_part_class)
camel_mime_part_class->get_header_lines=_get_header_lines;
camel_mime_part_class->parse_header_pair = _parse_header_pair;
camel_mime_part_class->get_content_object = _get_content_object;
+ camel_mime_part_class->set_content_type = _set_content_type;
+ camel_mime_part_class->get_content_type = _get_content_type;
@@ -133,6 +137,7 @@ camel_mime_part_init (gpointer object, gpointer klass)
CamelMimePart *camel_mime_part = CAMEL_MIME_PART (object);
camel_mime_part->headers = g_hash_table_new (g_string_hash, g_string_equal_for_hash);
+ camel_mime_part->content_type_field = gmime_content_field_new (NULL, NULL);
}
@@ -491,6 +496,38 @@ camel_mime_part_get_content_object(CamelMimePart *mime_part)
return CMP_CLASS(mime_part)->get_content_object (mime_part);
}
+
+static void
+_set_content_type (CamelMimePart *mime_part, GString *content_type)
+{
+ g_assert (content_type);
+ gmime_content_field_construct_from_string (mime_part->content_type_field, content_type);
+}
+
+void
+camel_mime_part_set_content_type (CamelMimePart *mime_part, GString *content_type)
+{
+ CMP_CLASS(mime_part)->set_content_type (mime_part, content_type);
+}
+
+static GString *
+_get_content_type (CamelMimePart *mime_part)
+{
+ GString *mime_type;
+
+ mime_type = gmime_content_field_get_mime_type (mime_part->content_type_field);
+ return mime_type;
+}
+
+static GString *
+camel_mime_part_get_content_type (CamelMimePart *mime_part)
+{
+ return CMP_CLASS(mime_part)->get_content_type (mime_part);
+}
+
+
+
+/**********************************************************************/
#ifdef WHPT
#warning : WHPT is already defined !!!!!!
#endif