rpcupdate.h 793 Bytes
Newer Older
Ashot's avatar
Ashot committed
1
2
3
4
5
6
7
8
9
10
// Copyright (c) 2014-2018 The Crown developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#ifndef RPC_UPDATE_H
#define RPC_UPDATE_H 

#include "updater.h"
#include "json/json_spirit_utils.h"
#include "json/json_spirit_value.h"
Ashot's avatar
Ashot committed
11
12
#include <boost/filesystem.hpp>

Ashot's avatar
Ashot committed
13
14
15
class RPCUpdate
{
public:
Ashot's avatar
Ashot committed
16
    bool Download();
Ashot's avatar
Ashot committed
17
18
19
20
21
    void Install();
    bool IsStarted() const;
    Object GetStatusObject() const;
    static void ProgressFunction(curl_off_t now, curl_off_t total);

Ashot's avatar
Ashot committed
22
23
24
25
private:
    bool CheckSha(const std::string& fileName) const;
    std::string GetArchivePath() const;

Ashot's avatar
Ashot committed
26
27
28
private:
    static Object statusObj;
    static bool started;
29
    boost::filesystem::path tempDir;
Ashot's avatar
Ashot committed
30
31
32
};

#endif // RPC_UPDATE_H