30
30
#include " types.h"
31
31
#include " utils.h"
32
32
33
- namespace minio {
34
- namespace s3 {
33
+ namespace minio ::s3 {
35
34
36
35
struct BaseArgs {
37
36
utils::Multimap extra_headers;
@@ -63,9 +62,9 @@ struct ObjectArgs : public BucketArgs {
63
62
struct ObjectWriteArgs : public ObjectArgs {
64
63
utils::Multimap headers;
65
64
utils::Multimap user_metadata;
66
- Sse * sse = nullptr ;
65
+ Sse* sse = nullptr ;
67
66
std::map<std::string, std::string> tags;
68
- Retention * retention = nullptr ;
67
+ Retention* retention = nullptr ;
69
68
bool legal_hold = false ;
70
69
71
70
ObjectWriteArgs () = default ;
@@ -82,15 +81,15 @@ struct ObjectVersionArgs : public ObjectArgs {
82
81
}; // struct ObjectVersionArgs
83
82
84
83
struct ObjectReadArgs : public ObjectVersionArgs {
85
- SseCustomerKey * ssec = nullptr ;
84
+ SseCustomerKey* ssec = nullptr ;
86
85
87
86
ObjectReadArgs () = default ;
88
87
~ObjectReadArgs () = default ;
89
88
}; // struct ObjectReadArgs
90
89
91
90
struct ObjectConditionalReadArgs : public ObjectReadArgs {
92
- size_t * offset = nullptr ;
93
- size_t * length = nullptr ;
91
+ size_t * offset = nullptr ;
92
+ size_t * length = nullptr ;
94
93
std::string match_etag;
95
94
std::string not_match_etag;
96
95
utils::UtcTime modified_since;
@@ -158,7 +157,7 @@ struct PutObjectApiArgs : public PutObjectBaseArgs {
158
157
std::string_view data;
159
158
utils::Multimap query_params;
160
159
http::ProgressFunction progressfunc = nullptr ;
161
- void * progress_userdata = nullptr ;
160
+ void * progress_userdata = nullptr ;
162
161
163
162
PutObjectApiArgs () = default ;
164
163
~PutObjectApiArgs () = default ;
@@ -169,7 +168,7 @@ struct UploadPartArgs : public ObjectWriteArgs {
169
168
unsigned int part_number;
170
169
std::string_view data;
171
170
http::ProgressFunction progressfunc = nullptr ;
172
- void * progress_userdata = nullptr ;
171
+ void * progress_userdata = nullptr ;
173
172
174
173
UploadPartArgs () = default ;
175
174
~UploadPartArgs () = default ;
@@ -196,7 +195,7 @@ struct DownloadObjectArgs : public ObjectReadArgs {
196
195
std::string filename;
197
196
bool overwrite;
198
197
http::ProgressFunction progressfunc = nullptr ;
199
- void * progress_userdata = nullptr ;
198
+ void * progress_userdata = nullptr ;
200
199
201
200
DownloadObjectArgs () = default ;
202
201
~DownloadObjectArgs () = default ;
@@ -206,9 +205,9 @@ struct DownloadObjectArgs : public ObjectReadArgs {
206
205
207
206
struct GetObjectArgs : public ObjectConditionalReadArgs {
208
207
http::DataFunction datafunc;
209
- void * userdata = nullptr ;
208
+ void * userdata = nullptr ;
210
209
http::ProgressFunction progressfunc = nullptr ;
211
- void * progress_userdata = nullptr ;
210
+ void * progress_userdata = nullptr ;
212
211
213
212
GetObjectArgs () = default ;
214
213
~GetObjectArgs () = default ;
@@ -235,11 +234,11 @@ struct ListObjectsArgs : public BucketArgs {
235
234
ListObjectsArgs () = default ;
236
235
~ListObjectsArgs () = default ;
237
236
238
- ListObjectsArgs (const ListObjectsArgs &) = default ;
239
- ListObjectsArgs & operator =(const ListObjectsArgs &) = default ;
237
+ ListObjectsArgs (const ListObjectsArgs&) = default ;
238
+ ListObjectsArgs& operator =(const ListObjectsArgs&) = default ;
240
239
241
- ListObjectsArgs (ListObjectsArgs &&) = default ;
242
- ListObjectsArgs & operator =(ListObjectsArgs &&) = default ;
240
+ ListObjectsArgs (ListObjectsArgs&&) = default ;
241
+ ListObjectsArgs& operator =(ListObjectsArgs&&) = default ;
243
242
}; // struct ListObjectsArgs
244
243
245
244
struct ListObjectsCommonArgs : public BucketArgs {
@@ -251,11 +250,11 @@ struct ListObjectsCommonArgs : public BucketArgs {
251
250
ListObjectsCommonArgs () = default ;
252
251
~ListObjectsCommonArgs () = default ;
253
252
254
- ListObjectsCommonArgs (const ListObjectsCommonArgs &) = default ;
255
- ListObjectsCommonArgs & operator =(const ListObjectsCommonArgs &) = default ;
253
+ ListObjectsCommonArgs (const ListObjectsCommonArgs&) = default ;
254
+ ListObjectsCommonArgs& operator =(const ListObjectsCommonArgs&) = default ;
256
255
257
- ListObjectsCommonArgs (ListObjectsCommonArgs &&) = default ;
258
- ListObjectsCommonArgs & operator =(ListObjectsCommonArgs &&) = default ;
256
+ ListObjectsCommonArgs (ListObjectsCommonArgs&&) = default ;
257
+ ListObjectsCommonArgs& operator =(ListObjectsCommonArgs&&) = default ;
259
258
}; // struct ListObjectsCommonArgs
260
259
261
260
struct ListObjectsV1Args : public ListObjectsCommonArgs {
@@ -264,15 +263,15 @@ struct ListObjectsV1Args : public ListObjectsCommonArgs {
264
263
ListObjectsV1Args ();
265
264
266
265
explicit ListObjectsV1Args (ListObjectsArgs args);
267
- ListObjectsV1Args & operator =(ListObjectsArgs args);
266
+ ListObjectsV1Args& operator =(ListObjectsArgs args);
268
267
269
268
~ListObjectsV1Args () = default ;
270
269
271
- ListObjectsV1Args (const ListObjectsV1Args &) = default ;
272
- ListObjectsV1Args & operator =(const ListObjectsV1Args &) = default ;
270
+ ListObjectsV1Args (const ListObjectsV1Args&) = default ;
271
+ ListObjectsV1Args& operator =(const ListObjectsV1Args&) = default ;
273
272
274
- ListObjectsV1Args (ListObjectsV1Args &&) = default ;
275
- ListObjectsV1Args & operator =(ListObjectsV1Args &&) = default ;
273
+ ListObjectsV1Args (ListObjectsV1Args&&) = default ;
274
+ ListObjectsV1Args& operator =(ListObjectsV1Args&&) = default ;
276
275
}; // struct ListObjectsV1Args
277
276
278
277
struct ListObjectsV2Args : public ListObjectsCommonArgs {
@@ -284,15 +283,15 @@ struct ListObjectsV2Args : public ListObjectsCommonArgs {
284
283
ListObjectsV2Args ();
285
284
286
285
explicit ListObjectsV2Args (ListObjectsArgs args);
287
- ListObjectsV2Args & operator =(ListObjectsArgs args);
286
+ ListObjectsV2Args& operator =(ListObjectsArgs args);
288
287
289
288
~ListObjectsV2Args () = default ;
290
289
291
- ListObjectsV2Args (const ListObjectsV2Args &) = default ;
292
- ListObjectsV2Args & operator =(const ListObjectsV2Args &) = default ;
290
+ ListObjectsV2Args (const ListObjectsV2Args&) = default ;
291
+ ListObjectsV2Args& operator =(const ListObjectsV2Args&) = default ;
293
292
294
- ListObjectsV2Args (ListObjectsV2Args &&) = default ;
295
- ListObjectsV2Args & operator =(ListObjectsV2Args &&) = default ;
293
+ ListObjectsV2Args (ListObjectsV2Args&&) = default ;
294
+ ListObjectsV2Args& operator =(ListObjectsV2Args&&) = default ;
296
295
}; // struct ListObjectsV2Args
297
296
298
297
struct ListObjectVersionsArgs : public ListObjectsCommonArgs {
@@ -302,23 +301,23 @@ struct ListObjectVersionsArgs : public ListObjectsCommonArgs {
302
301
ListObjectVersionsArgs ();
303
302
304
303
explicit ListObjectVersionsArgs (ListObjectsArgs args);
305
- ListObjectVersionsArgs & operator =(ListObjectsArgs args);
304
+ ListObjectVersionsArgs& operator =(ListObjectsArgs args);
306
305
307
306
~ListObjectVersionsArgs () = default ;
308
307
309
- ListObjectVersionsArgs (const ListObjectVersionsArgs &) = default ;
310
- ListObjectVersionsArgs & operator =(const ListObjectVersionsArgs &) = default ;
308
+ ListObjectVersionsArgs (const ListObjectVersionsArgs&) = default ;
309
+ ListObjectVersionsArgs& operator =(const ListObjectVersionsArgs&) = default ;
311
310
312
- ListObjectVersionsArgs (ListObjectVersionsArgs &&) = default ;
313
- ListObjectVersionsArgs & operator =(ListObjectVersionsArgs &&) = default ;
311
+ ListObjectVersionsArgs (ListObjectVersionsArgs&&) = default ;
312
+ ListObjectVersionsArgs& operator =(ListObjectVersionsArgs&&) = default ;
314
313
}; // struct ListObjectVersionsArgs
315
314
316
315
struct PutObjectArgs : public PutObjectBaseArgs {
317
- std::istream & stream;
316
+ std::istream& stream;
318
317
http::ProgressFunction progressfunc = nullptr ;
319
- void * progress_userdata = nullptr ;
318
+ void * progress_userdata = nullptr ;
320
319
321
- PutObjectArgs (std::istream & stream, long object_size, long part_size);
320
+ PutObjectArgs (std::istream& stream, long object_size, long part_size);
322
321
~PutObjectArgs () = default ;
323
322
324
323
error::Error Validate ();
@@ -328,8 +327,8 @@ using CopySource = ObjectConditionalReadArgs;
328
327
329
328
struct CopyObjectArgs : public ObjectWriteArgs {
330
329
CopySource source;
331
- Directive * metadata_directive = nullptr ;
332
- Directive * tagging_directive = nullptr ;
330
+ Directive* metadata_directive = nullptr ;
331
+ Directive* tagging_directive = nullptr ;
333
332
334
333
CopyObjectArgs () = default ;
335
334
~CopyObjectArgs () = default ;
@@ -341,7 +340,7 @@ struct ComposeSource : public ObjectConditionalReadArgs {
341
340
ComposeSource () = default ;
342
341
~ComposeSource () = default ;
343
342
344
- error::Error BuildHeaders (size_t object_size, const std::string & etag);
343
+ error::Error BuildHeaders (size_t object_size, const std::string& etag);
345
344
size_t ObjectSize () const ;
346
345
utils::Multimap Headers () const ;
347
346
@@ -362,7 +361,7 @@ struct ComposeObjectArgs : public ObjectWriteArgs {
362
361
struct UploadObjectArgs : public PutObjectBaseArgs {
363
362
std::string filename;
364
363
http::ProgressFunction progressfunc = nullptr ;
365
- void * progress_userdata = nullptr ;
364
+ void * progress_userdata = nullptr ;
366
365
367
366
UploadObjectArgs () = default ;
368
367
~UploadObjectArgs () = default ;
@@ -379,7 +378,7 @@ struct RemoveObjectsApiArgs : public BucketArgs {
379
378
~RemoveObjectsApiArgs () = default ;
380
379
}; // struct RemoveObjectsApiArgs
381
380
382
- using DeleteObjectFunction = std::function<bool (DeleteObject &)>;
381
+ using DeleteObjectFunction = std::function<bool (DeleteObject&)>;
383
382
384
383
struct RemoveObjectsArgs : public BucketArgs {
385
384
bool bypass_governance_mode = false ;
@@ -392,10 +391,10 @@ struct RemoveObjectsArgs : public BucketArgs {
392
391
}; // struct RemoveObjectsArgs
393
392
394
393
struct SelectObjectContentArgs : public ObjectReadArgs {
395
- SelectRequest & request;
394
+ SelectRequest& request;
396
395
SelectResultFunction resultfunc = nullptr ;
397
396
398
- SelectObjectContentArgs (SelectRequest & req, SelectResultFunction func)
397
+ SelectObjectContentArgs (SelectRequest& req, SelectResultFunction func)
399
398
: request(req), resultfunc(func) {}
400
399
401
400
~SelectObjectContentArgs () = default ;
@@ -433,9 +432,9 @@ using DeleteBucketNotificationArgs = BucketArgs;
433
432
using GetBucketNotificationArgs = BucketArgs;
434
433
435
434
struct SetBucketNotificationArgs : public BucketArgs {
436
- NotificationConfig & config;
435
+ NotificationConfig& config;
437
436
438
- explicit SetBucketNotificationArgs (NotificationConfig & configvalue)
437
+ explicit SetBucketNotificationArgs (NotificationConfig& configvalue)
439
438
: config(configvalue) {}
440
439
441
440
~SetBucketNotificationArgs () = default ;
@@ -446,9 +445,9 @@ using DeleteBucketEncryptionArgs = BucketArgs;
446
445
using GetBucketEncryptionArgs = BucketArgs;
447
446
448
447
struct SetBucketEncryptionArgs : public BucketArgs {
449
- SseConfig & config;
448
+ SseConfig& config;
450
449
451
- explicit SetBucketEncryptionArgs (SseConfig & sseconfig) : config(sseconfig) {}
450
+ explicit SetBucketEncryptionArgs (SseConfig& sseconfig) : config(sseconfig) {}
452
451
453
452
~SetBucketEncryptionArgs () = default ;
454
453
@@ -472,9 +471,9 @@ using DeleteBucketReplicationArgs = BucketArgs;
472
471
using GetBucketReplicationArgs = BucketArgs;
473
472
474
473
struct SetBucketReplicationArgs : public BucketArgs {
475
- ReplicationConfig & config;
474
+ ReplicationConfig& config;
476
475
477
- explicit SetBucketReplicationArgs (ReplicationConfig & value) : config(value) {}
476
+ explicit SetBucketReplicationArgs (ReplicationConfig& value) : config(value) {}
478
477
479
478
~SetBucketReplicationArgs () = default ;
480
479
}; // struct SetBucketReplication
@@ -484,9 +483,9 @@ using DeleteBucketLifecycleArgs = BucketArgs;
484
483
using GetBucketLifecycleArgs = BucketArgs;
485
484
486
485
struct SetBucketLifecycleArgs : public BucketArgs {
487
- LifecycleConfig & config;
486
+ LifecycleConfig& config;
488
487
489
- explicit SetBucketLifecycleArgs (LifecycleConfig & value) : config(value) {}
488
+ explicit SetBucketLifecycleArgs (LifecycleConfig& value) : config(value) {}
490
489
491
490
~SetBucketLifecycleArgs () = default ;
492
491
}; // struct SetBucketLifecycle
@@ -581,14 +580,14 @@ struct PostPolicy {
581
580
size_t upper_limit);
582
581
void RemoveContentLengthRangeCondition ();
583
582
584
- error::Error FormData (std::map<std::string, std::string> & data,
583
+ error::Error FormData (std::map<std::string, std::string>& data,
585
584
std::string access_key, std::string secret_key,
586
585
std::string session_token, std::string region);
587
586
588
587
private:
589
- static constexpr const char * eq_ = " eq" ;
590
- static constexpr const char * starts_with_ = " starts-with" ;
591
- static constexpr const char * algorithm_ = " AWS4-HMAC-SHA256" ;
588
+ static constexpr const char * eq_ = " eq" ;
589
+ static constexpr const char * starts_with_ = " starts-with" ;
590
+ static constexpr const char * algorithm_ = " AWS4-HMAC-SHA256" ;
592
591
593
592
utils::UtcTime expiration_;
594
593
std::map<std::string, std::map<std::string, std::string>> conditions_;
@@ -601,7 +600,7 @@ struct PostPolicy {
601
600
std::string region);
602
601
static bool isReservedElement (std::string element);
603
602
}; // struct PostPolicy
604
- } // namespace s3
605
- } // namespace minio
603
+
604
+ } // namespace minio::s3
606
605
607
606
#endif // _MINIO_CPP_ARGS_H_INCLUDED
0 commit comments