Skip to content

Commit

Permalink
fix cpp lint
Browse files Browse the repository at this point in the history
Signed-off-by: tianpingan <[email protected]>
  • Loading branch information
Tianpingan committed Dec 26, 2023
1 parent 7f1cf58 commit cc0e773
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
6 changes: 4 additions & 2 deletions src/common/s3_adapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,8 @@ bool S3Adapter::BucketExist() {
}

int S3Adapter::PutObject(const Aws::String &key, const char *buffer,
const size_t bufferSize, const PutObjectOptions &options) {
const size_t bufferSize,
const PutObjectOptions &options) {
Aws::S3::Model::PutObjectRequest request;
request.SetBucket(bucketName_);
request.SetKey(key);
Expand All @@ -305,7 +306,8 @@ int S3Adapter::PutObject(const Aws::String &key, const char *buffer,
}
}

int S3Adapter::PutObject(const Aws::String &key, const std::string &data, const PutObjectOptions &options) {
int S3Adapter::PutObject(const Aws::String &key, const std::string &data,
const PutObjectOptions &options) {
return PutObject(key, data.data(), data.size(), options);
}
/*
Expand Down
12 changes: 8 additions & 4 deletions src/common/s3_adapter.h
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,8 @@ class S3Adapter {
* @return:0 上传成功/ -1 上传失败
*/
virtual int PutObject(const Aws::String &key, const char *buffer,
const size_t bufferSize, const PutObjectOptions& options = PutObjectOptions{});
const size_t bufferSize,
const PutObjectOptions &options = PutObjectOptions{});
// Get object to buffer[bufferSize]
// int GetObject(const Aws::String &key, void *buffer,
// const int bufferSize);
Expand All @@ -267,7 +268,8 @@ class S3Adapter {
* @param 数据内容
* @return:0 上传成功/ -1 上传失败
*/
virtual int PutObject(const Aws::String &key, const std::string &data, const PutObjectOptions& options = PutObjectOptions{});
virtual int PutObject(const Aws::String &key, const std::string &data,
const PutObjectOptions &options = PutObjectOptions{});
virtual void PutObjectAsync(std::shared_ptr<PutObjectAsyncContext> context);
/**
* Get object from s3,
Expand Down Expand Up @@ -404,15 +406,17 @@ class FakeS3Adapter : public S3Adapter {
bool BucketExist() override { return true; }

int PutObject(const Aws::String &key, const char *buffer,
const size_t bufferSize, const curve::common::PutObjectOptions& options) override {
const size_t bufferSize,
const curve::common::PutObjectOptions &options) override {
(void)key;
(void)buffer;
(void)bufferSize;
(void)options;
return 0;
}

int PutObject(const Aws::String &key, const std::string &data, const curve::common::PutObjectOptions& options) override {
int PutObject(const Aws::String &key, const std::string &data,
const curve::common::PutObjectOptions &options) override {
(void)key;
(void)data;
(void)options;
Expand Down

0 comments on commit cc0e773

Please sign in to comment.