GMime.HeaderList¶
- Subclasses:
 None
Methods¶
- Inherited:
 - Structs:
 
class  | 
  | 
  | 
|
  | 
|
  | 
|
  | 
|
  | 
|
  | 
|
  | 
|
  | 
|
  | 
|
  | 
|
  | 
|
  | 
Virtual Methods¶
- Inherited:
 
Properties¶
None
Signals¶
- Inherited:
 
Fields¶
- Inherited:
 
Name  | 
Type  | 
Access  | 
Description  | 
|---|---|---|---|
array  | 
[  | 
r  | 
|
changed  | 
r  | 
||
hash  | 
r  | 
||
options  | 
r  | 
||
parent_object  | 
r  | 
Class Details¶
- class GMime.HeaderList(**kwargs)¶
 - Bases:
 - Abstract:
 No
- Structure:
 
A list of message or mime-part headers.
- classmethod new(options)¶
 - Parameters:
 options (
GMime.ParserOptionsorNone) – aGMime.ParserOptionsorNone- Returns:
 a new header list object.
- Return type:
 
Creates a new
GMime.HeaderListobject.
- append(name, value, charset)¶
 - 
Appends a header. If value is
None, a space will be set aside for it (useful for setting the order of headers before values can be obtained for them) otherwise the header will be unset. 
- clear()¶
 Removes all of the headers from the
GMime.HeaderList.
- contains(name)¶
 - Parameters:
 name (
str) – header name- Returns:
 - Return type:
 
Checks whether or not a header exists.
- get_count()¶
 - Returns:
 the number of headers in the header list.
- Return type:
 
Gets the number of headers contained within the header list.
- get_header(name)¶
 - Parameters:
 name (
str) – header name- Returns:
 a
GMime.Headerfor the specified name.- Return type:
 
Gets the first header with the specified name.
- get_header_at(index)¶
 - Parameters:
 index (
int) – the 0-based index of the header- Returns:
 the header at position index.
- Return type:
 
Gets the header at the specified index within the list.
- prepend(name, value, charset)¶
 - 
Prepends a header. If value is
None, a space will be set aside for it (useful for setting the order of headers before values can be obtained for them) otherwise the header will be unset. 
- remove(name)¶
 - Parameters:
 name (
str) – header name- Returns:
 Trueif the header was successfully removed orFalseif the specified header could not be found.- Return type:
 
Remove the first instance of the specified header.
- remove_at(index)¶
 - Parameters:
 index (
int) – the 0-based index of the header to remove
Removes the header at the specified index from self.
- set(name, value, charset)¶
 - 
Set the value of the specified header. If value is
Noneand the header, name, had not been previously set, a space will be set aside for it (useful for setting the order of headers before values can be obtained for them) otherwise the header will be unset.Note: If there are multiple headers with the specified field name, the first instance of the header will be replaced and further instances will be removed.
 
- to_string(options)¶
 - Parameters:
 options (
GMime.FormatOptionsorNone) – aGMime.FormatOptionsorNone- Returns:
 a string containing the header block.
- Return type:
 
Allocates a string buffer containing the raw rfc822 headers contained in self.
- write_to_stream(options, stream)¶
 - Parameters:
 options (
GMime.FormatOptionsorNone) – aGMime.FormatOptionsorNonestream (
GMime.Stream) – output stream
- Returns:
 the number of bytes written or %-1 on fail.
- Return type:
 
Write the headers to a stream.