mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-12 13:12:32 +00:00
* Added some missing includes.
* Changed more key bindings in ElementDownloadList to commands. git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1038 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
+11
-3
@@ -38,6 +38,7 @@
|
||||
#define RTORRENT_RPC_PARSE_H
|
||||
|
||||
#include <string>
|
||||
#include <cctype>
|
||||
#include <torrent/object.h>
|
||||
|
||||
namespace rpc {
|
||||
@@ -54,8 +55,15 @@ inline bool parse_is_escape(const char c) { return c == '\\'; }
|
||||
inline bool parse_is_seperator(const char c) { return c == ','; }
|
||||
inline bool parse_is_space(const char c) { return c == ' ' || c == '\t'; }
|
||||
|
||||
// The block delim is used in {} blocks to contain code. Since it
|
||||
// doesn't check for isspace, it will include useless characters but
|
||||
// that is the price for sane syntax.
|
||||
|
||||
inline bool parse_is_delim_default(const char c) { return parse_is_seperator(c) || std::isspace(c); }
|
||||
inline bool parse_is_delim_list(const char c) { return parse_is_seperator(c) || c == '}' || std::isspace(c); }
|
||||
inline bool parse_is_delim_command(const char c) { return parse_is_seperator(c) || c == ';' || std::isspace(c); }
|
||||
// inline bool parse_is_delim_block(const char c) { return c == ';' || c == '}'; }
|
||||
inline bool parse_is_delim_block(const char c) { return parse_is_seperator(c) || c == '}'; }
|
||||
|
||||
const char* parse_skip_wspace(const char* first);
|
||||
const char* parse_skip_wspace(const char* first, const char* last);
|
||||
@@ -69,9 +77,9 @@ const char* parse_value_nothrow(const char* src, int64_t* value, int base = 0, i
|
||||
void parse_whole_value(const char* src, int64_t* value, int base = 0, int unit = 1);
|
||||
bool parse_whole_value_nothrow(const char* src, int64_t* value, int base = 0, int unit = 1);
|
||||
|
||||
const char* parse_object(const char* first, const char* last, torrent::Object* dest, bool (*delim)(const char) = &parse_is_delim_default);
|
||||
const char* parse_list(const char* first, const char* last, torrent::Object* dest, bool (*delim)(const char) = &parse_is_delim_default);
|
||||
const char* parse_whole_list(const char* first, const char* last, torrent::Object* dest);
|
||||
const char* parse_object (const char* first, const char* last, torrent::Object* dest, bool (*delim)(const char) = &parse_is_delim_default);
|
||||
const char* parse_list (const char* first, const char* last, torrent::Object* dest, bool (*delim)(const char) = &parse_is_delim_default);
|
||||
const char* parse_whole_list(const char* first, const char* last, torrent::Object* dest, bool (*delim)(const char) = &parse_is_delim_default);
|
||||
|
||||
std::string convert_list_to_string(const torrent::Object& src);
|
||||
std::string convert_list_to_string(torrent::Object::list_const_iterator first, torrent::Object::list_const_iterator last);
|
||||
|
||||
Reference in New Issue
Block a user