@dawidzawada/bonjour-zeroconf 1.1.0 → 1.2.0-alpha.0
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/nitrogen/generated/android/c++/JBonjourFail.hpp +4 -5
- package/nitrogen/generated/android/c++/JBonjourListener.hpp +3 -4
- package/nitrogen/generated/android/c++/JFunc_void.hpp +3 -2
- package/nitrogen/generated/android/c++/JFunc_void_BonjourFail.hpp +3 -2
- package/nitrogen/generated/android/c++/JFunc_void_bool.hpp +3 -2
- package/nitrogen/generated/android/c++/JFunc_void_std__vector_ScanResult_.hpp +3 -2
- package/nitrogen/generated/android/c++/JHybridBonjourZeroconfSpec.cpp +9 -1
- package/nitrogen/generated/android/c++/JHybridBonjourZeroconfSpec.hpp +2 -1
- package/nitrogen/generated/android/c++/JScanOptions.hpp +1 -1
- package/nitrogen/generated/android/c++/JScanResult.hpp +1 -1
- package/nitrogen/generated/android/dawidzawada_bonjourzeroconf+autolinking.cmake +1 -1
- package/nitrogen/generated/android/dawidzawada_bonjourzeroconf+autolinking.gradle +1 -1
- package/nitrogen/generated/android/dawidzawada_bonjourzeroconfOnLoad.cpp +1 -1
- package/nitrogen/generated/android/dawidzawada_bonjourzeroconfOnLoad.hpp +1 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/dawidzawada/bonjourzeroconf/BonjourFail.kt +3 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/dawidzawada/bonjourzeroconf/BonjourListener.kt +2 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/dawidzawada/bonjourzeroconf/Func_void.kt +1 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/dawidzawada/bonjourzeroconf/Func_void_BonjourFail.kt +1 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/dawidzawada/bonjourzeroconf/Func_void_bool.kt +1 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/dawidzawada/bonjourzeroconf/Func_void_std__vector_ScanResult_.kt +1 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/dawidzawada/bonjourzeroconf/HybridBonjourZeroconfSpec.kt +1 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/dawidzawada/bonjourzeroconf/ScanOptions.kt +2 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/dawidzawada/bonjourzeroconf/ScanResult.kt +2 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/dawidzawada/bonjourzeroconf/dawidzawada_bonjourzeroconfOnLoad.kt +1 -1
- package/nitrogen/generated/ios/BonjourZeroconf+autolinking.rb +2 -2
- package/nitrogen/generated/ios/BonjourZeroconf-Swift-Cxx-Bridge.cpp +1 -1
- package/nitrogen/generated/ios/BonjourZeroconf-Swift-Cxx-Bridge.hpp +1 -1
- package/nitrogen/generated/ios/BonjourZeroconf-Swift-Cxx-Umbrella.hpp +1 -1
- package/nitrogen/generated/ios/BonjourZeroconfAutolinking.mm +1 -1
- package/nitrogen/generated/ios/BonjourZeroconfAutolinking.swift +1 -1
- package/nitrogen/generated/ios/c++/HybridBonjourZeroconfSpecSwift.cpp +1 -1
- package/nitrogen/generated/ios/c++/HybridBonjourZeroconfSpecSwift.hpp +7 -1
- package/nitrogen/generated/ios/c++/HybridLocalNetworkPermissionSpecSwift.cpp +1 -1
- package/nitrogen/generated/ios/c++/HybridLocalNetworkPermissionSpecSwift.hpp +7 -1
- package/nitrogen/generated/ios/swift/BonjourFail.swift +1 -1
- package/nitrogen/generated/ios/swift/BonjourListener.swift +8 -17
- package/nitrogen/generated/ios/swift/Func_void.swift +1 -1
- package/nitrogen/generated/ios/swift/Func_void_BonjourFail.swift +1 -1
- package/nitrogen/generated/ios/swift/Func_void_bool.swift +1 -1
- package/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +1 -1
- package/nitrogen/generated/ios/swift/Func_void_std__vector_ScanResult_.swift +1 -1
- package/nitrogen/generated/ios/swift/HybridBonjourZeroconfSpec.swift +1 -1
- package/nitrogen/generated/ios/swift/HybridBonjourZeroconfSpec_cxx.swift +9 -1
- package/nitrogen/generated/ios/swift/HybridLocalNetworkPermissionSpec.swift +1 -1
- package/nitrogen/generated/ios/swift/HybridLocalNetworkPermissionSpec_cxx.swift +9 -1
- package/nitrogen/generated/ios/swift/ScanOptions.swift +3 -15
- package/nitrogen/generated/ios/swift/ScanResult.swift +32 -86
- package/nitrogen/generated/shared/c++/BonjourFail.hpp +1 -1
- package/nitrogen/generated/shared/c++/BonjourListener.hpp +13 -5
- package/nitrogen/generated/shared/c++/HybridBonjourZeroconfSpec.cpp +1 -1
- package/nitrogen/generated/shared/c++/HybridBonjourZeroconfSpec.hpp +1 -1
- package/nitrogen/generated/shared/c++/HybridLocalNetworkPermissionSpec.cpp +1 -1
- package/nitrogen/generated/shared/c++/HybridLocalNetworkPermissionSpec.hpp +1 -1
- package/nitrogen/generated/shared/c++/ScanOptions.hpp +13 -5
- package/nitrogen/generated/shared/c++/ScanResult.hpp +25 -17
- package/package.json +5 -6
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// JBonjourFail.hpp
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
#pragma once
|
|
@@ -41,16 +41,15 @@ namespace margelo::nitro::dawidzawada_bonjourzeroconf {
|
|
|
41
41
|
[[maybe_unused]]
|
|
42
42
|
static jni::alias_ref<JBonjourFail> fromCpp(BonjourFail value) {
|
|
43
43
|
static const auto clazz = javaClassStatic();
|
|
44
|
-
static const auto fieldRESOLVE_FAILED = clazz->getStaticField<JBonjourFail>("RESOLVE_FAILED");
|
|
45
|
-
static const auto fieldEXTRACTION_FAILED = clazz->getStaticField<JBonjourFail>("EXTRACTION_FAILED");
|
|
46
|
-
static const auto fieldDISCOVERY_FAILED = clazz->getStaticField<JBonjourFail>("DISCOVERY_FAILED");
|
|
47
|
-
|
|
48
44
|
switch (value) {
|
|
49
45
|
case BonjourFail::RESOLVE_FAILED:
|
|
46
|
+
static const auto fieldRESOLVE_FAILED = clazz->getStaticField<JBonjourFail>("RESOLVE_FAILED");
|
|
50
47
|
return clazz->getStaticFieldValue(fieldRESOLVE_FAILED);
|
|
51
48
|
case BonjourFail::EXTRACTION_FAILED:
|
|
49
|
+
static const auto fieldEXTRACTION_FAILED = clazz->getStaticField<JBonjourFail>("EXTRACTION_FAILED");
|
|
52
50
|
return clazz->getStaticFieldValue(fieldEXTRACTION_FAILED);
|
|
53
51
|
case BonjourFail::DISCOVERY_FAILED:
|
|
52
|
+
static const auto fieldDISCOVERY_FAILED = clazz->getStaticField<JBonjourFail>("DISCOVERY_FAILED");
|
|
54
53
|
return clazz->getStaticFieldValue(fieldDISCOVERY_FAILED);
|
|
55
54
|
default:
|
|
56
55
|
std::string stringValue = std::to_string(static_cast<int>(value));
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// JBonjourListener.hpp
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
#pragma once
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
#include "BonjourListener.hpp"
|
|
12
12
|
|
|
13
13
|
#include "JFunc_void.hpp"
|
|
14
|
+
#include <NitroModules/JNICallable.hpp>
|
|
14
15
|
#include <functional>
|
|
15
16
|
|
|
16
17
|
namespace margelo::nitro::dawidzawada_bonjourzeroconf {
|
|
@@ -41,9 +42,7 @@ namespace margelo::nitro::dawidzawada_bonjourzeroconf {
|
|
|
41
42
|
return downcast->cthis()->getFunction();
|
|
42
43
|
} else {
|
|
43
44
|
auto removeRef = jni::make_global(remove);
|
|
44
|
-
return
|
|
45
|
-
return removeRef->invoke();
|
|
46
|
-
};
|
|
45
|
+
return JNICallable<JFunc_void, void()>(std::move(removeRef));
|
|
47
46
|
}
|
|
48
47
|
}()
|
|
49
48
|
);
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// JFunc_void.hpp
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
#pragma once
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
#include <functional>
|
|
12
12
|
|
|
13
13
|
#include <functional>
|
|
14
|
+
#include <NitroModules/JNICallable.hpp>
|
|
14
15
|
|
|
15
16
|
namespace margelo::nitro::dawidzawada_bonjourzeroconf {
|
|
16
17
|
|
|
@@ -37,7 +38,7 @@ namespace margelo::nitro::dawidzawada_bonjourzeroconf {
|
|
|
37
38
|
/**
|
|
38
39
|
* An implementation of Func_void that is backed by a C++ implementation (using `std::function<...>`)
|
|
39
40
|
*/
|
|
40
|
-
|
|
41
|
+
class JFunc_void_cxx final: public jni::HybridClass<JFunc_void_cxx, JFunc_void> {
|
|
41
42
|
public:
|
|
42
43
|
static jni::local_ref<JFunc_void::javaobject> fromCpp(const std::function<void()>& func) {
|
|
43
44
|
return JFunc_void_cxx::newObjectCxxArgs(func);
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// JFunc_void_BonjourFail.hpp
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
#pragma once
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|
#include "BonjourFail.hpp"
|
|
14
14
|
#include <functional>
|
|
15
|
+
#include <NitroModules/JNICallable.hpp>
|
|
15
16
|
#include "JBonjourFail.hpp"
|
|
16
17
|
|
|
17
18
|
namespace margelo::nitro::dawidzawada_bonjourzeroconf {
|
|
@@ -39,7 +40,7 @@ namespace margelo::nitro::dawidzawada_bonjourzeroconf {
|
|
|
39
40
|
/**
|
|
40
41
|
* An implementation of Func_void_BonjourFail that is backed by a C++ implementation (using `std::function<...>`)
|
|
41
42
|
*/
|
|
42
|
-
|
|
43
|
+
class JFunc_void_BonjourFail_cxx final: public jni::HybridClass<JFunc_void_BonjourFail_cxx, JFunc_void_BonjourFail> {
|
|
43
44
|
public:
|
|
44
45
|
static jni::local_ref<JFunc_void_BonjourFail::javaobject> fromCpp(const std::function<void(BonjourFail /* fail */)>& func) {
|
|
45
46
|
return JFunc_void_BonjourFail_cxx::newObjectCxxArgs(func);
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// JFunc_void_bool.hpp
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
#pragma once
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
#include <functional>
|
|
12
12
|
|
|
13
13
|
#include <functional>
|
|
14
|
+
#include <NitroModules/JNICallable.hpp>
|
|
14
15
|
|
|
15
16
|
namespace margelo::nitro::dawidzawada_bonjourzeroconf {
|
|
16
17
|
|
|
@@ -37,7 +38,7 @@ namespace margelo::nitro::dawidzawada_bonjourzeroconf {
|
|
|
37
38
|
/**
|
|
38
39
|
* An implementation of Func_void_bool that is backed by a C++ implementation (using `std::function<...>`)
|
|
39
40
|
*/
|
|
40
|
-
|
|
41
|
+
class JFunc_void_bool_cxx final: public jni::HybridClass<JFunc_void_bool_cxx, JFunc_void_bool> {
|
|
41
42
|
public:
|
|
42
43
|
static jni::local_ref<JFunc_void_bool::javaobject> fromCpp(const std::function<void(bool /* isScanning */)>& func) {
|
|
43
44
|
return JFunc_void_bool_cxx::newObjectCxxArgs(func);
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// JFunc_void_std__vector_ScanResult_.hpp
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
#pragma once
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
#include "ScanResult.hpp"
|
|
14
14
|
#include <vector>
|
|
15
15
|
#include <functional>
|
|
16
|
+
#include <NitroModules/JNICallable.hpp>
|
|
16
17
|
#include "JScanResult.hpp"
|
|
17
18
|
#include <string>
|
|
18
19
|
#include <optional>
|
|
@@ -51,7 +52,7 @@ namespace margelo::nitro::dawidzawada_bonjourzeroconf {
|
|
|
51
52
|
/**
|
|
52
53
|
* An implementation of Func_void_std__vector_ScanResult_ that is backed by a C++ implementation (using `std::function<...>`)
|
|
53
54
|
*/
|
|
54
|
-
|
|
55
|
+
class JFunc_void_std__vector_ScanResult__cxx final: public jni::HybridClass<JFunc_void_std__vector_ScanResult__cxx, JFunc_void_std__vector_ScanResult_> {
|
|
55
56
|
public:
|
|
56
57
|
static jni::local_ref<JFunc_void_std__vector_ScanResult_::javaobject> fromCpp(const std::function<void(const std::vector<ScanResult>& /* results */)>& func) {
|
|
57
58
|
return JFunc_void_std__vector_ScanResult__cxx::newObjectCxxArgs(func);
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// JHybridBonjourZeroconfSpec.cpp
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
#include "JHybridBonjourZeroconfSpec.hpp"
|
|
@@ -27,6 +27,7 @@ namespace margelo::nitro::dawidzawada_bonjourzeroconf { enum class BonjourFail;
|
|
|
27
27
|
#include "JBonjourListener.hpp"
|
|
28
28
|
#include <functional>
|
|
29
29
|
#include "JFunc_void.hpp"
|
|
30
|
+
#include <NitroModules/JNICallable.hpp>
|
|
30
31
|
#include "ScanOptions.hpp"
|
|
31
32
|
#include "JScanOptions.hpp"
|
|
32
33
|
#include "JFunc_void_std__vector_ScanResult_.hpp"
|
|
@@ -52,6 +53,13 @@ namespace margelo::nitro::dawidzawada_bonjourzeroconf {
|
|
|
52
53
|
return method(_javaPart);
|
|
53
54
|
}
|
|
54
55
|
|
|
56
|
+
bool JHybridBonjourZeroconfSpec::equals(const std::shared_ptr<HybridObject>& other) {
|
|
57
|
+
if (auto otherCast = std::dynamic_pointer_cast<JHybridBonjourZeroconfSpec>(other)) {
|
|
58
|
+
return _javaPart == otherCast->_javaPart;
|
|
59
|
+
}
|
|
60
|
+
return false;
|
|
61
|
+
}
|
|
62
|
+
|
|
55
63
|
void JHybridBonjourZeroconfSpec::dispose() noexcept {
|
|
56
64
|
static const auto method = javaClassStatic()->getMethod<void()>("dispose");
|
|
57
65
|
method(_javaPart);
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// HybridBonjourZeroconfSpec.hpp
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
#pragma once
|
|
@@ -40,6 +40,7 @@ namespace margelo::nitro::dawidzawada_bonjourzeroconf {
|
|
|
40
40
|
|
|
41
41
|
public:
|
|
42
42
|
size_t getExternalMemorySize() noexcept override;
|
|
43
|
+
bool equals(const std::shared_ptr<HybridObject>& other) override;
|
|
43
44
|
void dispose() noexcept override;
|
|
44
45
|
std::string toString() override;
|
|
45
46
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
# dawidzawada_bonjourzeroconf+autolinking.cmake
|
|
3
3
|
# This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
# https://github.com/mrousavy/nitro
|
|
5
|
-
# Copyright ©
|
|
5
|
+
# Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
#
|
|
7
7
|
|
|
8
8
|
# This is a CMake file that adds all files generated by Nitrogen
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// dawidzawada_bonjourzeroconf+autolinking.gradle
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
/// This is a Gradle file that adds all files generated by Nitrogen
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// dawidzawada_bonjourzeroconfOnLoad.cpp
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
#ifndef BUILDING_DAWIDZAWADABONJOURZEROCONF_WITH_GENERATED_CMAKE_PROJECT
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// BonjourFail.kt
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
package com.margelo.nitro.dawidzawada.bonjourzeroconf
|
|
@@ -19,4 +19,6 @@ enum class BonjourFail(@DoNotStrip @Keep val value: Int) {
|
|
|
19
19
|
RESOLVE_FAILED(0),
|
|
20
20
|
EXTRACTION_FAILED(1),
|
|
21
21
|
DISCOVERY_FAILED(2);
|
|
22
|
+
|
|
23
|
+
companion object
|
|
22
24
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// BonjourListener.kt
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
package com.margelo.nitro.dawidzawada.bonjourzeroconf
|
|
@@ -27,7 +27,7 @@ data class BonjourListener(
|
|
|
27
27
|
constructor(remove: () -> Unit):
|
|
28
28
|
this(Func_void_java(remove))
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
companion object {
|
|
31
31
|
/**
|
|
32
32
|
* Constructor called from C++
|
|
33
33
|
*/
|
package/nitrogen/generated/android/kotlin/com/margelo/nitro/dawidzawada/bonjourzeroconf/Func_void.kt
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// Func_void.kt
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
package com.margelo.nitro.dawidzawada.bonjourzeroconf
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// Func_void_BonjourFail.kt
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
package com.margelo.nitro.dawidzawada.bonjourzeroconf
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// Func_void_bool.kt
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
package com.margelo.nitro.dawidzawada.bonjourzeroconf
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// Func_void_std__vector_ScanResult_.kt
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
package com.margelo.nitro.dawidzawada.bonjourzeroconf
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// HybridBonjourZeroconfSpec.kt
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
package com.margelo.nitro.dawidzawada.bonjourzeroconf
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// ScanOptions.kt
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
package com.margelo.nitro.dawidzawada.bonjourzeroconf
|
|
@@ -23,7 +23,7 @@ data class ScanOptions(
|
|
|
23
23
|
) {
|
|
24
24
|
/* primary constructor */
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
companion object {
|
|
27
27
|
/**
|
|
28
28
|
* Constructor called from C++
|
|
29
29
|
*/
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// ScanResult.kt
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
package com.margelo.nitro.dawidzawada.bonjourzeroconf
|
|
@@ -35,7 +35,7 @@ data class ScanResult(
|
|
|
35
35
|
) {
|
|
36
36
|
/* primary constructor */
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
companion object {
|
|
39
39
|
/**
|
|
40
40
|
* Constructor called from C++
|
|
41
41
|
*/
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// dawidzawada_bonjourzeroconfOnLoad.kt
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
package com.margelo.nitro.dawidzawada.bonjourzeroconf
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
# BonjourZeroconf+autolinking.rb
|
|
3
3
|
# This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
# https://github.com/mrousavy/nitro
|
|
5
|
-
# Copyright ©
|
|
5
|
+
# Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
#
|
|
7
7
|
|
|
8
8
|
# This is a Ruby script that adds all files generated by Nitrogen
|
|
@@ -52,7 +52,7 @@ def add_nitrogen_files(spec)
|
|
|
52
52
|
spec.pod_target_xcconfig = current_pod_target_xcconfig.merge({
|
|
53
53
|
# Use C++ 20
|
|
54
54
|
"CLANG_CXX_LANGUAGE_STANDARD" => "c++20",
|
|
55
|
-
# Enables C++ <-> Swift interop (by default it's only
|
|
55
|
+
# Enables C++ <-> Swift interop (by default it's only ObjC)
|
|
56
56
|
"SWIFT_OBJC_INTEROP_MODE" => "objcxx",
|
|
57
57
|
# Enables stricter modular headers
|
|
58
58
|
"DEFINES_MODULE" => "YES",
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// BonjourZeroconf-Swift-Cxx-Bridge.cpp
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
#include "BonjourZeroconf-Swift-Cxx-Bridge.hpp"
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// BonjourZeroconfAutolinking.mm
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
#import <Foundation/Foundation.h>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// BonjourZeroconfAutolinking.swift
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
public final class BonjourZeroconfAutolinking {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// HybridBonjourZeroconfSpecSwift.cpp
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
#include "HybridBonjourZeroconfSpecSwift.hpp"
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// HybridBonjourZeroconfSpecSwift.hpp
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
#pragma once
|
|
@@ -62,6 +62,12 @@ namespace margelo::nitro::dawidzawada_bonjourzeroconf {
|
|
|
62
62
|
inline size_t getExternalMemorySize() noexcept override {
|
|
63
63
|
return _swiftPart.getMemorySize();
|
|
64
64
|
}
|
|
65
|
+
bool equals(const std::shared_ptr<HybridObject>& other) override {
|
|
66
|
+
if (auto otherCast = std::dynamic_pointer_cast<HybridBonjourZeroconfSpecSwift>(other)) {
|
|
67
|
+
return _swiftPart.equals(otherCast->_swiftPart);
|
|
68
|
+
}
|
|
69
|
+
return false;
|
|
70
|
+
}
|
|
65
71
|
void dispose() noexcept override {
|
|
66
72
|
_swiftPart.dispose();
|
|
67
73
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// HybridLocalNetworkPermissionSpecSwift.cpp
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
#include "HybridLocalNetworkPermissionSpecSwift.hpp"
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// HybridLocalNetworkPermissionSpecSwift.hpp
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
#pragma once
|
|
@@ -50,6 +50,12 @@ namespace margelo::nitro::dawidzawada_bonjourzeroconf {
|
|
|
50
50
|
inline size_t getExternalMemorySize() noexcept override {
|
|
51
51
|
return _swiftPart.getMemorySize();
|
|
52
52
|
}
|
|
53
|
+
bool equals(const std::shared_ptr<HybridObject>& other) override {
|
|
54
|
+
if (auto otherCast = std::dynamic_pointer_cast<HybridLocalNetworkPermissionSpecSwift>(other)) {
|
|
55
|
+
return _swiftPart.equals(otherCast->_swiftPart);
|
|
56
|
+
}
|
|
57
|
+
return false;
|
|
58
|
+
}
|
|
53
59
|
void dispose() noexcept override {
|
|
54
60
|
_swiftPart.dispose();
|
|
55
61
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// BonjourListener.swift
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
import Foundation
|
|
@@ -26,22 +26,13 @@ public extension BonjourListener {
|
|
|
26
26
|
}())
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
+
@inline(__always)
|
|
29
30
|
var remove: () -> Void {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
return { () ->
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
37
|
-
}()
|
|
38
|
-
}
|
|
39
|
-
@inline(__always)
|
|
40
|
-
set {
|
|
41
|
-
self.__remove = { () -> bridge.Func_void in
|
|
42
|
-
let __closureWrapper = Func_void(newValue)
|
|
43
|
-
return bridge.create_Func_void(__closureWrapper.toUnsafe())
|
|
44
|
-
}()
|
|
45
|
-
}
|
|
31
|
+
return { () -> () -> Void in
|
|
32
|
+
let __wrappedFunction = bridge.wrap_Func_void(self.__remove)
|
|
33
|
+
return { () -> Void in
|
|
34
|
+
__wrappedFunction.call()
|
|
35
|
+
}
|
|
36
|
+
}()
|
|
46
37
|
}
|
|
47
38
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// Func_void_std__vector_ScanResult_.swift
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
import Foundation
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// HybridBonjourZeroconfSpec_cxx.swift
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
import Foundation
|
|
@@ -96,6 +96,14 @@ open class HybridBonjourZeroconfSpec_cxx {
|
|
|
96
96
|
return MemoryHelper.getSizeOf(self.__implementation) + self.__implementation.memorySize
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
+
/**
|
|
100
|
+
* Compares this object with the given [other] object for reference equality.
|
|
101
|
+
*/
|
|
102
|
+
@inline(__always)
|
|
103
|
+
public func equals(other: HybridBonjourZeroconfSpec_cxx) -> Bool {
|
|
104
|
+
return self.__implementation === other.__implementation
|
|
105
|
+
}
|
|
106
|
+
|
|
99
107
|
/**
|
|
100
108
|
* Call dispose() on the Swift class.
|
|
101
109
|
* This _may_ be called manually from JS.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// HybridLocalNetworkPermissionSpec_cxx.swift
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
import Foundation
|
|
@@ -96,6 +96,14 @@ open class HybridLocalNetworkPermissionSpec_cxx {
|
|
|
96
96
|
return MemoryHelper.getSizeOf(self.__implementation) + self.__implementation.memorySize
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
+
/**
|
|
100
|
+
* Compares this object with the given [other] object for reference equality.
|
|
101
|
+
*/
|
|
102
|
+
@inline(__always)
|
|
103
|
+
public func equals(other: HybridLocalNetworkPermissionSpec_cxx) -> Bool {
|
|
104
|
+
return self.__implementation === other.__implementation
|
|
105
|
+
}
|
|
106
|
+
|
|
99
107
|
/**
|
|
100
108
|
* Call dispose() on the Swift class.
|
|
101
109
|
* This _may_ be called manually from JS.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// ScanOptions.swift
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
import Foundation
|
|
@@ -29,20 +29,8 @@ public extension ScanOptions {
|
|
|
29
29
|
}())
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
+
@inline(__always)
|
|
32
33
|
var addressResolveTimeout: Double? {
|
|
33
|
-
|
|
34
|
-
get {
|
|
35
|
-
return self.__addressResolveTimeout.value
|
|
36
|
-
}
|
|
37
|
-
@inline(__always)
|
|
38
|
-
set {
|
|
39
|
-
self.__addressResolveTimeout = { () -> bridge.std__optional_double_ in
|
|
40
|
-
if let __unwrappedValue = newValue {
|
|
41
|
-
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
42
|
-
} else {
|
|
43
|
-
return .init()
|
|
44
|
-
}
|
|
45
|
-
}()
|
|
46
|
-
}
|
|
34
|
+
return self.__addressResolveTimeout.value
|
|
47
35
|
}
|
|
48
36
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// ScanResult.swift
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
import Foundation
|
|
@@ -47,103 +47,49 @@ public extension ScanResult {
|
|
|
47
47
|
}())
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
+
@inline(__always)
|
|
50
51
|
var name: String {
|
|
51
|
-
|
|
52
|
-
get {
|
|
53
|
-
return String(self.__name)
|
|
54
|
-
}
|
|
55
|
-
@inline(__always)
|
|
56
|
-
set {
|
|
57
|
-
self.__name = std.string(newValue)
|
|
58
|
-
}
|
|
52
|
+
return String(self.__name)
|
|
59
53
|
}
|
|
60
54
|
|
|
55
|
+
@inline(__always)
|
|
61
56
|
var ipv4: String? {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
}
|
|
71
|
-
}()
|
|
72
|
-
}
|
|
73
|
-
@inline(__always)
|
|
74
|
-
set {
|
|
75
|
-
self.__ipv4 = { () -> bridge.std__optional_std__string_ in
|
|
76
|
-
if let __unwrappedValue = newValue {
|
|
77
|
-
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
78
|
-
} else {
|
|
79
|
-
return .init()
|
|
80
|
-
}
|
|
81
|
-
}()
|
|
82
|
-
}
|
|
57
|
+
return { () -> String? in
|
|
58
|
+
if bridge.has_value_std__optional_std__string_(self.__ipv4) {
|
|
59
|
+
let __unwrapped = bridge.get_std__optional_std__string_(self.__ipv4)
|
|
60
|
+
return String(__unwrapped)
|
|
61
|
+
} else {
|
|
62
|
+
return nil
|
|
63
|
+
}
|
|
64
|
+
}()
|
|
83
65
|
}
|
|
84
66
|
|
|
67
|
+
@inline(__always)
|
|
85
68
|
var ipv6: String? {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
}
|
|
95
|
-
}()
|
|
96
|
-
}
|
|
97
|
-
@inline(__always)
|
|
98
|
-
set {
|
|
99
|
-
self.__ipv6 = { () -> bridge.std__optional_std__string_ in
|
|
100
|
-
if let __unwrappedValue = newValue {
|
|
101
|
-
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
102
|
-
} else {
|
|
103
|
-
return .init()
|
|
104
|
-
}
|
|
105
|
-
}()
|
|
106
|
-
}
|
|
69
|
+
return { () -> String? in
|
|
70
|
+
if bridge.has_value_std__optional_std__string_(self.__ipv6) {
|
|
71
|
+
let __unwrapped = bridge.get_std__optional_std__string_(self.__ipv6)
|
|
72
|
+
return String(__unwrapped)
|
|
73
|
+
} else {
|
|
74
|
+
return nil
|
|
75
|
+
}
|
|
76
|
+
}()
|
|
107
77
|
}
|
|
108
78
|
|
|
79
|
+
@inline(__always)
|
|
109
80
|
var hostname: String? {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
}
|
|
119
|
-
}()
|
|
120
|
-
}
|
|
121
|
-
@inline(__always)
|
|
122
|
-
set {
|
|
123
|
-
self.__hostname = { () -> bridge.std__optional_std__string_ in
|
|
124
|
-
if let __unwrappedValue = newValue {
|
|
125
|
-
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
126
|
-
} else {
|
|
127
|
-
return .init()
|
|
128
|
-
}
|
|
129
|
-
}()
|
|
130
|
-
}
|
|
81
|
+
return { () -> String? in
|
|
82
|
+
if bridge.has_value_std__optional_std__string_(self.__hostname) {
|
|
83
|
+
let __unwrapped = bridge.get_std__optional_std__string_(self.__hostname)
|
|
84
|
+
return String(__unwrapped)
|
|
85
|
+
} else {
|
|
86
|
+
return nil
|
|
87
|
+
}
|
|
88
|
+
}()
|
|
131
89
|
}
|
|
132
90
|
|
|
91
|
+
@inline(__always)
|
|
133
92
|
var port: Double? {
|
|
134
|
-
|
|
135
|
-
get {
|
|
136
|
-
return self.__port.value
|
|
137
|
-
}
|
|
138
|
-
@inline(__always)
|
|
139
|
-
set {
|
|
140
|
-
self.__port = { () -> bridge.std__optional_double_ in
|
|
141
|
-
if let __unwrappedValue = newValue {
|
|
142
|
-
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
143
|
-
} else {
|
|
144
|
-
return .init()
|
|
145
|
-
}
|
|
146
|
-
}()
|
|
147
|
-
}
|
|
93
|
+
return self.__port.value
|
|
148
94
|
}
|
|
149
95
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// BonjourListener.hpp
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
#pragma once
|
|
@@ -22,6 +22,11 @@
|
|
|
22
22
|
#else
|
|
23
23
|
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
24
24
|
#endif
|
|
25
|
+
#if __has_include(<NitroModules/PropNameIDCache.hpp>)
|
|
26
|
+
#include <NitroModules/PropNameIDCache.hpp>
|
|
27
|
+
#else
|
|
28
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
29
|
+
#endif
|
|
25
30
|
|
|
26
31
|
|
|
27
32
|
|
|
@@ -32,13 +37,16 @@ namespace margelo::nitro::dawidzawada_bonjourzeroconf {
|
|
|
32
37
|
/**
|
|
33
38
|
* A struct which can be represented as a JavaScript object (BonjourListener).
|
|
34
39
|
*/
|
|
35
|
-
struct BonjourListener {
|
|
40
|
+
struct BonjourListener final {
|
|
36
41
|
public:
|
|
37
42
|
std::function<void()> remove SWIFT_PRIVATE;
|
|
38
43
|
|
|
39
44
|
public:
|
|
40
45
|
BonjourListener() = default;
|
|
41
46
|
explicit BonjourListener(std::function<void()> remove): remove(remove) {}
|
|
47
|
+
|
|
48
|
+
public:
|
|
49
|
+
// BonjourListener is not equatable because these properties are not equatable: remove
|
|
42
50
|
};
|
|
43
51
|
|
|
44
52
|
} // namespace margelo::nitro::dawidzawada_bonjourzeroconf
|
|
@@ -51,12 +59,12 @@ namespace margelo::nitro {
|
|
|
51
59
|
static inline margelo::nitro::dawidzawada_bonjourzeroconf::BonjourListener fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
52
60
|
jsi::Object obj = arg.asObject(runtime);
|
|
53
61
|
return margelo::nitro::dawidzawada_bonjourzeroconf::BonjourListener(
|
|
54
|
-
JSIConverter<std::function<void()>>::fromJSI(runtime, obj.getProperty(runtime, "remove"))
|
|
62
|
+
JSIConverter<std::function<void()>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "remove")))
|
|
55
63
|
);
|
|
56
64
|
}
|
|
57
65
|
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::dawidzawada_bonjourzeroconf::BonjourListener& arg) {
|
|
58
66
|
jsi::Object obj(runtime);
|
|
59
|
-
obj.setProperty(runtime, "remove", JSIConverter<std::function<void()>>::toJSI(runtime, arg.remove));
|
|
67
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "remove"), JSIConverter<std::function<void()>>::toJSI(runtime, arg.remove));
|
|
60
68
|
return obj;
|
|
61
69
|
}
|
|
62
70
|
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
@@ -67,7 +75,7 @@ namespace margelo::nitro {
|
|
|
67
75
|
if (!nitro::isPlainObject(runtime, obj)) {
|
|
68
76
|
return false;
|
|
69
77
|
}
|
|
70
|
-
if (!JSIConverter<std::function<void()>>::canConvert(runtime, obj.getProperty(runtime, "remove"))) return false;
|
|
78
|
+
if (!JSIConverter<std::function<void()>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "remove")))) return false;
|
|
71
79
|
return true;
|
|
72
80
|
}
|
|
73
81
|
};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// HybridBonjourZeroconfSpec.cpp
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
#include "HybridBonjourZeroconfSpec.hpp"
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// HybridLocalNetworkPermissionSpec.cpp
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
#include "HybridLocalNetworkPermissionSpec.hpp"
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// ScanOptions.hpp
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
#pragma once
|
|
@@ -22,6 +22,11 @@
|
|
|
22
22
|
#else
|
|
23
23
|
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
24
24
|
#endif
|
|
25
|
+
#if __has_include(<NitroModules/PropNameIDCache.hpp>)
|
|
26
|
+
#include <NitroModules/PropNameIDCache.hpp>
|
|
27
|
+
#else
|
|
28
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
29
|
+
#endif
|
|
25
30
|
|
|
26
31
|
|
|
27
32
|
|
|
@@ -32,13 +37,16 @@ namespace margelo::nitro::dawidzawada_bonjourzeroconf {
|
|
|
32
37
|
/**
|
|
33
38
|
* A struct which can be represented as a JavaScript object (ScanOptions).
|
|
34
39
|
*/
|
|
35
|
-
struct ScanOptions {
|
|
40
|
+
struct ScanOptions final {
|
|
36
41
|
public:
|
|
37
42
|
std::optional<double> addressResolveTimeout SWIFT_PRIVATE;
|
|
38
43
|
|
|
39
44
|
public:
|
|
40
45
|
ScanOptions() = default;
|
|
41
46
|
explicit ScanOptions(std::optional<double> addressResolveTimeout): addressResolveTimeout(addressResolveTimeout) {}
|
|
47
|
+
|
|
48
|
+
public:
|
|
49
|
+
friend bool operator==(const ScanOptions& lhs, const ScanOptions& rhs) = default;
|
|
42
50
|
};
|
|
43
51
|
|
|
44
52
|
} // namespace margelo::nitro::dawidzawada_bonjourzeroconf
|
|
@@ -51,12 +59,12 @@ namespace margelo::nitro {
|
|
|
51
59
|
static inline margelo::nitro::dawidzawada_bonjourzeroconf::ScanOptions fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
52
60
|
jsi::Object obj = arg.asObject(runtime);
|
|
53
61
|
return margelo::nitro::dawidzawada_bonjourzeroconf::ScanOptions(
|
|
54
|
-
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, "addressResolveTimeout"))
|
|
62
|
+
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "addressResolveTimeout")))
|
|
55
63
|
);
|
|
56
64
|
}
|
|
57
65
|
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::dawidzawada_bonjourzeroconf::ScanOptions& arg) {
|
|
58
66
|
jsi::Object obj(runtime);
|
|
59
|
-
obj.setProperty(runtime, "addressResolveTimeout", JSIConverter<std::optional<double>>::toJSI(runtime, arg.addressResolveTimeout));
|
|
67
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "addressResolveTimeout"), JSIConverter<std::optional<double>>::toJSI(runtime, arg.addressResolveTimeout));
|
|
60
68
|
return obj;
|
|
61
69
|
}
|
|
62
70
|
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
@@ -67,7 +75,7 @@ namespace margelo::nitro {
|
|
|
67
75
|
if (!nitro::isPlainObject(runtime, obj)) {
|
|
68
76
|
return false;
|
|
69
77
|
}
|
|
70
|
-
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "addressResolveTimeout"))) return false;
|
|
78
|
+
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "addressResolveTimeout")))) return false;
|
|
71
79
|
return true;
|
|
72
80
|
}
|
|
73
81
|
};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// ScanResult.hpp
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
#pragma once
|
|
@@ -22,6 +22,11 @@
|
|
|
22
22
|
#else
|
|
23
23
|
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
24
24
|
#endif
|
|
25
|
+
#if __has_include(<NitroModules/PropNameIDCache.hpp>)
|
|
26
|
+
#include <NitroModules/PropNameIDCache.hpp>
|
|
27
|
+
#else
|
|
28
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
29
|
+
#endif
|
|
25
30
|
|
|
26
31
|
|
|
27
32
|
|
|
@@ -33,7 +38,7 @@ namespace margelo::nitro::dawidzawada_bonjourzeroconf {
|
|
|
33
38
|
/**
|
|
34
39
|
* A struct which can be represented as a JavaScript object (ScanResult).
|
|
35
40
|
*/
|
|
36
|
-
struct ScanResult {
|
|
41
|
+
struct ScanResult final {
|
|
37
42
|
public:
|
|
38
43
|
std::string name SWIFT_PRIVATE;
|
|
39
44
|
std::optional<std::string> ipv4 SWIFT_PRIVATE;
|
|
@@ -44,6 +49,9 @@ namespace margelo::nitro::dawidzawada_bonjourzeroconf {
|
|
|
44
49
|
public:
|
|
45
50
|
ScanResult() = default;
|
|
46
51
|
explicit ScanResult(std::string name, std::optional<std::string> ipv4, std::optional<std::string> ipv6, std::optional<std::string> hostname, std::optional<double> port): name(name), ipv4(ipv4), ipv6(ipv6), hostname(hostname), port(port) {}
|
|
52
|
+
|
|
53
|
+
public:
|
|
54
|
+
friend bool operator==(const ScanResult& lhs, const ScanResult& rhs) = default;
|
|
47
55
|
};
|
|
48
56
|
|
|
49
57
|
} // namespace margelo::nitro::dawidzawada_bonjourzeroconf
|
|
@@ -56,20 +64,20 @@ namespace margelo::nitro {
|
|
|
56
64
|
static inline margelo::nitro::dawidzawada_bonjourzeroconf::ScanResult fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
57
65
|
jsi::Object obj = arg.asObject(runtime);
|
|
58
66
|
return margelo::nitro::dawidzawada_bonjourzeroconf::ScanResult(
|
|
59
|
-
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "name")),
|
|
60
|
-
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "ipv4")),
|
|
61
|
-
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "ipv6")),
|
|
62
|
-
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "hostname")),
|
|
63
|
-
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, "port"))
|
|
67
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "name"))),
|
|
68
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "ipv4"))),
|
|
69
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "ipv6"))),
|
|
70
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "hostname"))),
|
|
71
|
+
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "port")))
|
|
64
72
|
);
|
|
65
73
|
}
|
|
66
74
|
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::dawidzawada_bonjourzeroconf::ScanResult& arg) {
|
|
67
75
|
jsi::Object obj(runtime);
|
|
68
|
-
obj.setProperty(runtime, "name", JSIConverter<std::string>::toJSI(runtime, arg.name));
|
|
69
|
-
obj.setProperty(runtime, "ipv4", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.ipv4));
|
|
70
|
-
obj.setProperty(runtime, "ipv6", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.ipv6));
|
|
71
|
-
obj.setProperty(runtime, "hostname", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.hostname));
|
|
72
|
-
obj.setProperty(runtime, "port", JSIConverter<std::optional<double>>::toJSI(runtime, arg.port));
|
|
76
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "name"), JSIConverter<std::string>::toJSI(runtime, arg.name));
|
|
77
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "ipv4"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.ipv4));
|
|
78
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "ipv6"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.ipv6));
|
|
79
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "hostname"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.hostname));
|
|
80
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "port"), JSIConverter<std::optional<double>>::toJSI(runtime, arg.port));
|
|
73
81
|
return obj;
|
|
74
82
|
}
|
|
75
83
|
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
@@ -80,11 +88,11 @@ namespace margelo::nitro {
|
|
|
80
88
|
if (!nitro::isPlainObject(runtime, obj)) {
|
|
81
89
|
return false;
|
|
82
90
|
}
|
|
83
|
-
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "name"))) return false;
|
|
84
|
-
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "ipv4"))) return false;
|
|
85
|
-
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "ipv6"))) return false;
|
|
86
|
-
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "hostname"))) return false;
|
|
87
|
-
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "port"))) return false;
|
|
91
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "name")))) return false;
|
|
92
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "ipv4")))) return false;
|
|
93
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "ipv6")))) return false;
|
|
94
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "hostname")))) return false;
|
|
95
|
+
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "port")))) return false;
|
|
88
96
|
return true;
|
|
89
97
|
}
|
|
90
98
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dawidzawada/bonjour-zeroconf",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0-alpha.0",
|
|
4
4
|
"description": "React Native Zeroconf scanner using Bonjour (iOS) and NSD (Android). Powered by Nitro Modules.",
|
|
5
5
|
"main": "./lib/module/index.js",
|
|
6
6
|
"types": "./lib/typescript/src/index.d.ts",
|
|
@@ -95,12 +95,12 @@
|
|
|
95
95
|
"eslint-config-prettier": "^10.1.8",
|
|
96
96
|
"eslint-plugin-prettier": "^5.5.4",
|
|
97
97
|
"jest": "^29.7.0",
|
|
98
|
-
"nitrogen": "0.
|
|
98
|
+
"nitrogen": "0.32.1",
|
|
99
99
|
"prettier": "^3.6.2",
|
|
100
100
|
"react": "19.1.0",
|
|
101
101
|
"react-native": "0.81.1",
|
|
102
102
|
"react-native-builder-bob": "^0.40.13",
|
|
103
|
-
"react-native-nitro-modules": "0.
|
|
103
|
+
"react-native-nitro-modules": "0.32.1",
|
|
104
104
|
"release-it": "^19.0.4",
|
|
105
105
|
"turbo": "^2.5.6",
|
|
106
106
|
"typescript": "^5.9.2"
|
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
"peerDependencies": {
|
|
109
109
|
"react": "*",
|
|
110
110
|
"react-native": "*",
|
|
111
|
-
"react-native-nitro-modules": "0.
|
|
111
|
+
"react-native-nitro-modules": "0.32.1"
|
|
112
112
|
},
|
|
113
113
|
"workspaces": [
|
|
114
114
|
"example"
|
|
@@ -159,8 +159,7 @@
|
|
|
159
159
|
[
|
|
160
160
|
"custom",
|
|
161
161
|
{
|
|
162
|
-
"script": "nitrogen"
|
|
163
|
-
"clean": "nitrogen/"
|
|
162
|
+
"script": "nitrogen"
|
|
164
163
|
}
|
|
165
164
|
],
|
|
166
165
|
[
|