@@ -15,9 +15,9 @@ A lightweight C++ client library for AWS S3, with zero 3rd party C++ dependencie
1515
1616Each S3 Client is organized onto modular components:
1717
18- - ` src/s3cpp/httpclient ` : HTTP/1.1 client built on libCurl
19- - ` src/s3cpp/auth ` : AWS Signature V4 auth protocol (SigV4a pending)
20- - ` src/s3cpp/xml ` : A custom FSM for parsing XML
18+ - ` src/s3cpp/httpclient `
19+ - ` src/s3cpp/auth ` : AWS Signature V4 auth protocol
20+ - ` src/s3cpp/xml ` : A custom FSM for parsing valid XML
2121
2222## Basic Usage
2323
@@ -27,7 +27,7 @@ Create a bucket:
2727#include < s3cpp/s3.h>
2828
2929int main () {
30- S3Client client("access_key", "secret_key");
30+ s3cpp:: S3Client client("access_key", "secret_key");
3131
3232 auto result = client.CreateBucket("my-bucket", {
3333 .LocationConstraint = "us-east-1"
@@ -47,7 +47,7 @@ List all buckets:
4747#include < s3cpp/s3.h>
4848
4949int main () {
50- S3Client client("access_key", "secret_key");
50+ s3cpp:: S3Client client("access_key", "secret_key");
5151
5252 auto result = client.ListBuckets();
5353
@@ -69,7 +69,7 @@ List objects in a bucket:
6969#include < s3cpp/s3.h>
7070
7171int main () {
72- S3Client client("access_key", "secret_key");
72+ s3cpp:: S3Client client("access_key", "secret_key");
7373
7474 // List 100 objects with a prefix
7575 auto result = client.ListObjects("my-bucket", {
@@ -95,13 +95,13 @@ For buckets with many objects, use the paginator to automatically handle continu
9595#include < s3cpp/s3.h>
9696
9797int main () {
98- S3Client client("access_key", "secret_key");
99- ListObjectsPaginator paginator(client, "my-bucket", "path/to/", 100);
98+ s3cpp:: S3Client client("access_key", "secret_key");
99+ s3cpp:: ListObjectsPaginator paginator(client, "my-bucket", "path/to/", 100);
100100
101101 int totalObjects = 0;
102102
103103 while (paginator.HasMorePages()) {
104- std::expected<ListObjectsResult, Error> page = paginator.NextPage();
104+ std::expected<s3cpp:: ListObjectsResult, s3cpp:: Error> page = paginator.NextPage();
105105
106106 if (!page) {
107107 std::println ("Error: {}", page.error().Message);
@@ -123,13 +123,13 @@ Checking if a bucket exists:
123123``` cpp
124124#include < s3cpp/s3.h>
125125
126- bool BucketExists (S3Client& client, const std::string& bucketName) {
126+ bool BucketExists (s3cpp:: S3Client& client, const std::string& bucketName) {
127127 auto result = client.HeadBucket(bucketName);
128128 return result.has_value();
129129}
130130
131131int main() {
132- S3Client client("access_key", "secret_key");
132+ s3cpp:: S3Client client("access_key", "secret_key");
133133
134134 if (BucketExists(client, "my-bucket")) {
135135 std::println("Bucket exists");
@@ -147,10 +147,10 @@ Delete a non-empty bucket:
147147#include <s3cpp/s3.h>
148148
149149int main() {
150- S3Client client("access_key", "secret_key");
150+ s3cpp:: S3Client client("access_key", "secret_key");
151151
152152 // To delete a bucket we first need to delete all its contents
153- ListObjectsPaginator paginator(client, "my-bucket", "", 1000);
153+ s3cpp:: ListObjectsPaginator paginator(client, "my-bucket", "", 1000);
154154
155155 while (paginator.HasMorePages()) {
156156 auto page = paginator.NextPage();
@@ -199,4 +199,4 @@ $ docker run -d -p 9000:9000 -p 9001:9001 \
199199 server /data --console-address " :9001"
200200```
201201
202- The full test suite contains 60 tests
202+ The full test suite contains 62 tests
0 commit comments