/[debian]/mimetic/branches/upstream/current/mimetic/contenttype.h
ViewVC logotype

Contents of /mimetic/branches/upstream/current/mimetic/contenttype.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 128 - (show annotations)
Sat Feb 25 16:49:20 2006 UTC (15 years, 5 months ago) by gregoa
File MIME type: text/plain
File size: 2289 byte(s)
[svn-inject] Installing original source of mimetic
1 /***************************************************************************
2 copyright : (C) 2002-2005 by Stefano Barbato
3 email : stefano@codesink.org
4
5 $Id: contenttype.h,v 1.12 2005/02/23 10:26:14 tat Exp $
6 ***************************************************************************/
7
8 /***************************************************************************
9 * *
10 * This program is free software; you can redistribute it and/or modify *
11 * it under the terms of the GNU General Public License as published by *
12 * the Free Software Foundation; either version 2 of the License, or *
13 * (at your option) any later version. *
14 * *
15 ***************************************************************************/
16 #ifndef _MIMETIC_CONTENT_TYPE_H_
17 #define _MIMETIC_CONTENT_TYPE_H_
18 #include <string>
19 #include <mimetic/strutils.h>
20 #include <mimetic/rfc822/fieldvalue.h>
21 #include <mimetic/fieldparam.h>
22
23 namespace mimetic
24 {
25
26 /// Content-Type field value
27 class ContentType: public FieldValue
28 {
29 public:
30 static const char label[];
31 struct Boundary
32 {
33 Boundary();
34 operator const std::string&() const;
35 private:
36 std::string m_boundary;
37 static std::string ms_common_boundary;
38 static int ms_i;
39 };
40 typedef FieldParam Param;
41 typedef FieldParamList ParamList;
42 public:
43 ContentType();
44 ContentType(const char*);
45 ContentType(const std::string&);
46 ContentType(const std::string&, const std::string&);
47
48 void set(const std::string&);
49 void set(const std::string&, const std::string&);
50
51 bool isMultipart() const;
52
53 const istring& type() const;
54 void type(const std::string&);
55
56 void subtype(const std::string&);
57 const istring& subtype() const;
58
59 const ParamList& paramList() const;
60 ParamList& paramList();
61
62 const std::string& param(const std::string&) const;
63 void param(const std::string&, const std::string&);
64
65 std::string str() const;
66 protected:
67 FieldValue* clone() const;
68 private:
69 istring m_type, m_subtype;
70 ParamList m_paramList;
71 };
72
73 }
74
75 #endif

  ViewVC Help
Powered by ViewVC 1.1.26