acl  3.5.3.0
OSSClient.hpp
浏览该文件的文档.
1 #pragma once
3 #include <list>
5 
6 namespace acl
7 {
8 
9 class istream;
10 
11 class OSSBucketOperation;
12 class Bucket;
13 
14 class OSSObjectOperation;
15 class OSSObject;
16 class CORSOperation;
17 class ObjectMetadata;
18 class OptionsRequest;
19 class PutObjectResult;
20 class CopyObjectResult;
21 class SetBucketCORSRequest;
22 
23 class OSSMultipartOperation;
24 class AbortMultipartUploadRequest;
25 class CompleteMultipartUploadRequest;
26 class InitiateMultipartUploadRequest;
27 class ListMultipartUploadsRequest;
28 class ListPartsRequest;
29 class UploadPartRequest;
30 class UploadPartCopyRequest;
31 class CompleteMultipartUploadResult;
32 class InitiateMultipartUploadResult;
33 class MultipartUploadListing;
34 class PartListing;
35 class UploadPartResult;
36 class UploadPartCopyResult;
37 
39 {
40 public:
41  OSSClient(const char* keyId, const char* keySecret);
42  OSSClient(const char* endPoint, const char* keyId,
43  const char* keySecret);
44 
45  ~OSSClient();
46 
47  const char* getEndpoint() const
48  {
49  return end_point_;
50  }
51 
52  const char* getAccessKeyId() const
53  {
54  return key_id_;
55  }
56 
57  const char* getAccessKeySecret() const
58  {
59  return key_secret_;
60  }
61 
62  bool createBucket(Bucket& bucket);
63  bool deleteBucket(const char* name);
64  std::list<Bucket> listBuckets();
65  const char* getBucketLocation(const char* name);
66  bool doesBucketExist(const char* name);
67 
68  OSSObject* getObject(const char* bucket, const char* key);
69  bool deleteObject(const char* bucket, const char* key);
70  bool putObject(const char* bucket, const char* key, istream& in,
71  ObjectMetadata& meta, PutObjectResult* result = NULL);
72  bool copyObject(const char* fromBucket, const char* fromKey,
73  const char* toBucket, const char* toKey,
74  CopyObjectResult* result = NULL);
75  bool getObjectMetadata(const char* bucket, const char* key,
76  ObjectMetadata* result = NULL);
77 
78  bool setBucketCORS(SetBucketCORSRequest& request);
79  bool deleteBucketCORSRules(const char* bucket);
80  bool optionsObject(OptionsRequest& request);
81  bool getBucketCORSRules(const char* bucket,
82  std::list<CORSRule>* result);
83 
84  bool abortMultipartUpload(AbortMultipartUploadRequest& request);
85  bool completeMultipartUpload(CompleteMultipartUploadRequest& request,
87  bool initiateMultipartUpload(InitiateMultipartUploadRequest& request,
89  bool listMultipartUploads(ListMultipartUploadsRequest& request,
90  MultipartUploadListing* result);
91  bool listParts(ListPartsRequest& request, PartListing* result);
92  bool uploadPart(UploadPartRequest& request, UploadPartResult* result);
93  bool uploadPartCopy(UploadPartCopyRequest& request,
94  UploadPartCopyResult* result);
95 
96 private:
97  char* end_point_;
98  char* key_id_;
99  char* key_secret_;
100  OSSBucketOperation* bucket_oper_;
101  OSSObjectOperation* object_oper_;
102  OSSMultipartOperation* multipart_oper_;
103  CORSOperation* cors_oper_;
104 };
105 
106 } // namespace acl
HTTP_API void const char * name
Definition: lib_http.h:620
const char * getAccessKeyId() const
Definition: OSSClient.hpp:52
const char * getAccessKeySecret() const
Definition: OSSClient.hpp:57
const char * getEndpoint() const
Definition: OSSClient.hpp:47
#define ACL_CPP_API