added structures for generic turtle search and access functions in Gxs objects

This commit is contained in:
csoler 2018-06-06 23:15:29 +02:00
parent b5c1b8210b
commit 7caf06b57d
No known key found for this signature in database
GPG key ID: 7BCA522266C0804C
31 changed files with 513 additions and 262 deletions

View file

@ -32,6 +32,7 @@
#include <string>
#include "rstypes.h"
#include "rsturtle.h"
class RsFiles;
extern RsFiles *rsFiles;
@ -213,6 +214,8 @@ class RsFiles
virtual uint32_t getMaxUploadSlotsPerFriend()=0;
virtual void setFilePermDirectDL(uint32_t perm)=0;
virtual uint32_t filePermDirectDL()=0;
virtual TurtleRequestId turtleSearch(const std::string& string_to_match) =0;
virtual TurtleRequestId turtleSearch(const RsRegularExpression::LinearizedExpression& expr) =0;
/***
* Control of Downloads Priority.

View file

@ -96,6 +96,9 @@ virtual bool getPostData(const uint32_t &token, std::vector<RsGxsChannelPost> &p
//virtual bool createComment(uint32_t &token, RsGxsComment &comment) = 0;
//virtual bool createVote(uint32_t &token, RsGxsVote &vote) = 0;
virtual void turtleGroupRequest(const RsGxsGroupId& group_id)=0;
virtual void turtleSearchRequest(const std::string& match_string)=0;
//////////////////////////////////////////////////////////////////////////////
virtual void setMessageReadStatus(uint32_t& token, const RsGxsGrpMsgIdPair& msgId, bool read) = 0;

View file

@ -228,7 +228,8 @@ class NotifyClient
virtual void notifyCustomState (const std::string& /* peer_id */, const std::string& /* status_string */) {}
virtual void notifyHashingInfo (uint32_t /* type */, const std::string& /* fileinfo */) {}
virtual void notifyTurtleSearchResult (uint32_t /* search_id */, const std::list<TurtleFileInfo>& /* files */) {}
virtual void notifyTurtleSearchResult (uint32_t /* search_id */, const std::list<TurtleGxsInfo >& /* groups */) {}
#warning MISSING CODE HERE
// virtual void notifyTurtleSearchResult (uint32_t /* search_id */, const std::list<TurtleGxsInfo >& /* groups */) {}
virtual void notifyPeerHasNewAvatar (std::string /* peer_id */) {}
virtual void notifyOwnAvatarChanged () {}
virtual void notifyOwnStatusMessageChanged () {}

View file

@ -54,13 +54,7 @@ struct TurtleFileInfo
std::string name ;
uint64_t size ;
};
struct TurtleGxsInfo
{
RsGxsGroupId group_id ;
uint16_t service_id ;
std::string name ;
//RsTlvBinaryData meta ;// is that actually needed? Not sure. Better if it's not.
};
struct TurtleTunnelRequestDisplayInfo
{
uint32_t request_id ; // Id of the request
@ -118,8 +112,7 @@ class RsTurtle
// the request id, which will be further used by the gui to store results
// as they come back.
//
virtual TurtleRequestId turtleSearch(const std::string& match_string) = 0 ;
virtual TurtleRequestId turtleSearch(const RsRegularExpression::LinearizedExpression& expr) = 0 ;
virtual TurtleRequestId turtleSearch(unsigned char *search_bin_data,uint32_t search_bin_data_len,RsTurtleClientService *client_service) =0;
// Initiates tunnel handling for the given file hash. tunnels. Launches
// an exception if an error occurs during the initialization process. The