RetroShare/retroshare-nogui/src/TerminalApiClient.h
electron128 8fc3917c4b webui:
- added profile import/creation
- fixed leaking file descriptors
- added upload handler for small files
- fixed terminal thread
- removed some unused parameter warnings

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@8485 b45a01b8-16f6-495d-af2f-9b41ad6348cc
2015-06-16 12:35:07 +00:00

28 lines
810 B
C++

#pragma once
#include <api/ApiServer.h>
#include <util/rsthreads.h>
namespace resource_api {
// allows basic control from stdin/stdout
// - account selection
// - login
// - shutdown
class TerminalApiClient: private RsTickingThread{
public:
// zero setup: create an instance of this class and destroy it when not needed anymore
// no need to call start or stop or something
// parameter api must not be null
TerminalApiClient(ApiServer* api);
~TerminalApiClient();
protected:
// from RsThread
virtual void data_tick(); /* called once the thread is started. Should be overloaded by subclasses. */
private:
void waitForResponse(ApiServer::RequestId id);
bool isTokenValid(StateToken st);
ApiServer* mApiServer;
};
} // namespace resource_api