simpleble 0.0.1
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.
- checksums.yaml +7 -0
- data/CHANGELOG.md +88 -0
- data/LICENSE.txt +21 -0
- data/README.md +350 -0
- data/ext/simpleble/extconf.rb +57 -0
- data/ext/simpleble/simpleble_ruby.c +682 -0
- data/lib/simpleble/adapter.rb +10 -0
- data/lib/simpleble/characteristic.rb +36 -0
- data/lib/simpleble/descriptor.rb +8 -0
- data/lib/simpleble/exceptions.rb +25 -0
- data/lib/simpleble/peripheral.rb +64 -0
- data/lib/simpleble/service.rb +16 -0
- data/lib/simpleble/version.rb +3 -0
- data/lib/simpleble.rb +40 -0
- data/vendor/simpleble/build_simplecble/CMakeFiles/4.0.3/CompilerIdCXX/CMakeCXXCompilerId.cpp +920 -0
- data/vendor/simpleble/build_simplecble/CMakeFiles/4.0.3/CompilerIdCXX/apple-sdk.cpp +1 -0
- data/vendor/simpleble/build_simplecble/CMakeFiles/4.1.0/CompilerIdCXX/CMakeCXXCompilerId.cpp +949 -0
- data/vendor/simpleble/build_simplecble/CMakeFiles/4.1.0/CompilerIdCXX/apple-sdk.cpp +1 -0
- data/vendor/simpleble/build_simplecble/export/simplecble/export.h +43 -0
- data/vendor/simpleble/build_simplecble/simpleble/export/simpleble/export.h +43 -0
- data/vendor/simpleble/dependencies/external/kvn/kvn_bytearray.h +222 -0
- data/vendor/simpleble/dependencies/external/kvn/kvn_safe_callback.hpp +66 -0
- data/vendor/simpleble/dependencies/external/kvn/logfwd.hpp +35 -0
- data/vendor/simpleble/dependencies/internal/fmt/args.h +220 -0
- data/vendor/simpleble/dependencies/internal/fmt/base.h +2962 -0
- data/vendor/simpleble/dependencies/internal/fmt/chrono.h +2338 -0
- data/vendor/simpleble/dependencies/internal/fmt/color.h +610 -0
- data/vendor/simpleble/dependencies/internal/fmt/compile.h +539 -0
- data/vendor/simpleble/dependencies/internal/fmt/core.h +5 -0
- data/vendor/simpleble/dependencies/internal/fmt/format-inl.h +1949 -0
- data/vendor/simpleble/dependencies/internal/fmt/format.h +4244 -0
- data/vendor/simpleble/dependencies/internal/fmt/os.h +427 -0
- data/vendor/simpleble/dependencies/internal/fmt/ostream.h +166 -0
- data/vendor/simpleble/dependencies/internal/fmt/printf.h +633 -0
- data/vendor/simpleble/dependencies/internal/fmt/ranges.h +850 -0
- data/vendor/simpleble/dependencies/internal/fmt/std.h +726 -0
- data/vendor/simpleble/dependencies/internal/fmt/xchar.h +373 -0
- data/vendor/simpleble/dependencies/internal/simplejni/Common.hpp +579 -0
- data/vendor/simpleble/dependencies/internal/simplejni/References.hpp +151 -0
- data/vendor/simpleble/dependencies/internal/simplejni/Registry.hpp +183 -0
- data/vendor/simpleble/dependencies/internal/simplejni/VM.hpp +88 -0
- data/vendor/simpleble/examples/simpleble/src/connect.cpp +67 -0
- data/vendor/simpleble/examples/simpleble/src/connect_safe.cpp +91 -0
- data/vendor/simpleble/examples/simpleble/src/list_adapters.cpp +22 -0
- data/vendor/simpleble/examples/simpleble/src/list_adapters_safe.cpp +33 -0
- data/vendor/simpleble/examples/simpleble/src/list_paired.cpp +27 -0
- data/vendor/simpleble/examples/simpleble/src/multiconnect.cpp +60 -0
- data/vendor/simpleble/examples/simpleble/src/notify.cpp +85 -0
- data/vendor/simpleble/examples/simpleble/src/notify_multi.cpp +101 -0
- data/vendor/simpleble/examples/simpleble/src/power_cycle.cpp +43 -0
- data/vendor/simpleble/examples/simpleble/src/read.cpp +82 -0
- data/vendor/simpleble/examples/simpleble/src/scan.cpp +62 -0
- data/vendor/simpleble/examples/simpleble/src/utils.cpp +59 -0
- data/vendor/simpleble/examples/simpleble/src/utils.hpp +27 -0
- data/vendor/simpleble/examples/simpleble/src/write.cpp +81 -0
- data/vendor/simpleble/examples/simplebluez/ble_nus/ble_nus.cpp +138 -0
- data/vendor/simpleble/examples/simplebluez/connect/connect.cpp +119 -0
- data/vendor/simpleble/examples/simplebluez/list_adapters/list_adapters.cpp +44 -0
- data/vendor/simpleble/examples/simplebluez/list_paired/list_paired.cpp +48 -0
- data/vendor/simpleble/examples/simplebluez/notify/notify.cpp +145 -0
- data/vendor/simpleble/examples/simplebluez/pair/pair.cpp +181 -0
- data/vendor/simpleble/examples/simplebluez/read/read.cpp +141 -0
- data/vendor/simpleble/examples/simplebluez/scan/scan.cpp +85 -0
- data/vendor/simpleble/examples/simplecble/c/connect.c +163 -0
- data/vendor/simpleble/examples/simplecble/c/notify.c +217 -0
- data/vendor/simpleble/examples/simplecble/c/scan.c +164 -0
- data/vendor/simpleble/examples/simpledbus/notification.cpp +24 -0
- data/vendor/simpleble/hitl/src/test_sanity.cpp +48 -0
- data/vendor/simpleble/install_simplecble/include/simpleble/Adapter.h +102 -0
- data/vendor/simpleble/install_simplecble/include/simpleble/AdapterSafe.h +58 -0
- data/vendor/simpleble/install_simplecble/include/simpleble/Advanced.h +50 -0
- data/vendor/simpleble/install_simplecble/include/simpleble/Characteristic.h +39 -0
- data/vendor/simpleble/install_simplecble/include/simpleble/Config.h +55 -0
- data/vendor/simpleble/install_simplecble/include/simpleble/Descriptor.h +30 -0
- data/vendor/simpleble/install_simplecble/include/simpleble/Exceptions.h +72 -0
- data/vendor/simpleble/install_simplecble/include/simpleble/Logging.h +73 -0
- data/vendor/simpleble/install_simplecble/include/simpleble/Peripheral.h +82 -0
- data/vendor/simpleble/install_simplecble/include/simpleble/PeripheralSafe.h +64 -0
- data/vendor/simpleble/install_simplecble/include/simpleble/Service.h +34 -0
- data/vendor/simpleble/install_simplecble/include/simpleble/SimpleBLE.h +8 -0
- data/vendor/simpleble/install_simplecble/include/simpleble/Types.h +49 -0
- data/vendor/simpleble/install_simplecble/include/simpleble/Utils.h +13 -0
- data/vendor/simpleble/install_simplecble/include/simpleble/export.h +43 -0
- data/vendor/simpleble/install_simplecble/include/simpleble/kvn/kvn_bytearray.h +222 -0
- data/vendor/simpleble/install_simplecble/include/simplecble/adapter.h +188 -0
- data/vendor/simpleble/install_simplecble/include/simplecble/logging.h +37 -0
- data/vendor/simpleble/install_simplecble/include/simplecble/peripheral.h +304 -0
- data/vendor/simpleble/install_simplecble/include/simplecble/simpleble.h +21 -0
- data/vendor/simpleble/install_simplecble/include/simplecble/types.h +73 -0
- data/vendor/simpleble/install_simplecble/include/simplecble/utils.h +27 -0
- data/vendor/simpleble/simpleble/include/simpleble/Adapter.h +102 -0
- data/vendor/simpleble/simpleble/include/simpleble/AdapterSafe.h +58 -0
- data/vendor/simpleble/simpleble/include/simpleble/Characteristic.h +39 -0
- data/vendor/simpleble/simpleble/include/simpleble/Config.h +55 -0
- data/vendor/simpleble/simpleble/include/simpleble/Descriptor.h +30 -0
- data/vendor/simpleble/simpleble/include/simpleble/Exceptions.h +72 -0
- data/vendor/simpleble/simpleble/include/simpleble/Logging.h +73 -0
- data/vendor/simpleble/simpleble/include/simpleble/Peripheral.h +82 -0
- data/vendor/simpleble/simpleble/include/simpleble/PeripheralSafe.h +64 -0
- data/vendor/simpleble/simpleble/include/simpleble/Service.h +34 -0
- data/vendor/simpleble/simpleble/include/simpleble/SimpleBLE.h +8 -0
- data/vendor/simpleble/simpleble/include/simpleble/Types.h +49 -0
- data/vendor/simpleble/simpleble/include/simpleble/Utils.h +13 -0
- data/vendor/simpleble/simpleble/include/simpleble_c/adapter.h +188 -0
- data/vendor/simpleble/simpleble/include/simpleble_c/logging.h +37 -0
- data/vendor/simpleble/simpleble/include/simpleble_c/peripheral.h +304 -0
- data/vendor/simpleble/simpleble/include/simpleble_c/simpleble.h +21 -0
- data/vendor/simpleble/simpleble/include/simpleble_c/types.h +73 -0
- data/vendor/simpleble/simpleble/include/simpleble_c/utils.h +27 -0
- data/vendor/simpleble/simpleble/src/CommonUtils.h +63 -0
- data/vendor/simpleble/simpleble/src/Exceptions.cpp +31 -0
- data/vendor/simpleble/simpleble/src/Logging.cpp +136 -0
- data/vendor/simpleble/simpleble/src/LoggingInternal.h +85 -0
- data/vendor/simpleble/simpleble/src/Utils.cpp +24 -0
- data/vendor/simpleble/simpleble/src/backends/android/AdapterAndroid.cpp +101 -0
- data/vendor/simpleble/simpleble/src/backends/android/AdapterAndroid.h +70 -0
- data/vendor/simpleble/simpleble/src/backends/android/BackendAndroid.cpp +40 -0
- data/vendor/simpleble/simpleble/src/backends/android/BackendAndroid.h +20 -0
- data/vendor/simpleble/simpleble/src/backends/android/PeripheralAndroid.cpp +365 -0
- data/vendor/simpleble/simpleble/src/backends/android/PeripheralAndroid.h +90 -0
- data/vendor/simpleble/simpleble/src/backends/android/bridge/BluetoothGattCallback.cpp +432 -0
- data/vendor/simpleble/simpleble/src/backends/android/bridge/BluetoothGattCallback.h +102 -0
- data/vendor/simpleble/simpleble/src/backends/android/bridge/ScanCallback.cpp +142 -0
- data/vendor/simpleble/simpleble/src/backends/android/bridge/ScanCallback.h +55 -0
- data/vendor/simpleble/simpleble/src/backends/android/types/android/bluetooth/BluetoothAdapter.cpp +107 -0
- data/vendor/simpleble/simpleble/src/backends/android/types/android/bluetooth/BluetoothAdapter.h +55 -0
- data/vendor/simpleble/simpleble/src/backends/android/types/android/bluetooth/BluetoothDevice.cpp +68 -0
- data/vendor/simpleble/simpleble/src/backends/android/types/android/bluetooth/BluetoothDevice.h +54 -0
- data/vendor/simpleble/simpleble/src/backends/android/types/android/bluetooth/BluetoothGatt.cpp +115 -0
- data/vendor/simpleble/simpleble/src/backends/android/types/android/bluetooth/BluetoothGatt.h +75 -0
- data/vendor/simpleble/simpleble/src/backends/android/types/android/bluetooth/BluetoothGattCharacteristic.cpp +142 -0
- data/vendor/simpleble/simpleble/src/backends/android/types/android/bluetooth/BluetoothGattCharacteristic.h +66 -0
- data/vendor/simpleble/simpleble/src/backends/android/types/android/bluetooth/BluetoothGattDescriptor.cpp +67 -0
- data/vendor/simpleble/simpleble/src/backends/android/types/android/bluetooth/BluetoothGattDescriptor.h +46 -0
- data/vendor/simpleble/simpleble/src/backends/android/types/android/bluetooth/BluetoothGattService.cpp +106 -0
- data/vendor/simpleble/simpleble/src/backends/android/types/android/bluetooth/BluetoothGattService.h +47 -0
- data/vendor/simpleble/simpleble/src/backends/android/types/android/bluetooth/le/BluetoothScanner.cpp +47 -0
- data/vendor/simpleble/simpleble/src/backends/android/types/android/bluetooth/le/BluetoothScanner.h +37 -0
- data/vendor/simpleble/simpleble/src/backends/android/types/android/bluetooth/le/ScanRecord.cpp +69 -0
- data/vendor/simpleble/simpleble/src/backends/android/types/android/bluetooth/le/ScanRecord.h +41 -0
- data/vendor/simpleble/simpleble/src/backends/android/types/android/bluetooth/le/ScanResult.cpp +63 -0
- data/vendor/simpleble/simpleble/src/backends/android/types/android/bluetooth/le/ScanResult.h +42 -0
- data/vendor/simpleble/simpleble/src/backends/android/types/android/os/ParcelUUID.cpp +32 -0
- data/vendor/simpleble/simpleble/src/backends/android/types/android/os/ParcelUUID.h +30 -0
- data/vendor/simpleble/simpleble/src/backends/android/types/android/util/SparseArray.cpp +54 -0
- data/vendor/simpleble/simpleble/src/backends/android/types/android/util/SparseArray.h +37 -0
- data/vendor/simpleble/simpleble/src/backends/android/types/java/util/Iterator.cpp +36 -0
- data/vendor/simpleble/simpleble/src/backends/android/types/java/util/Iterator.h +28 -0
- data/vendor/simpleble/simpleble/src/backends/android/types/java/util/List.cpp +29 -0
- data/vendor/simpleble/simpleble/src/backends/android/types/java/util/List.h +27 -0
- data/vendor/simpleble/simpleble/src/backends/android/types/java/util/Set.cpp +33 -0
- data/vendor/simpleble/simpleble/src/backends/android/types/java/util/Set.h +28 -0
- data/vendor/simpleble/simpleble/src/backends/android/types/java/util/UUID.cpp +26 -0
- data/vendor/simpleble/simpleble/src/backends/android/types/java/util/UUID.h +29 -0
- data/vendor/simpleble/simpleble/src/backends/common/AdapterBase.cpp +53 -0
- data/vendor/simpleble/simpleble/src/backends/common/AdapterBase.h +81 -0
- data/vendor/simpleble/simpleble/src/backends/common/AdapterBaseTypes.h +22 -0
- data/vendor/simpleble/simpleble/src/backends/common/BackendBase.h +20 -0
- data/vendor/simpleble/simpleble/src/backends/common/BackendUtils.h +33 -0
- data/vendor/simpleble/simpleble/src/backends/common/CharacteristicBase.cpp +28 -0
- data/vendor/simpleble/simpleble/src/backends/common/CharacteristicBase.h +38 -0
- data/vendor/simpleble/simpleble/src/backends/common/DescriptorBase.cpp +7 -0
- data/vendor/simpleble/simpleble/src/backends/common/DescriptorBase.h +19 -0
- data/vendor/simpleble/simpleble/src/backends/common/PeripheralBase.h +82 -0
- data/vendor/simpleble/simpleble/src/backends/common/ServiceBase.cpp +18 -0
- data/vendor/simpleble/simpleble/src/backends/common/ServiceBase.h +28 -0
- data/vendor/simpleble/simpleble/src/backends/linux/AdapterLinux.cpp +102 -0
- data/vendor/simpleble/simpleble/src/backends/linux/AdapterLinux.h +55 -0
- data/vendor/simpleble/simpleble/src/backends/linux/BackendBluez.cpp +87 -0
- data/vendor/simpleble/simpleble/src/backends/linux/PeripheralLinux.cpp +376 -0
- data/vendor/simpleble/simpleble/src/backends/linux/PeripheralLinux.h +90 -0
- data/vendor/simpleble/simpleble/src/backends/macos/AdapterBaseMacOS.h +29 -0
- data/vendor/simpleble/simpleble/src/backends/macos/AdapterMac.h +78 -0
- data/vendor/simpleble/simpleble/src/backends/macos/PeripheralBaseMacOS.h +49 -0
- data/vendor/simpleble/simpleble/src/backends/macos/PeripheralMac.h +81 -0
- data/vendor/simpleble/simpleble/src/backends/macos/Utils.h +9 -0
- data/vendor/simpleble/simpleble/src/backends/plain/AdapterPlain.cpp +65 -0
- data/vendor/simpleble/simpleble/src/backends/plain/AdapterPlain.h +49 -0
- data/vendor/simpleble/simpleble/src/backends/plain/BackendPlain.cpp +30 -0
- data/vendor/simpleble/simpleble/src/backends/plain/PeripheralPlain.cpp +159 -0
- data/vendor/simpleble/simpleble/src/backends/plain/PeripheralPlain.h +72 -0
- data/vendor/simpleble/simpleble/src/backends/windows/AdapterWindows.cpp +330 -0
- data/vendor/simpleble/simpleble/src/backends/windows/AdapterWindows.h +89 -0
- data/vendor/simpleble/simpleble/src/backends/windows/BackendWinRT.cpp +67 -0
- data/vendor/simpleble/simpleble/src/backends/windows/BackendWinRT.h +18 -0
- data/vendor/simpleble/simpleble/src/backends/windows/MtaManager.cpp +49 -0
- data/vendor/simpleble/simpleble/src/backends/windows/MtaManager.h +90 -0
- data/vendor/simpleble/simpleble/src/backends/windows/PeripheralWindows.cpp +487 -0
- data/vendor/simpleble/simpleble/src/backends/windows/PeripheralWindows.h +129 -0
- data/vendor/simpleble/simpleble/src/backends/windows/Utils.cpp +146 -0
- data/vendor/simpleble/simpleble/src/backends/windows/Utils.h +47 -0
- data/vendor/simpleble/simpleble/src/builders/BuildVec.h +32 -0
- data/vendor/simpleble/simpleble/src/builders/BuilderBase.h +87 -0
- data/vendor/simpleble/simpleble/src/external/TaskRunner.hpp +99 -0
- data/vendor/simpleble/simpleble/src/external/ThreadRunner.h +52 -0
- data/vendor/simpleble/simpleble/src/external/kvn_safe_callback.hpp +66 -0
- data/vendor/simpleble/simpleble/src/external/kvn_safe_map.hpp +94 -0
- data/vendor/simpleble/simpleble/src/external/kvn_threadrunner.hpp +70 -0
- data/vendor/simpleble/simpleble/src/external/logfwd.hpp +35 -0
- data/vendor/simpleble/simpleble/src/frontends/base/Adapter.cpp +111 -0
- data/vendor/simpleble/simpleble/src/frontends/base/Backend.cpp +83 -0
- data/vendor/simpleble/simpleble/src/frontends/base/Backend.h +76 -0
- data/vendor/simpleble/simpleble/src/frontends/base/Characteristic.cpp +56 -0
- data/vendor/simpleble/simpleble/src/frontends/base/Descriptor.cpp +21 -0
- data/vendor/simpleble/simpleble/src/frontends/base/Peripheral.cpp +113 -0
- data/vendor/simpleble/simpleble/src/frontends/base/Service.cpp +26 -0
- data/vendor/simpleble/simpleble/src/frontends/safe/AdapterSafe.cpp +158 -0
- data/vendor/simpleble/simpleble/src/frontends/safe/PeripheralSafe.cpp +219 -0
- data/vendor/simpleble/simpleble/src_c/adapter.cpp +204 -0
- data/vendor/simpleble/simpleble/src_c/logging.cpp +19 -0
- data/vendor/simpleble/simpleble/src_c/peripheral.cpp +444 -0
- data/vendor/simpleble/simpleble/src_c/simpleble.cpp +5 -0
- data/vendor/simpleble/simpleble/src_c/utils.cpp +15 -0
- data/vendor/simpleble/simpleble/test/src/main.cpp +8 -0
- data/vendor/simpleble/simpleble/test/src/test_bytearray.cpp +246 -0
- data/vendor/simpleble/simpleble/test/src/test_utils.cpp +24 -0
- data/vendor/simpleble/simplebluez/include/simplebluez/Adapter.h +46 -0
- data/vendor/simpleble/simplebluez/include/simplebluez/Agent.h +52 -0
- data/vendor/simpleble/simplebluez/include/simplebluez/Bluez.h +37 -0
- data/vendor/simpleble/simplebluez/include/simplebluez/BluezOrg.h +22 -0
- data/vendor/simpleble/simplebluez/include/simplebluez/BluezOrgBluez.h +26 -0
- data/vendor/simpleble/simplebluez/include/simplebluez/BluezRoot.h +32 -0
- data/vendor/simpleble/simplebluez/include/simplebluez/Characteristic.h +46 -0
- data/vendor/simpleble/simplebluez/include/simplebluez/Descriptor.h +33 -0
- data/vendor/simpleble/simplebluez/include/simplebluez/Device.h +64 -0
- data/vendor/simpleble/simplebluez/include/simplebluez/Exceptions.h +43 -0
- data/vendor/simpleble/simplebluez/include/simplebluez/Service.h +27 -0
- data/vendor/simpleble/simplebluez/include/simplebluez/Types.h +9 -0
- data/vendor/simpleble/simplebluez/include/simplebluez/interfaces/Adapter1.h +49 -0
- data/vendor/simpleble/simplebluez/include/simplebluez/interfaces/Agent1.h +100 -0
- data/vendor/simpleble/simplebluez/include/simplebluez/interfaces/AgentManager1.h +24 -0
- data/vendor/simpleble/simplebluez/include/simplebluez/interfaces/Battery1.h +32 -0
- data/vendor/simpleble/simplebluez/include/simplebluez/interfaces/Device1.h +62 -0
- data/vendor/simpleble/simplebluez/include/simplebluez/interfaces/GattCharacteristic1.h +48 -0
- data/vendor/simpleble/simplebluez/include/simplebluez/interfaces/GattDescriptor1.h +41 -0
- data/vendor/simpleble/simplebluez/include/simplebluez/interfaces/GattService1.h +28 -0
- data/vendor/simpleble/simplebluez/src/Adapter.cpp +78 -0
- data/vendor/simpleble/simplebluez/src/Agent.cpp +72 -0
- data/vendor/simpleble/simplebluez/src/Bluez.cpp +45 -0
- data/vendor/simpleble/simplebluez/src/BluezOrg.cpp +20 -0
- data/vendor/simpleble/simplebluez/src/BluezOrgBluez.cpp +23 -0
- data/vendor/simpleble/simplebluez/src/BluezRoot.cpp +44 -0
- data/vendor/simpleble/simplebluez/src/Characteristic.cpp +64 -0
- data/vendor/simpleble/simplebluez/src/Descriptor.cpp +27 -0
- data/vendor/simpleble/simplebluez/src/Device.cpp +104 -0
- data/vendor/simpleble/simplebluez/src/Exceptions.cpp +29 -0
- data/vendor/simpleble/simplebluez/src/Logging.cpp +52 -0
- data/vendor/simpleble/simplebluez/src/Logging.h +57 -0
- data/vendor/simpleble/simplebluez/src/Service.cpp +33 -0
- data/vendor/simpleble/simplebluez/src/interfaces/Adapter1.cpp +123 -0
- data/vendor/simpleble/simplebluez/src/interfaces/Agent1.cpp +143 -0
- data/vendor/simpleble/simplebluez/src/interfaces/AgentManager1.cpp +34 -0
- data/vendor/simpleble/simplebluez/src/interfaces/Battery1.cpp +30 -0
- data/vendor/simpleble/simplebluez/src/interfaces/Device1.cpp +170 -0
- data/vendor/simpleble/simplebluez/src/interfaces/GattCharacteristic1.cpp +118 -0
- data/vendor/simpleble/simplebluez/src/interfaces/GattDescriptor1.cpp +78 -0
- data/vendor/simpleble/simplebluez/src/interfaces/GattService1.cpp +28 -0
- data/vendor/simpleble/simplebluez/test/src/helpers/PythonRunner.cpp +53 -0
- data/vendor/simpleble/simplebluez/test/src/helpers/PythonRunner.h +24 -0
- data/vendor/simpleble/simplebluez/test/src/main.cpp +16 -0
- data/vendor/simpleble/simplecble/include/simplecble/adapter.h +188 -0
- data/vendor/simpleble/simplecble/include/simplecble/logging.h +37 -0
- data/vendor/simpleble/simplecble/include/simplecble/peripheral.h +304 -0
- data/vendor/simpleble/simplecble/include/simplecble/simpleble.h +21 -0
- data/vendor/simpleble/simplecble/include/simplecble/types.h +73 -0
- data/vendor/simpleble/simplecble/include/simplecble/utils.h +27 -0
- data/vendor/simpleble/simplecble/src/adapter.cpp +204 -0
- data/vendor/simpleble/simplecble/src/logging.cpp +19 -0
- data/vendor/simpleble/simplecble/src/peripheral.cpp +444 -0
- data/vendor/simpleble/simplecble/src/simpleble.cpp +5 -0
- data/vendor/simpleble/simplecble/src/utils.cpp +15 -0
- data/vendor/simpleble/simpledbus/include/simpledbus/advanced/Interface.h +67 -0
- data/vendor/simpleble/simpledbus/include/simpledbus/advanced/InterfaceRegistry.h +64 -0
- data/vendor/simpleble/simpledbus/include/simpledbus/advanced/Proxy.h +117 -0
- data/vendor/simpleble/simpledbus/include/simpledbus/base/Connection.h +50 -0
- data/vendor/simpleble/simpledbus/include/simpledbus/base/Exceptions.h +56 -0
- data/vendor/simpleble/simpledbus/include/simpledbus/base/Holder.h +147 -0
- data/vendor/simpleble/simpledbus/include/simpledbus/base/Logging.h +57 -0
- data/vendor/simpleble/simpledbus/include/simpledbus/base/Message.h +89 -0
- data/vendor/simpleble/simpledbus/include/simpledbus/base/Path.h +24 -0
- data/vendor/simpleble/simpledbus/include/simpledbus/interfaces/ObjectManager.h +26 -0
- data/vendor/simpleble/simpledbus/src/advanced/Interface.cpp +155 -0
- data/vendor/simpleble/simpledbus/src/advanced/Proxy.cpp +375 -0
- data/vendor/simpleble/simpledbus/src/base/Connection.cpp +222 -0
- data/vendor/simpleble/simpledbus/src/base/Exceptions.cpp +39 -0
- data/vendor/simpleble/simpledbus/src/base/Holder.cpp +739 -0
- data/vendor/simpleble/simpledbus/src/base/Logging.cpp +52 -0
- data/vendor/simpleble/simpledbus/src/base/Message.cpp +622 -0
- data/vendor/simpleble/simpledbus/src/base/Path.cpp +129 -0
- data/vendor/simpleble/simpledbus/src/interfaces/ObjectManager.cpp +58 -0
- data/vendor/simpleble/simpledbus/test/src/helpers/PythonRunner.cpp +53 -0
- data/vendor/simpleble/simpledbus/test/src/helpers/PythonRunner.h +24 -0
- data/vendor/simpleble/simpledbus/test/src/main.cpp +16 -0
- data/vendor/simpleble/simpledbus/test/src/test_holder.cpp +184 -0
- data/vendor/simpleble/simpledbus/test/src/test_message.cpp +397 -0
- data/vendor/simpleble/simpledbus/test/src/test_path.cpp +76 -0
- data/vendor/simpleble/simpledbus/test/src/test_proxy_children.cpp +109 -0
- data/vendor/simpleble/simpledbus/test/src/test_proxy_interfaces.cpp +102 -0
- data/vendor/simpleble/simpledbus/test/src/test_proxy_lifetime.cpp +18 -0
- data/vendor/simpleble/simpledroidble/simpledroidble/src/main/cpp/ThreadRunner.h +89 -0
- data/vendor/simpleble/simpledroidble/simpledroidble/src/main/cpp/android_utils.cpp +55 -0
- data/vendor/simpleble/simpledroidble/simpledroidble/src/main/cpp/android_utils.h +18 -0
- data/vendor/simpleble/simpledroidble/simpledroidble/src/main/cpp/simpleble_android.cpp +813 -0
- data/vendor/simpleble/simplejavable/cpp/src/core/AdapterWrapper.cpp +37 -0
- data/vendor/simpleble/simplejavable/cpp/src/core/AdapterWrapper.h +23 -0
- data/vendor/simpleble/simplejavable/cpp/src/core/Cache.cpp +58 -0
- data/vendor/simpleble/simplejavable/cpp/src/core/Cache.h +34 -0
- data/vendor/simpleble/simplejavable/cpp/src/core/PeripheralWrapper.cpp +17 -0
- data/vendor/simpleble/simplejavable/cpp/src/core/PeripheralWrapper.h +19 -0
- data/vendor/simpleble/simplejavable/cpp/src/java/lang/ArrayList.cpp +257 -0
- data/vendor/simpleble/simplejavable/cpp/src/java/lang/ArrayList.h +78 -0
- data/vendor/simpleble/simplejavable/cpp/src/java/lang/HashMap.cpp +96 -0
- data/vendor/simpleble/simplejavable/cpp/src/java/lang/HashMap.h +54 -0
- data/vendor/simpleble/simplejavable/cpp/src/java/lang/Integer.cpp +93 -0
- data/vendor/simpleble/simplejavable/cpp/src/java/lang/Integer.h +49 -0
- data/vendor/simpleble/simplejavable/cpp/src/java/lang/Iterator.cpp +85 -0
- data/vendor/simpleble/simplejavable/cpp/src/java/lang/Iterator.h +48 -0
- data/vendor/simpleble/simplejavable/cpp/src/org/simplejavable/AdapterCallback.cpp +91 -0
- data/vendor/simpleble/simplejavable/cpp/src/org/simplejavable/AdapterCallback.h +90 -0
- data/vendor/simpleble/simplejavable/cpp/src/org/simplejavable/Characteristic.cpp +35 -0
- data/vendor/simpleble/simplejavable/cpp/src/org/simplejavable/Characteristic.h +60 -0
- data/vendor/simpleble/simplejavable/cpp/src/org/simplejavable/DataCallback.cpp +33 -0
- data/vendor/simpleble/simplejavable/cpp/src/org/simplejavable/DataCallback.h +45 -0
- data/vendor/simpleble/simplejavable/cpp/src/org/simplejavable/Descriptor.cpp +30 -0
- data/vendor/simpleble/simplejavable/cpp/src/org/simplejavable/Descriptor.h +49 -0
- data/vendor/simpleble/simplejavable/cpp/src/org/simplejavable/PeripheralCallback.cpp +41 -0
- data/vendor/simpleble/simplejavable/cpp/src/org/simplejavable/PeripheralCallback.h +51 -0
- data/vendor/simpleble/simplejavable/cpp/src/org/simplejavable/Service.cpp +33 -0
- data/vendor/simpleble/simplejavable/cpp/src/org/simplejavable/Service.h +54 -0
- data/vendor/simpleble/simplejavable/cpp/src/simplejavable.cpp +361 -0
- data/vendor/simpleble/simplepyble/src/main.cpp +55 -0
- data/vendor/simpleble/simplepyble/src/wrap_adapter.cpp +106 -0
- data/vendor/simpleble/simplepyble/src/wrap_characteristic.cpp +56 -0
- data/vendor/simpleble/simplepyble/src/wrap_config.cpp +136 -0
- data/vendor/simpleble/simplepyble/src/wrap_descriptor.cpp +21 -0
- data/vendor/simpleble/simplepyble/src/wrap_peripheral.cpp +217 -0
- data/vendor/simpleble/simplepyble/src/wrap_service.cpp +32 -0
- data/vendor/simpleble/simplepyble/src/wrap_types.cpp +21 -0
- data/vendor/simpleble/simplersble/src/bindings/Bindings.cpp +338 -0
- data/vendor/simpleble/simplersble/src/bindings/Bindings.hpp +178 -0
- metadata +430 -0
@@ -0,0 +1,373 @@
|
|
1
|
+
// Formatting library for C++ - optional wchar_t and exotic character support
|
2
|
+
//
|
3
|
+
// Copyright (c) 2012 - present, Victor Zverovich
|
4
|
+
// All rights reserved.
|
5
|
+
//
|
6
|
+
// For the license information refer to format.h.
|
7
|
+
|
8
|
+
#ifndef FMT_XCHAR_H_
|
9
|
+
#define FMT_XCHAR_H_
|
10
|
+
|
11
|
+
#include "color.h"
|
12
|
+
#include "format.h"
|
13
|
+
#include "ostream.h"
|
14
|
+
#include "ranges.h"
|
15
|
+
|
16
|
+
#ifndef FMT_MODULE
|
17
|
+
# include <cwchar>
|
18
|
+
# if FMT_USE_LOCALE
|
19
|
+
# include <locale>
|
20
|
+
# endif
|
21
|
+
#endif
|
22
|
+
|
23
|
+
FMT_BEGIN_NAMESPACE
|
24
|
+
namespace detail {
|
25
|
+
|
26
|
+
template <typename T>
|
27
|
+
using is_exotic_char = bool_constant<!std::is_same<T, char>::value>;
|
28
|
+
|
29
|
+
template <typename S, typename = void> struct format_string_char {};
|
30
|
+
|
31
|
+
template <typename S>
|
32
|
+
struct format_string_char<
|
33
|
+
S, void_t<decltype(sizeof(detail::to_string_view(std::declval<S>())))>> {
|
34
|
+
using type = char_t<S>;
|
35
|
+
};
|
36
|
+
|
37
|
+
template <typename S>
|
38
|
+
struct format_string_char<
|
39
|
+
S, enable_if_t<std::is_base_of<detail::compile_string, S>::value>> {
|
40
|
+
using type = typename S::char_type;
|
41
|
+
};
|
42
|
+
|
43
|
+
template <typename S>
|
44
|
+
using format_string_char_t = typename format_string_char<S>::type;
|
45
|
+
|
46
|
+
inline auto write_loc(basic_appender<wchar_t> out, loc_value value,
|
47
|
+
const format_specs& specs, locale_ref loc) -> bool {
|
48
|
+
#if FMT_USE_LOCALE
|
49
|
+
auto& numpunct =
|
50
|
+
std::use_facet<std::numpunct<wchar_t>>(loc.get<std::locale>());
|
51
|
+
auto separator = std::wstring();
|
52
|
+
auto grouping = numpunct.grouping();
|
53
|
+
if (!grouping.empty()) separator = std::wstring(1, numpunct.thousands_sep());
|
54
|
+
return value.visit(loc_writer<wchar_t>{out, specs, separator, grouping, {}});
|
55
|
+
#endif
|
56
|
+
return false;
|
57
|
+
}
|
58
|
+
} // namespace detail
|
59
|
+
|
60
|
+
FMT_BEGIN_EXPORT
|
61
|
+
|
62
|
+
using wstring_view = basic_string_view<wchar_t>;
|
63
|
+
using wformat_parse_context = parse_context<wchar_t>;
|
64
|
+
using wformat_context = buffered_context<wchar_t>;
|
65
|
+
using wformat_args = basic_format_args<wformat_context>;
|
66
|
+
using wmemory_buffer = basic_memory_buffer<wchar_t>;
|
67
|
+
|
68
|
+
template <typename Char, typename... T> struct basic_fstring {
|
69
|
+
private:
|
70
|
+
basic_string_view<Char> str_;
|
71
|
+
|
72
|
+
static constexpr int num_static_named_args =
|
73
|
+
detail::count_static_named_args<T...>();
|
74
|
+
|
75
|
+
using checker = detail::format_string_checker<
|
76
|
+
Char, static_cast<int>(sizeof...(T)), num_static_named_args,
|
77
|
+
num_static_named_args != detail::count_named_args<T...>()>;
|
78
|
+
|
79
|
+
using arg_pack = detail::arg_pack<T...>;
|
80
|
+
|
81
|
+
public:
|
82
|
+
using t = basic_fstring;
|
83
|
+
|
84
|
+
template <typename S,
|
85
|
+
FMT_ENABLE_IF(
|
86
|
+
std::is_convertible<const S&, basic_string_view<Char>>::value)>
|
87
|
+
FMT_CONSTEVAL FMT_ALWAYS_INLINE basic_fstring(const S& s) : str_(s) {
|
88
|
+
if (FMT_USE_CONSTEVAL)
|
89
|
+
detail::parse_format_string<Char>(s, checker(s, arg_pack()));
|
90
|
+
}
|
91
|
+
template <typename S,
|
92
|
+
FMT_ENABLE_IF(std::is_base_of<detail::compile_string, S>::value&&
|
93
|
+
std::is_same<typename S::char_type, Char>::value)>
|
94
|
+
FMT_ALWAYS_INLINE basic_fstring(const S&) : str_(S()) {
|
95
|
+
FMT_CONSTEXPR auto sv = basic_string_view<Char>(S());
|
96
|
+
FMT_CONSTEXPR int ignore =
|
97
|
+
(parse_format_string(sv, checker(sv, arg_pack())), 0);
|
98
|
+
detail::ignore_unused(ignore);
|
99
|
+
}
|
100
|
+
basic_fstring(runtime_format_string<Char> fmt) : str_(fmt.str) {}
|
101
|
+
|
102
|
+
operator basic_string_view<Char>() const { return str_; }
|
103
|
+
auto get() const -> basic_string_view<Char> { return str_; }
|
104
|
+
};
|
105
|
+
|
106
|
+
template <typename Char, typename... T>
|
107
|
+
using basic_format_string = basic_fstring<Char, T...>;
|
108
|
+
|
109
|
+
template <typename... T>
|
110
|
+
using wformat_string = typename basic_format_string<wchar_t, T...>::t;
|
111
|
+
inline auto runtime(wstring_view s) -> runtime_format_string<wchar_t> {
|
112
|
+
return {{s}};
|
113
|
+
}
|
114
|
+
|
115
|
+
template <> struct is_char<wchar_t> : std::true_type {};
|
116
|
+
template <> struct is_char<char16_t> : std::true_type {};
|
117
|
+
template <> struct is_char<char32_t> : std::true_type {};
|
118
|
+
|
119
|
+
#ifdef __cpp_char8_t
|
120
|
+
template <> struct is_char<char8_t> : bool_constant<detail::is_utf8_enabled> {};
|
121
|
+
#endif
|
122
|
+
|
123
|
+
template <typename... T>
|
124
|
+
constexpr auto make_wformat_args(T&... args)
|
125
|
+
-> decltype(fmt::make_format_args<wformat_context>(args...)) {
|
126
|
+
return fmt::make_format_args<wformat_context>(args...);
|
127
|
+
}
|
128
|
+
|
129
|
+
#if !FMT_USE_NONTYPE_TEMPLATE_ARGS
|
130
|
+
inline namespace literals {
|
131
|
+
inline auto operator""_a(const wchar_t* s, size_t) -> detail::udl_arg<wchar_t> {
|
132
|
+
return {s};
|
133
|
+
}
|
134
|
+
} // namespace literals
|
135
|
+
#endif
|
136
|
+
|
137
|
+
template <typename It, typename Sentinel>
|
138
|
+
auto join(It begin, Sentinel end, wstring_view sep)
|
139
|
+
-> join_view<It, Sentinel, wchar_t> {
|
140
|
+
return {begin, end, sep};
|
141
|
+
}
|
142
|
+
|
143
|
+
template <typename Range, FMT_ENABLE_IF(!is_tuple_like<Range>::value)>
|
144
|
+
auto join(Range&& range, wstring_view sep)
|
145
|
+
-> join_view<decltype(std::begin(range)), decltype(std::end(range)),
|
146
|
+
wchar_t> {
|
147
|
+
return join(std::begin(range), std::end(range), sep);
|
148
|
+
}
|
149
|
+
|
150
|
+
template <typename T>
|
151
|
+
auto join(std::initializer_list<T> list, wstring_view sep)
|
152
|
+
-> join_view<const T*, const T*, wchar_t> {
|
153
|
+
return join(std::begin(list), std::end(list), sep);
|
154
|
+
}
|
155
|
+
|
156
|
+
template <typename Tuple, FMT_ENABLE_IF(is_tuple_like<Tuple>::value)>
|
157
|
+
auto join(const Tuple& tuple, basic_string_view<wchar_t> sep)
|
158
|
+
-> tuple_join_view<wchar_t, Tuple> {
|
159
|
+
return {tuple, sep};
|
160
|
+
}
|
161
|
+
|
162
|
+
template <typename Char, FMT_ENABLE_IF(!std::is_same<Char, char>::value)>
|
163
|
+
auto vformat(basic_string_view<Char> fmt,
|
164
|
+
typename detail::vformat_args<Char>::type args)
|
165
|
+
-> std::basic_string<Char> {
|
166
|
+
auto buf = basic_memory_buffer<Char>();
|
167
|
+
detail::vformat_to(buf, fmt, args);
|
168
|
+
return {buf.data(), buf.size()};
|
169
|
+
}
|
170
|
+
|
171
|
+
template <typename... T>
|
172
|
+
auto format(wformat_string<T...> fmt, T&&... args) -> std::wstring {
|
173
|
+
return vformat(fmt::wstring_view(fmt), fmt::make_wformat_args(args...));
|
174
|
+
}
|
175
|
+
|
176
|
+
template <typename OutputIt, typename... T>
|
177
|
+
auto format_to(OutputIt out, wformat_string<T...> fmt, T&&... args)
|
178
|
+
-> OutputIt {
|
179
|
+
return vformat_to(out, fmt::wstring_view(fmt),
|
180
|
+
fmt::make_wformat_args(args...));
|
181
|
+
}
|
182
|
+
|
183
|
+
// Pass char_t as a default template parameter instead of using
|
184
|
+
// std::basic_string<char_t<S>> to reduce the symbol size.
|
185
|
+
template <typename S, typename... T,
|
186
|
+
typename Char = detail::format_string_char_t<S>,
|
187
|
+
FMT_ENABLE_IF(!std::is_same<Char, char>::value &&
|
188
|
+
!std::is_same<Char, wchar_t>::value)>
|
189
|
+
auto format(const S& fmt, T&&... args) -> std::basic_string<Char> {
|
190
|
+
return vformat(detail::to_string_view(fmt),
|
191
|
+
fmt::make_format_args<buffered_context<Char>>(args...));
|
192
|
+
}
|
193
|
+
|
194
|
+
template <typename Locale, typename S,
|
195
|
+
typename Char = detail::format_string_char_t<S>,
|
196
|
+
FMT_ENABLE_IF(detail::is_locale<Locale>::value&&
|
197
|
+
detail::is_exotic_char<Char>::value)>
|
198
|
+
inline auto vformat(const Locale& loc, const S& fmt,
|
199
|
+
typename detail::vformat_args<Char>::type args)
|
200
|
+
-> std::basic_string<Char> {
|
201
|
+
auto buf = basic_memory_buffer<Char>();
|
202
|
+
detail::vformat_to(buf, detail::to_string_view(fmt), args,
|
203
|
+
detail::locale_ref(loc));
|
204
|
+
return {buf.data(), buf.size()};
|
205
|
+
}
|
206
|
+
|
207
|
+
template <typename Locale, typename S, typename... T,
|
208
|
+
typename Char = detail::format_string_char_t<S>,
|
209
|
+
FMT_ENABLE_IF(detail::is_locale<Locale>::value&&
|
210
|
+
detail::is_exotic_char<Char>::value)>
|
211
|
+
inline auto format(const Locale& loc, const S& fmt, T&&... args)
|
212
|
+
-> std::basic_string<Char> {
|
213
|
+
return vformat(loc, detail::to_string_view(fmt),
|
214
|
+
fmt::make_format_args<buffered_context<Char>>(args...));
|
215
|
+
}
|
216
|
+
|
217
|
+
template <typename OutputIt, typename S,
|
218
|
+
typename Char = detail::format_string_char_t<S>,
|
219
|
+
FMT_ENABLE_IF(detail::is_output_iterator<OutputIt, Char>::value&&
|
220
|
+
detail::is_exotic_char<Char>::value)>
|
221
|
+
auto vformat_to(OutputIt out, const S& fmt,
|
222
|
+
typename detail::vformat_args<Char>::type args) -> OutputIt {
|
223
|
+
auto&& buf = detail::get_buffer<Char>(out);
|
224
|
+
detail::vformat_to(buf, detail::to_string_view(fmt), args);
|
225
|
+
return detail::get_iterator(buf, out);
|
226
|
+
}
|
227
|
+
|
228
|
+
template <typename OutputIt, typename S, typename... T,
|
229
|
+
typename Char = detail::format_string_char_t<S>,
|
230
|
+
FMT_ENABLE_IF(detail::is_output_iterator<OutputIt, Char>::value &&
|
231
|
+
!std::is_same<Char, char>::value &&
|
232
|
+
!std::is_same<Char, wchar_t>::value)>
|
233
|
+
inline auto format_to(OutputIt out, const S& fmt, T&&... args) -> OutputIt {
|
234
|
+
return vformat_to(out, detail::to_string_view(fmt),
|
235
|
+
fmt::make_format_args<buffered_context<Char>>(args...));
|
236
|
+
}
|
237
|
+
|
238
|
+
template <typename Locale, typename S, typename OutputIt, typename... Args,
|
239
|
+
typename Char = detail::format_string_char_t<S>,
|
240
|
+
FMT_ENABLE_IF(detail::is_output_iterator<OutputIt, Char>::value&&
|
241
|
+
detail::is_locale<Locale>::value&&
|
242
|
+
detail::is_exotic_char<Char>::value)>
|
243
|
+
inline auto vformat_to(OutputIt out, const Locale& loc, const S& fmt,
|
244
|
+
typename detail::vformat_args<Char>::type args)
|
245
|
+
-> OutputIt {
|
246
|
+
auto&& buf = detail::get_buffer<Char>(out);
|
247
|
+
vformat_to(buf, detail::to_string_view(fmt), args, detail::locale_ref(loc));
|
248
|
+
return detail::get_iterator(buf, out);
|
249
|
+
}
|
250
|
+
|
251
|
+
template <typename Locale, typename OutputIt, typename S, typename... T,
|
252
|
+
typename Char = detail::format_string_char_t<S>,
|
253
|
+
bool enable = detail::is_output_iterator<OutputIt, Char>::value &&
|
254
|
+
detail::is_locale<Locale>::value &&
|
255
|
+
detail::is_exotic_char<Char>::value>
|
256
|
+
inline auto format_to(OutputIt out, const Locale& loc, const S& fmt,
|
257
|
+
T&&... args) ->
|
258
|
+
typename std::enable_if<enable, OutputIt>::type {
|
259
|
+
return vformat_to(out, loc, detail::to_string_view(fmt),
|
260
|
+
fmt::make_format_args<buffered_context<Char>>(args...));
|
261
|
+
}
|
262
|
+
|
263
|
+
template <typename OutputIt, typename Char, typename... Args,
|
264
|
+
FMT_ENABLE_IF(detail::is_output_iterator<OutputIt, Char>::value&&
|
265
|
+
detail::is_exotic_char<Char>::value)>
|
266
|
+
inline auto vformat_to_n(OutputIt out, size_t n, basic_string_view<Char> fmt,
|
267
|
+
typename detail::vformat_args<Char>::type args)
|
268
|
+
-> format_to_n_result<OutputIt> {
|
269
|
+
using traits = detail::fixed_buffer_traits;
|
270
|
+
auto buf = detail::iterator_buffer<OutputIt, Char, traits>(out, n);
|
271
|
+
detail::vformat_to(buf, fmt, args);
|
272
|
+
return {buf.out(), buf.count()};
|
273
|
+
}
|
274
|
+
|
275
|
+
template <typename OutputIt, typename S, typename... T,
|
276
|
+
typename Char = detail::format_string_char_t<S>,
|
277
|
+
FMT_ENABLE_IF(detail::is_output_iterator<OutputIt, Char>::value&&
|
278
|
+
detail::is_exotic_char<Char>::value)>
|
279
|
+
inline auto format_to_n(OutputIt out, size_t n, const S& fmt, T&&... args)
|
280
|
+
-> format_to_n_result<OutputIt> {
|
281
|
+
return vformat_to_n(out, n, fmt::basic_string_view<Char>(fmt),
|
282
|
+
fmt::make_format_args<buffered_context<Char>>(args...));
|
283
|
+
}
|
284
|
+
|
285
|
+
template <typename S, typename... T,
|
286
|
+
typename Char = detail::format_string_char_t<S>,
|
287
|
+
FMT_ENABLE_IF(detail::is_exotic_char<Char>::value)>
|
288
|
+
inline auto formatted_size(const S& fmt, T&&... args) -> size_t {
|
289
|
+
auto buf = detail::counting_buffer<Char>();
|
290
|
+
detail::vformat_to(buf, detail::to_string_view(fmt),
|
291
|
+
fmt::make_format_args<buffered_context<Char>>(args...));
|
292
|
+
return buf.count();
|
293
|
+
}
|
294
|
+
|
295
|
+
inline void vprint(std::FILE* f, wstring_view fmt, wformat_args args) {
|
296
|
+
auto buf = wmemory_buffer();
|
297
|
+
detail::vformat_to(buf, fmt, args);
|
298
|
+
buf.push_back(L'\0');
|
299
|
+
if (std::fputws(buf.data(), f) == -1)
|
300
|
+
FMT_THROW(system_error(errno, FMT_STRING("cannot write to file")));
|
301
|
+
}
|
302
|
+
|
303
|
+
inline void vprint(wstring_view fmt, wformat_args args) {
|
304
|
+
vprint(stdout, fmt, args);
|
305
|
+
}
|
306
|
+
|
307
|
+
template <typename... T>
|
308
|
+
void print(std::FILE* f, wformat_string<T...> fmt, T&&... args) {
|
309
|
+
return vprint(f, wstring_view(fmt), fmt::make_wformat_args(args...));
|
310
|
+
}
|
311
|
+
|
312
|
+
template <typename... T> void print(wformat_string<T...> fmt, T&&... args) {
|
313
|
+
return vprint(wstring_view(fmt), fmt::make_wformat_args(args...));
|
314
|
+
}
|
315
|
+
|
316
|
+
template <typename... T>
|
317
|
+
void println(std::FILE* f, wformat_string<T...> fmt, T&&... args) {
|
318
|
+
return print(f, L"{}\n", fmt::format(fmt, std::forward<T>(args)...));
|
319
|
+
}
|
320
|
+
|
321
|
+
template <typename... T> void println(wformat_string<T...> fmt, T&&... args) {
|
322
|
+
return print(L"{}\n", fmt::format(fmt, std::forward<T>(args)...));
|
323
|
+
}
|
324
|
+
|
325
|
+
inline auto vformat(const text_style& ts, wstring_view fmt, wformat_args args)
|
326
|
+
-> std::wstring {
|
327
|
+
auto buf = wmemory_buffer();
|
328
|
+
detail::vformat_to(buf, ts, fmt, args);
|
329
|
+
return {buf.data(), buf.size()};
|
330
|
+
}
|
331
|
+
|
332
|
+
template <typename... T>
|
333
|
+
inline auto format(const text_style& ts, wformat_string<T...> fmt, T&&... args)
|
334
|
+
-> std::wstring {
|
335
|
+
return fmt::vformat(ts, fmt, fmt::make_wformat_args(args...));
|
336
|
+
}
|
337
|
+
|
338
|
+
template <typename... T>
|
339
|
+
FMT_DEPRECATED void print(std::FILE* f, const text_style& ts,
|
340
|
+
wformat_string<T...> fmt, const T&... args) {
|
341
|
+
vprint(f, ts, fmt, fmt::make_wformat_args(args...));
|
342
|
+
}
|
343
|
+
|
344
|
+
template <typename... T>
|
345
|
+
FMT_DEPRECATED void print(const text_style& ts, wformat_string<T...> fmt,
|
346
|
+
const T&... args) {
|
347
|
+
return print(stdout, ts, fmt, args...);
|
348
|
+
}
|
349
|
+
|
350
|
+
inline void vprint(std::wostream& os, wstring_view fmt, wformat_args args) {
|
351
|
+
auto buffer = basic_memory_buffer<wchar_t>();
|
352
|
+
detail::vformat_to(buffer, fmt, args);
|
353
|
+
detail::write_buffer(os, buffer);
|
354
|
+
}
|
355
|
+
|
356
|
+
template <typename... T>
|
357
|
+
void print(std::wostream& os, wformat_string<T...> fmt, T&&... args) {
|
358
|
+
vprint(os, fmt, fmt::make_format_args<buffered_context<wchar_t>>(args...));
|
359
|
+
}
|
360
|
+
|
361
|
+
template <typename... T>
|
362
|
+
void println(std::wostream& os, wformat_string<T...> fmt, T&&... args) {
|
363
|
+
print(os, L"{}\n", fmt::format(fmt, std::forward<T>(args)...));
|
364
|
+
}
|
365
|
+
|
366
|
+
/// Converts `value` to `std::wstring` using the default format for type `T`.
|
367
|
+
template <typename T> inline auto to_wstring(const T& value) -> std::wstring {
|
368
|
+
return format(FMT_STRING(L"{}"), value);
|
369
|
+
}
|
370
|
+
FMT_END_EXPORT
|
371
|
+
FMT_END_NAMESPACE
|
372
|
+
|
373
|
+
#endif // FMT_XCHAR_H_
|