@inoxialabs/react-native-nitro-location-geocoder 0.1.0 → 1.0.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/NitroLocationGeocoder.podspec +28 -28
- package/README.md +118 -78
- package/android/CMakeLists.txt +25 -25
- package/android/build.gradle +129 -129
- package/android/fix-prefab.gradle +44 -44
- package/android/gradle.properties +5 -5
- package/android/src/main/AndroidManifest.xml +2 -2
- package/android/src/main/cpp/cpp-adapter.cpp +6 -6
- package/android/src/main/java/com/margelo/nitro/locationgeocoder/HybridLocationGeocoder.kt +85 -57
- package/android/src/main/java/com/margelo/nitro/locationgeocoder/NitroLocationGeocoderPackage.kt +18 -18
- package/ios/Bridge.h +1 -1
- package/ios/HybridLocationGeocoder.swift +62 -19
- package/nitro.json +24 -24
- package/nitrogen/generated/.gitattributes +1 -1
- package/nitrogen/generated/android/NitroLocationGeocoder+autolinking.cmake +81 -81
- package/nitrogen/generated/android/NitroLocationGeocoder+autolinking.gradle +27 -27
- package/nitrogen/generated/android/NitroLocationGeocoderOnLoad.cpp +54 -54
- package/nitrogen/generated/android/NitroLocationGeocoderOnLoad.hpp +34 -34
- package/nitrogen/generated/android/c++/JHybridLocationGeocoderSpec.cpp +69 -69
- package/nitrogen/generated/android/c++/JHybridLocationGeocoderSpec.hpp +63 -63
- package/nitrogen/generated/android/c++/JLocationGeocoderResult.hpp +77 -77
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/locationgeocoder/HybridLocationGeocoderSpec.kt +55 -55
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/locationgeocoder/LocationGeocoderResult.kt +53 -53
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/locationgeocoder/NitroLocationGeocoderOnLoad.kt +35 -35
- package/nitrogen/generated/ios/NitroLocationGeocoder+autolinking.rb +60 -60
- package/nitrogen/generated/ios/NitroLocationGeocoder-Swift-Cxx-Bridge.cpp +49 -49
- package/nitrogen/generated/ios/NitroLocationGeocoder-Swift-Cxx-Bridge.hpp +114 -114
- package/nitrogen/generated/ios/NitroLocationGeocoder-Swift-Cxx-Umbrella.hpp +48 -48
- package/nitrogen/generated/ios/NitroLocationGeocoderAutolinking.mm +33 -33
- package/nitrogen/generated/ios/NitroLocationGeocoderAutolinking.swift +26 -26
- package/nitrogen/generated/ios/c++/HybridLocationGeocoderSpecSwift.cpp +11 -11
- package/nitrogen/generated/ios/c++/HybridLocationGeocoderSpecSwift.hpp +85 -85
- package/nitrogen/generated/ios/swift/Func_void_LocationGeocoderResult.swift +46 -46
- package/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +46 -46
- package/nitrogen/generated/ios/swift/HybridLocationGeocoderSpec.swift +55 -55
- package/nitrogen/generated/ios/swift/HybridLocationGeocoderSpec_cxx.swift +145 -145
- package/nitrogen/generated/ios/swift/LocationGeocoderResult.swift +54 -54
- package/nitrogen/generated/shared/c++/HybridLocationGeocoderSpec.cpp +21 -21
- package/nitrogen/generated/shared/c++/HybridLocationGeocoderSpec.hpp +65 -65
- package/nitrogen/generated/shared/c++/LocationGeocoderResult.hpp +103 -103
- package/package.json +65 -65
- package/react-native.config.js +8 -8
- package/src/index.ts +39 -7
- package/src/specs/LocationGeocoder.nitro.ts +14 -14
|
@@ -1,55 +1,55 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// HybridLocationGeocoderSpec.kt
|
|
3
|
-
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
-
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
-
///
|
|
7
|
-
|
|
8
|
-
package com.margelo.nitro.locationgeocoder
|
|
9
|
-
|
|
10
|
-
import androidx.annotation.Keep
|
|
11
|
-
import com.facebook.jni.HybridData
|
|
12
|
-
import com.facebook.proguard.annotations.DoNotStrip
|
|
13
|
-
import com.margelo.nitro.core.Promise
|
|
14
|
-
import com.margelo.nitro.core.HybridObject
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* A Kotlin class representing the LocationGeocoder HybridObject.
|
|
18
|
-
* Implement this abstract class to create Kotlin-based instances of LocationGeocoder.
|
|
19
|
-
*/
|
|
20
|
-
@DoNotStrip
|
|
21
|
-
@Keep
|
|
22
|
-
@Suppress(
|
|
23
|
-
"KotlinJniMissingFunction", "unused",
|
|
24
|
-
"RedundantSuppression", "RedundantUnitReturnType", "SimpleRedundantLet",
|
|
25
|
-
"LocalVariableName", "PropertyName", "PrivatePropertyName", "FunctionName"
|
|
26
|
-
)
|
|
27
|
-
abstract class HybridLocationGeocoderSpec: HybridObject() {
|
|
28
|
-
// Properties
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
// Methods
|
|
32
|
-
@DoNotStrip
|
|
33
|
-
@Keep
|
|
34
|
-
abstract fun reverseGeocode(latitude: Double, longitude: Double, locale: String): Promise<LocationGeocoderResult>
|
|
35
|
-
|
|
36
|
-
// Default implementation of `HybridObject.toString()`
|
|
37
|
-
override fun toString(): String {
|
|
38
|
-
return "[HybridObject LocationGeocoder]"
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
// C++ backing class
|
|
42
|
-
@DoNotStrip
|
|
43
|
-
@Keep
|
|
44
|
-
protected open class CxxPart(javaPart: HybridLocationGeocoderSpec): HybridObject.CxxPart(javaPart) {
|
|
45
|
-
// C++ JHybridLocationGeocoderSpec::CxxPart::initHybrid(...)
|
|
46
|
-
external override fun initHybrid(): HybridData
|
|
47
|
-
}
|
|
48
|
-
override fun createCxxPart(): CxxPart {
|
|
49
|
-
return CxxPart(this)
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
companion object {
|
|
53
|
-
protected const val TAG = "HybridLocationGeocoderSpec"
|
|
54
|
-
}
|
|
55
|
-
}
|
|
1
|
+
///
|
|
2
|
+
/// HybridLocationGeocoderSpec.kt
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
package com.margelo.nitro.locationgeocoder
|
|
9
|
+
|
|
10
|
+
import androidx.annotation.Keep
|
|
11
|
+
import com.facebook.jni.HybridData
|
|
12
|
+
import com.facebook.proguard.annotations.DoNotStrip
|
|
13
|
+
import com.margelo.nitro.core.Promise
|
|
14
|
+
import com.margelo.nitro.core.HybridObject
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* A Kotlin class representing the LocationGeocoder HybridObject.
|
|
18
|
+
* Implement this abstract class to create Kotlin-based instances of LocationGeocoder.
|
|
19
|
+
*/
|
|
20
|
+
@DoNotStrip
|
|
21
|
+
@Keep
|
|
22
|
+
@Suppress(
|
|
23
|
+
"KotlinJniMissingFunction", "unused",
|
|
24
|
+
"RedundantSuppression", "RedundantUnitReturnType", "SimpleRedundantLet",
|
|
25
|
+
"LocalVariableName", "PropertyName", "PrivatePropertyName", "FunctionName"
|
|
26
|
+
)
|
|
27
|
+
abstract class HybridLocationGeocoderSpec: HybridObject() {
|
|
28
|
+
// Properties
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
// Methods
|
|
32
|
+
@DoNotStrip
|
|
33
|
+
@Keep
|
|
34
|
+
abstract fun reverseGeocode(latitude: Double, longitude: Double, locale: String): Promise<LocationGeocoderResult>
|
|
35
|
+
|
|
36
|
+
// Default implementation of `HybridObject.toString()`
|
|
37
|
+
override fun toString(): String {
|
|
38
|
+
return "[HybridObject LocationGeocoder]"
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// C++ backing class
|
|
42
|
+
@DoNotStrip
|
|
43
|
+
@Keep
|
|
44
|
+
protected open class CxxPart(javaPart: HybridLocationGeocoderSpec): HybridObject.CxxPart(javaPart) {
|
|
45
|
+
// C++ JHybridLocationGeocoderSpec::CxxPart::initHybrid(...)
|
|
46
|
+
external override fun initHybrid(): HybridData
|
|
47
|
+
}
|
|
48
|
+
override fun createCxxPart(): CxxPart {
|
|
49
|
+
return CxxPart(this)
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
companion object {
|
|
53
|
+
protected const val TAG = "HybridLocationGeocoderSpec"
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -1,53 +1,53 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// LocationGeocoderResult.kt
|
|
3
|
-
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
-
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
-
///
|
|
7
|
-
|
|
8
|
-
package com.margelo.nitro.locationgeocoder
|
|
9
|
-
|
|
10
|
-
import androidx.annotation.Keep
|
|
11
|
-
import com.facebook.proguard.annotations.DoNotStrip
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Represents the JavaScript object/struct "LocationGeocoderResult".
|
|
16
|
-
*/
|
|
17
|
-
@DoNotStrip
|
|
18
|
-
@Keep
|
|
19
|
-
data class LocationGeocoderResult(
|
|
20
|
-
@DoNotStrip
|
|
21
|
-
@Keep
|
|
22
|
-
val countryCode: String,
|
|
23
|
-
@DoNotStrip
|
|
24
|
-
@Keep
|
|
25
|
-
val country: String,
|
|
26
|
-
@DoNotStrip
|
|
27
|
-
@Keep
|
|
28
|
-
val locality: String,
|
|
29
|
-
@DoNotStrip
|
|
30
|
-
@Keep
|
|
31
|
-
val administrativeArea: String,
|
|
32
|
-
@DoNotStrip
|
|
33
|
-
@Keep
|
|
34
|
-
val subAdministrativeArea: String,
|
|
35
|
-
@DoNotStrip
|
|
36
|
-
@Keep
|
|
37
|
-
val subLocality: String
|
|
38
|
-
) {
|
|
39
|
-
/* primary constructor */
|
|
40
|
-
|
|
41
|
-
companion object {
|
|
42
|
-
/**
|
|
43
|
-
* Constructor called from C++
|
|
44
|
-
*/
|
|
45
|
-
@DoNotStrip
|
|
46
|
-
@Keep
|
|
47
|
-
@Suppress("unused")
|
|
48
|
-
@JvmStatic
|
|
49
|
-
private fun fromCpp(countryCode: String, country: String, locality: String, administrativeArea: String, subAdministrativeArea: String, subLocality: String): LocationGeocoderResult {
|
|
50
|
-
return LocationGeocoderResult(countryCode, country, locality, administrativeArea, subAdministrativeArea, subLocality)
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
}
|
|
1
|
+
///
|
|
2
|
+
/// LocationGeocoderResult.kt
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
package com.margelo.nitro.locationgeocoder
|
|
9
|
+
|
|
10
|
+
import androidx.annotation.Keep
|
|
11
|
+
import com.facebook.proguard.annotations.DoNotStrip
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Represents the JavaScript object/struct "LocationGeocoderResult".
|
|
16
|
+
*/
|
|
17
|
+
@DoNotStrip
|
|
18
|
+
@Keep
|
|
19
|
+
data class LocationGeocoderResult(
|
|
20
|
+
@DoNotStrip
|
|
21
|
+
@Keep
|
|
22
|
+
val countryCode: String,
|
|
23
|
+
@DoNotStrip
|
|
24
|
+
@Keep
|
|
25
|
+
val country: String,
|
|
26
|
+
@DoNotStrip
|
|
27
|
+
@Keep
|
|
28
|
+
val locality: String,
|
|
29
|
+
@DoNotStrip
|
|
30
|
+
@Keep
|
|
31
|
+
val administrativeArea: String,
|
|
32
|
+
@DoNotStrip
|
|
33
|
+
@Keep
|
|
34
|
+
val subAdministrativeArea: String,
|
|
35
|
+
@DoNotStrip
|
|
36
|
+
@Keep
|
|
37
|
+
val subLocality: String
|
|
38
|
+
) {
|
|
39
|
+
/* primary constructor */
|
|
40
|
+
|
|
41
|
+
companion object {
|
|
42
|
+
/**
|
|
43
|
+
* Constructor called from C++
|
|
44
|
+
*/
|
|
45
|
+
@DoNotStrip
|
|
46
|
+
@Keep
|
|
47
|
+
@Suppress("unused")
|
|
48
|
+
@JvmStatic
|
|
49
|
+
private fun fromCpp(countryCode: String, country: String, locality: String, administrativeArea: String, subAdministrativeArea: String, subLocality: String): LocationGeocoderResult {
|
|
50
|
+
return LocationGeocoderResult(countryCode, country, locality, administrativeArea, subAdministrativeArea, subLocality)
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// NitroLocationGeocoderOnLoad.kt
|
|
3
|
-
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
-
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
-
///
|
|
7
|
-
|
|
8
|
-
package com.margelo.nitro.locationgeocoder
|
|
9
|
-
|
|
10
|
-
import android.util.Log
|
|
11
|
-
|
|
12
|
-
internal class NitroLocationGeocoderOnLoad {
|
|
13
|
-
companion object {
|
|
14
|
-
private const val TAG = "NitroLocationGeocoderOnLoad"
|
|
15
|
-
private var didLoad = false
|
|
16
|
-
/**
|
|
17
|
-
* Initializes the native part of "NitroLocationGeocoder".
|
|
18
|
-
* This method is idempotent and can be called more than once.
|
|
19
|
-
*/
|
|
20
|
-
@JvmStatic
|
|
21
|
-
fun initializeNative() {
|
|
22
|
-
if (didLoad) return
|
|
23
|
-
try {
|
|
24
|
-
Log.i(TAG, "Loading NitroLocationGeocoder C++ library...")
|
|
25
|
-
System.loadLibrary("NitroLocationGeocoder")
|
|
26
|
-
Log.i(TAG, "Successfully loaded NitroLocationGeocoder C++ library!")
|
|
27
|
-
didLoad = true
|
|
28
|
-
} catch (e: Error) {
|
|
29
|
-
Log.e(TAG, "Failed to load NitroLocationGeocoder C++ library! Is it properly installed and linked? " +
|
|
30
|
-
"Is the name correct? (see `CMakeLists.txt`, at `add_library(...)`)", e)
|
|
31
|
-
throw e
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
1
|
+
///
|
|
2
|
+
/// NitroLocationGeocoderOnLoad.kt
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
package com.margelo.nitro.locationgeocoder
|
|
9
|
+
|
|
10
|
+
import android.util.Log
|
|
11
|
+
|
|
12
|
+
internal class NitroLocationGeocoderOnLoad {
|
|
13
|
+
companion object {
|
|
14
|
+
private const val TAG = "NitroLocationGeocoderOnLoad"
|
|
15
|
+
private var didLoad = false
|
|
16
|
+
/**
|
|
17
|
+
* Initializes the native part of "NitroLocationGeocoder".
|
|
18
|
+
* This method is idempotent and can be called more than once.
|
|
19
|
+
*/
|
|
20
|
+
@JvmStatic
|
|
21
|
+
fun initializeNative() {
|
|
22
|
+
if (didLoad) return
|
|
23
|
+
try {
|
|
24
|
+
Log.i(TAG, "Loading NitroLocationGeocoder C++ library...")
|
|
25
|
+
System.loadLibrary("NitroLocationGeocoder")
|
|
26
|
+
Log.i(TAG, "Successfully loaded NitroLocationGeocoder C++ library!")
|
|
27
|
+
didLoad = true
|
|
28
|
+
} catch (e: Error) {
|
|
29
|
+
Log.e(TAG, "Failed to load NitroLocationGeocoder C++ library! Is it properly installed and linked? " +
|
|
30
|
+
"Is the name correct? (see `CMakeLists.txt`, at `add_library(...)`)", e)
|
|
31
|
+
throw e
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -1,60 +1,60 @@
|
|
|
1
|
-
#
|
|
2
|
-
# NitroLocationGeocoder+autolinking.rb
|
|
3
|
-
# This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
-
# https://github.com/mrousavy/nitro
|
|
5
|
-
# Copyright © Marc Rousavy @ Margelo
|
|
6
|
-
#
|
|
7
|
-
|
|
8
|
-
# This is a Ruby script that adds all files generated by Nitrogen
|
|
9
|
-
# to the given podspec.
|
|
10
|
-
#
|
|
11
|
-
# To use it, add this to your .podspec:
|
|
12
|
-
# ```ruby
|
|
13
|
-
# Pod::Spec.new do |spec|
|
|
14
|
-
# # ...
|
|
15
|
-
#
|
|
16
|
-
# # Add all files generated by Nitrogen
|
|
17
|
-
# load 'nitrogen/generated/ios/NitroLocationGeocoder+autolinking.rb'
|
|
18
|
-
# add_nitrogen_files(spec)
|
|
19
|
-
# end
|
|
20
|
-
# ```
|
|
21
|
-
|
|
22
|
-
def add_nitrogen_files(spec)
|
|
23
|
-
Pod::UI.puts "[NitroModules] 🔥 NitroLocationGeocoder is boosted by nitro!"
|
|
24
|
-
|
|
25
|
-
spec.dependency "NitroModules"
|
|
26
|
-
|
|
27
|
-
current_source_files = Array(spec.attributes_hash['source_files'])
|
|
28
|
-
spec.source_files = current_source_files + [
|
|
29
|
-
# Generated cross-platform specs
|
|
30
|
-
"nitrogen/generated/shared/**/*.{h,hpp,c,cpp,swift}",
|
|
31
|
-
# Generated bridges for the cross-platform specs
|
|
32
|
-
"nitrogen/generated/ios/**/*.{h,hpp,c,cpp,mm,swift}",
|
|
33
|
-
]
|
|
34
|
-
|
|
35
|
-
current_public_header_files = Array(spec.attributes_hash['public_header_files'])
|
|
36
|
-
spec.public_header_files = current_public_header_files + [
|
|
37
|
-
# Generated specs
|
|
38
|
-
"nitrogen/generated/shared/**/*.{h,hpp}",
|
|
39
|
-
# Swift to C++ bridging helpers
|
|
40
|
-
"nitrogen/generated/ios/NitroLocationGeocoder-Swift-Cxx-Bridge.hpp"
|
|
41
|
-
]
|
|
42
|
-
|
|
43
|
-
current_private_header_files = Array(spec.attributes_hash['private_header_files'])
|
|
44
|
-
spec.private_header_files = current_private_header_files + [
|
|
45
|
-
# iOS specific specs
|
|
46
|
-
"nitrogen/generated/ios/c++/**/*.{h,hpp}",
|
|
47
|
-
# Views are framework-specific and should be private
|
|
48
|
-
"nitrogen/generated/shared/**/views/**/*"
|
|
49
|
-
]
|
|
50
|
-
|
|
51
|
-
current_pod_target_xcconfig = spec.attributes_hash['pod_target_xcconfig'] || {}
|
|
52
|
-
spec.pod_target_xcconfig = current_pod_target_xcconfig.merge({
|
|
53
|
-
# Use C++ 20
|
|
54
|
-
"CLANG_CXX_LANGUAGE_STANDARD" => "c++20",
|
|
55
|
-
# Enables C++ <-> Swift interop (by default it's only ObjC)
|
|
56
|
-
"SWIFT_OBJC_INTEROP_MODE" => "objcxx",
|
|
57
|
-
# Enables stricter modular headers
|
|
58
|
-
"DEFINES_MODULE" => "YES",
|
|
59
|
-
})
|
|
60
|
-
end
|
|
1
|
+
#
|
|
2
|
+
# NitroLocationGeocoder+autolinking.rb
|
|
3
|
+
# This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
# https://github.com/mrousavy/nitro
|
|
5
|
+
# Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
#
|
|
7
|
+
|
|
8
|
+
# This is a Ruby script that adds all files generated by Nitrogen
|
|
9
|
+
# to the given podspec.
|
|
10
|
+
#
|
|
11
|
+
# To use it, add this to your .podspec:
|
|
12
|
+
# ```ruby
|
|
13
|
+
# Pod::Spec.new do |spec|
|
|
14
|
+
# # ...
|
|
15
|
+
#
|
|
16
|
+
# # Add all files generated by Nitrogen
|
|
17
|
+
# load 'nitrogen/generated/ios/NitroLocationGeocoder+autolinking.rb'
|
|
18
|
+
# add_nitrogen_files(spec)
|
|
19
|
+
# end
|
|
20
|
+
# ```
|
|
21
|
+
|
|
22
|
+
def add_nitrogen_files(spec)
|
|
23
|
+
Pod::UI.puts "[NitroModules] 🔥 NitroLocationGeocoder is boosted by nitro!"
|
|
24
|
+
|
|
25
|
+
spec.dependency "NitroModules"
|
|
26
|
+
|
|
27
|
+
current_source_files = Array(spec.attributes_hash['source_files'])
|
|
28
|
+
spec.source_files = current_source_files + [
|
|
29
|
+
# Generated cross-platform specs
|
|
30
|
+
"nitrogen/generated/shared/**/*.{h,hpp,c,cpp,swift}",
|
|
31
|
+
# Generated bridges for the cross-platform specs
|
|
32
|
+
"nitrogen/generated/ios/**/*.{h,hpp,c,cpp,mm,swift}",
|
|
33
|
+
]
|
|
34
|
+
|
|
35
|
+
current_public_header_files = Array(spec.attributes_hash['public_header_files'])
|
|
36
|
+
spec.public_header_files = current_public_header_files + [
|
|
37
|
+
# Generated specs
|
|
38
|
+
"nitrogen/generated/shared/**/*.{h,hpp}",
|
|
39
|
+
# Swift to C++ bridging helpers
|
|
40
|
+
"nitrogen/generated/ios/NitroLocationGeocoder-Swift-Cxx-Bridge.hpp"
|
|
41
|
+
]
|
|
42
|
+
|
|
43
|
+
current_private_header_files = Array(spec.attributes_hash['private_header_files'])
|
|
44
|
+
spec.private_header_files = current_private_header_files + [
|
|
45
|
+
# iOS specific specs
|
|
46
|
+
"nitrogen/generated/ios/c++/**/*.{h,hpp}",
|
|
47
|
+
# Views are framework-specific and should be private
|
|
48
|
+
"nitrogen/generated/shared/**/views/**/*"
|
|
49
|
+
]
|
|
50
|
+
|
|
51
|
+
current_pod_target_xcconfig = spec.attributes_hash['pod_target_xcconfig'] || {}
|
|
52
|
+
spec.pod_target_xcconfig = current_pod_target_xcconfig.merge({
|
|
53
|
+
# Use C++ 20
|
|
54
|
+
"CLANG_CXX_LANGUAGE_STANDARD" => "c++20",
|
|
55
|
+
# Enables C++ <-> Swift interop (by default it's only ObjC)
|
|
56
|
+
"SWIFT_OBJC_INTEROP_MODE" => "objcxx",
|
|
57
|
+
# Enables stricter modular headers
|
|
58
|
+
"DEFINES_MODULE" => "YES",
|
|
59
|
+
})
|
|
60
|
+
end
|
|
@@ -1,49 +1,49 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// NitroLocationGeocoder-Swift-Cxx-Bridge.cpp
|
|
3
|
-
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
-
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
-
///
|
|
7
|
-
|
|
8
|
-
#include "NitroLocationGeocoder-Swift-Cxx-Bridge.hpp"
|
|
9
|
-
|
|
10
|
-
// Include C++ implementation defined types
|
|
11
|
-
#include "HybridLocationGeocoderSpecSwift.hpp"
|
|
12
|
-
#include "NitroLocationGeocoder-Swift-Cxx-Umbrella.hpp"
|
|
13
|
-
#include <NitroModules/NitroDefines.hpp>
|
|
14
|
-
|
|
15
|
-
namespace margelo::nitro::locationgeocoder::bridge::swift {
|
|
16
|
-
|
|
17
|
-
// pragma MARK: std::function<void(const LocationGeocoderResult& /* result */)>
|
|
18
|
-
Func_void_LocationGeocoderResult create_Func_void_LocationGeocoderResult(void* NON_NULL swiftClosureWrapper) noexcept {
|
|
19
|
-
auto swiftClosure = NitroLocationGeocoder::Func_void_LocationGeocoderResult::fromUnsafe(swiftClosureWrapper);
|
|
20
|
-
return [swiftClosure = std::move(swiftClosure)](const LocationGeocoderResult& result) mutable -> void {
|
|
21
|
-
swiftClosure.call(result);
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
// pragma MARK: std::function<void(const std::exception_ptr& /* error */)>
|
|
26
|
-
Func_void_std__exception_ptr create_Func_void_std__exception_ptr(void* NON_NULL swiftClosureWrapper) noexcept {
|
|
27
|
-
auto swiftClosure = NitroLocationGeocoder::Func_void_std__exception_ptr::fromUnsafe(swiftClosureWrapper);
|
|
28
|
-
return [swiftClosure = std::move(swiftClosure)](const std::exception_ptr& error) mutable -> void {
|
|
29
|
-
swiftClosure.call(error);
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
// pragma MARK: std::shared_ptr<HybridLocationGeocoderSpec>
|
|
34
|
-
std::shared_ptr<HybridLocationGeocoderSpec> create_std__shared_ptr_HybridLocationGeocoderSpec_(void* NON_NULL swiftUnsafePointer) noexcept {
|
|
35
|
-
NitroLocationGeocoder::HybridLocationGeocoderSpec_cxx swiftPart = NitroLocationGeocoder::HybridLocationGeocoderSpec_cxx::fromUnsafe(swiftUnsafePointer);
|
|
36
|
-
return std::make_shared<margelo::nitro::locationgeocoder::HybridLocationGeocoderSpecSwift>(swiftPart);
|
|
37
|
-
}
|
|
38
|
-
void* NON_NULL get_std__shared_ptr_HybridLocationGeocoderSpec_(std__shared_ptr_HybridLocationGeocoderSpec_ cppType) {
|
|
39
|
-
std::shared_ptr<margelo::nitro::locationgeocoder::HybridLocationGeocoderSpecSwift> swiftWrapper = std::dynamic_pointer_cast<margelo::nitro::locationgeocoder::HybridLocationGeocoderSpecSwift>(cppType);
|
|
40
|
-
#ifdef NITRO_DEBUG
|
|
41
|
-
if (swiftWrapper == nullptr) [[unlikely]] {
|
|
42
|
-
throw std::runtime_error("Class \"HybridLocationGeocoderSpec\" is not implemented in Swift!");
|
|
43
|
-
}
|
|
44
|
-
#endif
|
|
45
|
-
NitroLocationGeocoder::HybridLocationGeocoderSpec_cxx& swiftPart = swiftWrapper->getSwiftPart();
|
|
46
|
-
return swiftPart.toUnsafe();
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
} // namespace margelo::nitro::locationgeocoder::bridge::swift
|
|
1
|
+
///
|
|
2
|
+
/// NitroLocationGeocoder-Swift-Cxx-Bridge.cpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#include "NitroLocationGeocoder-Swift-Cxx-Bridge.hpp"
|
|
9
|
+
|
|
10
|
+
// Include C++ implementation defined types
|
|
11
|
+
#include "HybridLocationGeocoderSpecSwift.hpp"
|
|
12
|
+
#include "NitroLocationGeocoder-Swift-Cxx-Umbrella.hpp"
|
|
13
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
14
|
+
|
|
15
|
+
namespace margelo::nitro::locationgeocoder::bridge::swift {
|
|
16
|
+
|
|
17
|
+
// pragma MARK: std::function<void(const LocationGeocoderResult& /* result */)>
|
|
18
|
+
Func_void_LocationGeocoderResult create_Func_void_LocationGeocoderResult(void* NON_NULL swiftClosureWrapper) noexcept {
|
|
19
|
+
auto swiftClosure = NitroLocationGeocoder::Func_void_LocationGeocoderResult::fromUnsafe(swiftClosureWrapper);
|
|
20
|
+
return [swiftClosure = std::move(swiftClosure)](const LocationGeocoderResult& result) mutable -> void {
|
|
21
|
+
swiftClosure.call(result);
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// pragma MARK: std::function<void(const std::exception_ptr& /* error */)>
|
|
26
|
+
Func_void_std__exception_ptr create_Func_void_std__exception_ptr(void* NON_NULL swiftClosureWrapper) noexcept {
|
|
27
|
+
auto swiftClosure = NitroLocationGeocoder::Func_void_std__exception_ptr::fromUnsafe(swiftClosureWrapper);
|
|
28
|
+
return [swiftClosure = std::move(swiftClosure)](const std::exception_ptr& error) mutable -> void {
|
|
29
|
+
swiftClosure.call(error);
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// pragma MARK: std::shared_ptr<HybridLocationGeocoderSpec>
|
|
34
|
+
std::shared_ptr<HybridLocationGeocoderSpec> create_std__shared_ptr_HybridLocationGeocoderSpec_(void* NON_NULL swiftUnsafePointer) noexcept {
|
|
35
|
+
NitroLocationGeocoder::HybridLocationGeocoderSpec_cxx swiftPart = NitroLocationGeocoder::HybridLocationGeocoderSpec_cxx::fromUnsafe(swiftUnsafePointer);
|
|
36
|
+
return std::make_shared<margelo::nitro::locationgeocoder::HybridLocationGeocoderSpecSwift>(swiftPart);
|
|
37
|
+
}
|
|
38
|
+
void* NON_NULL get_std__shared_ptr_HybridLocationGeocoderSpec_(std__shared_ptr_HybridLocationGeocoderSpec_ cppType) {
|
|
39
|
+
std::shared_ptr<margelo::nitro::locationgeocoder::HybridLocationGeocoderSpecSwift> swiftWrapper = std::dynamic_pointer_cast<margelo::nitro::locationgeocoder::HybridLocationGeocoderSpecSwift>(cppType);
|
|
40
|
+
#ifdef NITRO_DEBUG
|
|
41
|
+
if (swiftWrapper == nullptr) [[unlikely]] {
|
|
42
|
+
throw std::runtime_error("Class \"HybridLocationGeocoderSpec\" is not implemented in Swift!");
|
|
43
|
+
}
|
|
44
|
+
#endif
|
|
45
|
+
NitroLocationGeocoder::HybridLocationGeocoderSpec_cxx& swiftPart = swiftWrapper->getSwiftPart();
|
|
46
|
+
return swiftPart.toUnsafe();
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
} // namespace margelo::nitro::locationgeocoder::bridge::swift
|