react-native-nitro-ark 0.0.24 → 0.0.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ArkCxxBridge.xcframework/Info.plist +48 -0
- package/ArkCxxBridge.xcframework/ios-arm64/Headers/ark_cxx.h +932 -0
- package/ArkCxxBridge.xcframework/ios-arm64/Headers/cxx.rs.h +87 -0
- package/ArkCxxBridge.xcframework/ios-arm64/libcxxbridge1.a +0 -0
- package/ArkCxxBridge.xcframework/ios-arm64_x86_64-simulator/Headers/ark_cxx.h +932 -0
- package/ArkCxxBridge.xcframework/ios-arm64_x86_64-simulator/Headers/cxx.rs.h +87 -0
- package/ArkCxxBridge.xcframework/ios-arm64_x86_64-simulator/libcxxbridge1.a +0 -0
- package/android/CMakeLists.txt +12 -0
- package/android/src/main/jniLibs/arm64-v8a/libcxxbridge1.a +0 -0
- package/android/src/main/jniLibs/x86_64/libcxxbridge1.a +0 -0
- package/cpp/NitroArk.hpp +416 -600
- package/cpp/generated/ark_cxx.h +932 -0
- package/cpp/generated/cxx.h +1149 -0
- package/package.json +2 -1
- package/cpp/bark-cpp.h +0 -183
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
#include <array>
|
|
3
|
+
#include <cstdint>
|
|
4
|
+
#include <string>
|
|
5
|
+
|
|
6
|
+
namespace rust {
|
|
7
|
+
inline namespace cxxbridge1 {
|
|
8
|
+
// #include "rust/cxx.h"
|
|
9
|
+
|
|
10
|
+
struct unsafe_bitcopy_t;
|
|
11
|
+
|
|
12
|
+
#ifndef CXXBRIDGE1_RUST_STRING
|
|
13
|
+
#define CXXBRIDGE1_RUST_STRING
|
|
14
|
+
class String final {
|
|
15
|
+
public:
|
|
16
|
+
String() noexcept;
|
|
17
|
+
String(const String &) noexcept;
|
|
18
|
+
String(String &&) noexcept;
|
|
19
|
+
~String() noexcept;
|
|
20
|
+
|
|
21
|
+
String(const std::string &);
|
|
22
|
+
String(const char *);
|
|
23
|
+
String(const char *, std::size_t);
|
|
24
|
+
String(const char16_t *);
|
|
25
|
+
String(const char16_t *, std::size_t);
|
|
26
|
+
#ifdef __cpp_char8_t
|
|
27
|
+
String(const char8_t *s);
|
|
28
|
+
String(const char8_t *s, std::size_t len);
|
|
29
|
+
#endif
|
|
30
|
+
|
|
31
|
+
static String lossy(const std::string &) noexcept;
|
|
32
|
+
static String lossy(const char *) noexcept;
|
|
33
|
+
static String lossy(const char *, std::size_t) noexcept;
|
|
34
|
+
static String lossy(const char16_t *) noexcept;
|
|
35
|
+
static String lossy(const char16_t *, std::size_t) noexcept;
|
|
36
|
+
|
|
37
|
+
String &operator=(const String &) & noexcept;
|
|
38
|
+
String &operator=(String &&) & noexcept;
|
|
39
|
+
|
|
40
|
+
explicit operator std::string() const;
|
|
41
|
+
|
|
42
|
+
const char *data() const noexcept;
|
|
43
|
+
std::size_t size() const noexcept;
|
|
44
|
+
std::size_t length() const noexcept;
|
|
45
|
+
bool empty() const noexcept;
|
|
46
|
+
|
|
47
|
+
const char *c_str() noexcept;
|
|
48
|
+
|
|
49
|
+
std::size_t capacity() const noexcept;
|
|
50
|
+
void reserve(size_t new_cap) noexcept;
|
|
51
|
+
|
|
52
|
+
using iterator = char *;
|
|
53
|
+
iterator begin() noexcept;
|
|
54
|
+
iterator end() noexcept;
|
|
55
|
+
|
|
56
|
+
using const_iterator = const char *;
|
|
57
|
+
const_iterator begin() const noexcept;
|
|
58
|
+
const_iterator end() const noexcept;
|
|
59
|
+
const_iterator cbegin() const noexcept;
|
|
60
|
+
const_iterator cend() const noexcept;
|
|
61
|
+
|
|
62
|
+
bool operator==(const String &) const noexcept;
|
|
63
|
+
bool operator!=(const String &) const noexcept;
|
|
64
|
+
bool operator<(const String &) const noexcept;
|
|
65
|
+
bool operator<=(const String &) const noexcept;
|
|
66
|
+
bool operator>(const String &) const noexcept;
|
|
67
|
+
bool operator>=(const String &) const noexcept;
|
|
68
|
+
|
|
69
|
+
void swap(String &) noexcept;
|
|
70
|
+
|
|
71
|
+
String(unsafe_bitcopy_t, const String &) noexcept;
|
|
72
|
+
|
|
73
|
+
private:
|
|
74
|
+
struct lossy_t;
|
|
75
|
+
String(lossy_t, const char *, std::size_t) noexcept;
|
|
76
|
+
String(lossy_t, const char16_t *, std::size_t) noexcept;
|
|
77
|
+
friend void swap(String &lhs, String &rhs) noexcept { lhs.swap(rhs); }
|
|
78
|
+
|
|
79
|
+
std::array<std::uintptr_t, 3> repr;
|
|
80
|
+
};
|
|
81
|
+
#endif // CXXBRIDGE1_RUST_STRING
|
|
82
|
+
} // namespace cxxbridge1
|
|
83
|
+
} // namespace rust
|
|
84
|
+
|
|
85
|
+
namespace bark_cxx {
|
|
86
|
+
::rust::String create_mnemonic() noexcept;
|
|
87
|
+
} // namespace bark_cxx
|
package/android/CMakeLists.txt
CHANGED
|
@@ -11,11 +11,16 @@ set(LIBS_DIR "${ANDROID_DIR}/src/main/jniLibs/${ANDROID_ABI}")
|
|
|
11
11
|
|
|
12
12
|
# Check for required files
|
|
13
13
|
set(BARK_LIB "${LIBS_DIR}/libbark_cpp.a")
|
|
14
|
+
set(BARK_CXX_LIB "${LIBS_DIR}/libcxxbridge1.a")
|
|
14
15
|
|
|
15
16
|
if(NOT EXISTS "${BARK_LIB}")
|
|
16
17
|
message(FATAL_ERROR "libbark_cpp.a not found at: ${BARK_LIB}")
|
|
17
18
|
endif()
|
|
18
19
|
|
|
20
|
+
if(NOT EXISTS "${BARK_CXX_LIB}")
|
|
21
|
+
message(FATAL_ERROR "libcxxbridge1.a not found at: ${BARK_CXX_LIB}")
|
|
22
|
+
endif()
|
|
23
|
+
|
|
19
24
|
message(STATUS "Using libraries from: ${LIBS_DIR}")
|
|
20
25
|
|
|
21
26
|
# Define C++ library and add all sources
|
|
@@ -30,6 +35,7 @@ add_library(
|
|
|
30
35
|
target_include_directories(${PROJECT_NAME}
|
|
31
36
|
PRIVATE
|
|
32
37
|
${CPP_DIR}
|
|
38
|
+
${CPP_DIR}/generated
|
|
33
39
|
${ANDROID_DIR}/src/main/cpp
|
|
34
40
|
${LIBS_DIR}
|
|
35
41
|
)
|
|
@@ -43,6 +49,11 @@ set_target_properties(bark_lib PROPERTIES
|
|
|
43
49
|
IMPORTED_LOCATION "${BARK_LIB}"
|
|
44
50
|
)
|
|
45
51
|
|
|
52
|
+
add_library(bark_cxx_lib STATIC IMPORTED)
|
|
53
|
+
set_target_properties(bark_cxx_lib PROPERTIES
|
|
54
|
+
IMPORTED_LOCATION "${BARK_CXX_LIB}"
|
|
55
|
+
)
|
|
56
|
+
|
|
46
57
|
# Additional compiler flags
|
|
47
58
|
target_compile_options(${PROJECT_NAME}
|
|
48
59
|
PRIVATE
|
|
@@ -57,6 +68,7 @@ include(${CMAKE_SOURCE_DIR}/../nitrogen/generated/android/NitroArk+autolinking.c
|
|
|
57
68
|
target_link_libraries(
|
|
58
69
|
${PROJECT_NAME}
|
|
59
70
|
bark_lib
|
|
71
|
+
bark_cxx_lib
|
|
60
72
|
${LOG_LIB}
|
|
61
73
|
dl
|
|
62
74
|
m
|
|
Binary file
|
|
Binary file
|