Skip to content

Commit 3fd5218

Browse files
Fix P1/P2 defects in C++ SDK: correct exception init, enum defaults, commit SDK output
1 parent 13e163e commit 3fd5218

359 files changed

Lines changed: 62877 additions & 10 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

examples/cpp/CMakeLists.txt

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
cmake_minimum_required(VERSION 3.14)
2+
3+
project(name VERSION 0.0.1)
4+
5+
set(CMAKE_CXX_STANDARD 17)
6+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
7+
8+
include(FetchContent)
9+
10+
FetchContent_Declare(cpr
11+
GIT_REPOSITORY https://github.com/libcpr/cpr.git
12+
GIT_TAG 1.10.5)
13+
FetchContent_MakeAvailable(cpr)
14+
15+
FetchContent_Declare(nlohmann_json
16+
GIT_REPOSITORY https://github.com/nlohmann/json.git
17+
GIT_TAG v3.11.3)
18+
FetchContent_MakeAvailable(nlohmann_json)
19+
20+
include_directories(include)
21+
22+
add_library(${PROJECT_NAME} INTERFACE)
23+
target_include_directories(${PROJECT_NAME} INTERFACE include)
24+
target_link_libraries(${PROJECT_NAME} INTERFACE
25+
cpr::cpr
26+
nlohmann_json::nlohmann_json
27+
$<$<AND:$<CXX_COMPILER_ID:GNU>,$<VERSION_LESS:$<CXX_COMPILER_VERSION>,9.0>>:stdc++fs>
28+
)

examples/cpp/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2026 Appwrite (https://appwrite.io)
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

examples/cpp/README.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# NAME
2+
3+
**This is the official C++ SDK for Appwrite.**
4+
5+
## Installation
6+
7+
### CMake
8+
9+
Add the following to your `CMakeLists.txt`:
10+
11+
```cmake
12+
include(FetchContent)
13+
FetchContent_Declare(
14+
name
15+
GIT_REPOSITORY https://github.com/appwrite/sdk-for-cpp.git
16+
GIT_TAG main
17+
)
18+
FetchContent_MakeAvailable(name)
19+
20+
target_link_libraries(my_app PRIVATE name)
21+
```
22+
23+
## Getting Started
24+
25+
```cpp
26+
#include <appwrite/client.hpp>
27+
#include <appwrite/services/account.hpp>
28+
29+
int main() {
30+
appwrite::Client client;
31+
client
32+
.setEndpoint("https://localhost/v1")
33+
.setProject("my-project")
34+
.setKey("my-key");
35+
36+
appwrite::services::Account account(client);
37+
// ...
38+
return 0;
39+
}
40+
```
41+
42+
## License
43+
44+
[MIT License](LICENSE)

0 commit comments

Comments
 (0)