mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-11-24 09:43:18 -05:00
Expose /rsFiles/turtleSearchRequest via JSON API
Expose new async C++ API RsFiles::turtleSearchRequest with callback Modernize TurtleFileInfo serialization code keeping retrocompatibility
This commit is contained in:
parent
a8b2532d3b
commit
c50405c070
5 changed files with 107 additions and 66 deletions
|
|
@ -24,6 +24,8 @@
|
|||
#include <list>
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include <functional>
|
||||
#include <chrono>
|
||||
|
||||
#include "rstypes.h"
|
||||
#include "serialiser/rsserializable.h"
|
||||
|
|
@ -315,8 +317,24 @@ public:
|
|||
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;
|
||||
|
||||
/**
|
||||
* @brief Request remote files search
|
||||
* @jsonapi{development}
|
||||
* @param[in] matchString string to look for in the search
|
||||
* @param multiCallback function that will be called each time a search
|
||||
* result is received
|
||||
* @param[in] maxWait maximum wait time in seconds for search results
|
||||
* @return false on error, true otherwise
|
||||
*/
|
||||
virtual bool turtleSearchRequest(
|
||||
const std::string& matchString,
|
||||
const std::function<void (const std::list<TurtleFileInfo>& results)>& multiCallback,
|
||||
std::time_t maxWait = 300 ) = 0;
|
||||
|
||||
virtual TurtleRequestId turtleSearch(const std::string& string_to_match) = 0;
|
||||
virtual TurtleRequestId turtleSearch(
|
||||
const RsRegularExpression::LinearizedExpression& expr) = 0;
|
||||
|
||||
/***
|
||||
* Control of Downloads Priority.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue