43 #include "imapparser.h"
45 #include <kimap/rfccodecs.h>
49 imapList::imapList (): parser_(0), noInferiors_ (false),
50 noSelect_ (false), marked_ (false), unmarked_ (false),
51 hasChildren_ (false), hasNoChildren_ (false)
55 imapList::imapList (
const imapList & lr):parser_(lr.parser_),
56 hierarchyDelimiter_ (lr.hierarchyDelimiter_),
58 noInferiors_ (lr.noInferiors_),
59 noSelect_ (lr.noSelect_), marked_ (lr.marked_), unmarked_ (lr.unmarked_),
60 hasChildren_ (lr.hasChildren_), hasNoChildren_ (lr.hasNoChildren_),
61 attributes_ (lr.attributes_)
65 imapList & imapList::operator = (
const imapList & lr)
73 hierarchyDelimiter_ = lr.hierarchyDelimiter_;
75 noInferiors_ = lr.noInferiors_;
76 noSelect_ = lr.noSelect_;
78 unmarked_ = lr.unmarked_;
79 hasChildren_ = lr.hasChildren_;
80 hasNoChildren_ = lr.hasNoChildren_;
81 attributes_ = lr.attributes_;
86 imapList::imapList (
const QString & inStr, imapParser &parser)
90 marked_ (false), unmarked_ (false), hasChildren_ (false),
91 hasNoChildren_ (false)
102 parseAttributes( s );
105 parser_->skipWS( s );
108 if ( hierarchyDelimiter_ ==
"NIL" ) {
109 hierarchyDelimiter_.
clear();
111 name_ =
QString::fromUtf8( KIMAP::decodeImapFolderName( parser_->parseLiteral( s ) ) );
114 void imapList::parseAttributes(
parseString & str )
117 while ( !str.isEmpty() && str[0] !=
')' ) {
121 if ( attribute.
contains(
"\\noinferiors" ) ) {
123 }
else if ( attribute.
contains(
"\\noselect" ) ) {
125 }
else if ( attribute.
contains(
"\\marked" ) ) {
127 }
else if ( attribute.
contains(
"\\unmarked" ) ) {
129 }
else if ( attribute.
contains(
"\\haschildren" ) ) {
131 }
else if ( attribute.
contains(
"\\hasnochildren" ) ) {
132 hasNoChildren_ =
true;
134 kDebug( 7116 ) <<
"imapList::imapList: bogus attribute" << attribute;
a string used during parsing the string allows you to move the effective start of the string using st...
QString fromUtf8(const char *str, int size)
bool contains(QChar ch, Qt::CaseSensitivity cs) const
QByteArray toLatin1() const
QString fromLatin1(const char *str, int size)