File: s3backup.h

package info (click to toggle)
ori 0.8.1%2Bds1-3
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 2,204 kB
  • ctags: 2,659
  • sloc: cpp: 22,383; ansic: 5,870; sh: 451; python: 205; makefile: 21
file content (37 lines) | stat: -rw-r--r-- 926 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#ifndef __S3BACKUP_H__
#define __S3BACKUP_H__

#include <stdexcept>
#include <boost/tr1/memory.hpp>

#include <ori/object.h>
#include <ori/backup.h>

struct S3BucketContext;
class S3BackupService : public BackupService {
public:
    S3BackupService(const std::string &accessKeyID,
            const std::string &secretAccessKey,
            const std::string &bucketName);
    ~S3BackupService();

#ifdef USE_FAKES3
    void setHostname(const std::string &hostname);
#endif

    bool realHasKey(const std::string &key);
    bool getData(const std::string &key, std::string &out);
    bool putFile(const std::string &key, const std::string &filename);
    bool putData(const std::string &key, const std::string &data);

private:
    std::string accessKeyID;
    std::string secretAccessKey;
    std::string bucketName;
    std::string _hostname;

    std::tr1::shared_ptr<S3BucketContext> ctx;
};

#endif /* __S3BACKUP_H__ */