1
/* Copyright 2016 Software Freedom Conservancy Inc.
3
* This software is licensed under the GNU Lesser General Public License
4
* (version 2.1 or later). See the COPYING file in this distribution.
8
* A generic IMAP message or mailbox flag.
10
* In IMAP, message and mailbox flags have similar syntax, which is encapsulated here.
13
* @see MailboxAttribute
16
public abstract class Geary.Imap.Flag : BaseObject, Gee.Hashable<Geary.Imap.Flag> {
17
public string value { get; private set; }
20
* Constructs a new flag.
22
* The given keyword must be an IMAP atom.
24
protected Flag(string name) {
28
public bool is_system() {
29
return value[0] == '\\';
32
public bool equals_string(string value) {
33
return Ascii.stri_equal(this.value, value);
36
public bool equal_to(Geary.Imap.Flag flag) {
37
return (flag == this) ? true : flag.equals_string(value);
41
* Returns the {@link Flag} as an appropriate {@link Parameter}.
43
public StringParameter to_parameter() throws ImapError {
44
return new UnquotedStringParameter(value);
48
return Ascii.stri_hash(value);
51
public string to_string() {