mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 06:27:45 +00:00
LibIMAP: Clean up Parser.h a bit
Move members after methods, remove useless parameter names ('x', 's'), more sensible method grouping.
This commit is contained in:
parent
8c05b4e137
commit
8e8d1383b7
1 changed files with 39 additions and 46 deletions
|
@ -23,57 +23,50 @@ public:
|
||||||
ParseStatus parse(ByteBuffer&& buffer, bool expecting_tag);
|
ParseStatus parse(ByteBuffer&& buffer, bool expecting_tag);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
static MailboxFlag parse_mailbox_flag(StringView);
|
||||||
|
|
||||||
|
void consume(StringView);
|
||||||
|
bool try_consume(StringView);
|
||||||
|
StringView consume_while(Function<bool(u8)> should_consume);
|
||||||
|
|
||||||
|
bool at_end() { return position >= m_buffer.size(); };
|
||||||
|
|
||||||
|
unsigned parse_number();
|
||||||
|
Optional<unsigned> try_parse_number();
|
||||||
|
|
||||||
|
void parse_response_done();
|
||||||
|
void parse_untagged();
|
||||||
|
void parse_capability_response();
|
||||||
|
|
||||||
|
StringView parse_atom();
|
||||||
|
StringView parse_quoted_string();
|
||||||
|
StringView parse_literal_string();
|
||||||
|
StringView parse_string();
|
||||||
|
StringView parse_astring();
|
||||||
|
Optional<StringView> parse_nstring();
|
||||||
|
|
||||||
|
ResponseStatus parse_status();
|
||||||
|
ListItem parse_list_item();
|
||||||
|
FetchCommand::DataItem parse_fetch_data_item();
|
||||||
|
FetchResponseData parse_fetch_response();
|
||||||
|
Optional<Vector<Address>> parse_address_list();
|
||||||
|
Address parse_address();
|
||||||
|
HashMap<String, String> parse_body_fields_params();
|
||||||
|
BodyStructure parse_body_structure();
|
||||||
|
BodyStructure parse_one_part_body();
|
||||||
|
BodyExtension parse_body_extension();
|
||||||
|
Tuple<String, HashMap<String, String>> parse_disposition();
|
||||||
|
Vector<String> parse_langs();
|
||||||
|
Envelope parse_envelope();
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
Vector<T> parse_list(T (*converter)(StringView));
|
||||||
|
|
||||||
// To retain state if parsing is not finished
|
// To retain state if parsing is not finished
|
||||||
ByteBuffer m_buffer;
|
ByteBuffer m_buffer;
|
||||||
SolidResponse m_response;
|
SolidResponse m_response;
|
||||||
unsigned position { 0 };
|
unsigned position { 0 };
|
||||||
bool m_incomplete { false };
|
bool m_incomplete { false };
|
||||||
bool m_parsing_failed { false };
|
bool m_parsing_failed { false };
|
||||||
|
|
||||||
bool try_consume(StringView);
|
|
||||||
bool at_end() { return position >= m_buffer.size(); };
|
|
||||||
|
|
||||||
void parse_response_done();
|
|
||||||
|
|
||||||
void consume(StringView x);
|
|
||||||
StringView consume_while(Function<bool(u8)> should_consume);
|
|
||||||
|
|
||||||
unsigned parse_number();
|
|
||||||
Optional<unsigned> try_parse_number();
|
|
||||||
|
|
||||||
void parse_untagged();
|
|
||||||
|
|
||||||
StringView parse_atom();
|
|
||||||
StringView parse_quoted_string();
|
|
||||||
StringView parse_string();
|
|
||||||
Optional<StringView> parse_nstring();
|
|
||||||
|
|
||||||
ResponseStatus parse_status();
|
|
||||||
|
|
||||||
template<typename T>
|
|
||||||
Vector<T> parse_list(T (*converter)(StringView));
|
|
||||||
|
|
||||||
static MailboxFlag parse_mailbox_flag(StringView s);
|
|
||||||
|
|
||||||
|
|
||||||
void parse_capability_response();
|
|
||||||
|
|
||||||
ListItem parse_list_item();
|
|
||||||
|
|
||||||
FetchCommand::DataItem parse_fetch_data_item();
|
|
||||||
|
|
||||||
FetchResponseData parse_fetch_response();
|
|
||||||
|
|
||||||
StringView parse_literal_string();
|
|
||||||
Optional<Vector<Address>> parse_address_list();
|
|
||||||
Address parse_address();
|
|
||||||
StringView parse_astring();
|
|
||||||
HashMap<String, String> parse_body_fields_params();
|
|
||||||
BodyStructure parse_body_structure();
|
|
||||||
BodyStructure parse_one_part_body();
|
|
||||||
Tuple<String, HashMap<String, String>> parse_disposition();
|
|
||||||
Vector<String> parse_langs();
|
|
||||||
BodyExtension parse_body_extension();
|
|
||||||
Envelope parse_envelope();
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue