diff --git a/DeviceAdapters/89NorthLDI/89North_LDI.vcxproj b/DeviceAdapters/89NorthLDI/89North_LDI.vcxproj index 23fe9b2e1..580efffec 100644 --- a/DeviceAdapters/89NorthLDI/89North_LDI.vcxproj +++ b/DeviceAdapters/89NorthLDI/89North_LDI.vcxproj @@ -21,13 +21,13 @@ DynamicLibrary true - v142 + v143 Unicode DynamicLibrary false - v142 + v143 true Unicode diff --git a/DeviceAdapters/AAAOTF/AAAOTF.vcxproj b/DeviceAdapters/AAAOTF/AAAOTF.vcxproj index 94a8c28a2..9369a217a 100644 --- a/DeviceAdapters/AAAOTF/AAAOTF.vcxproj +++ b/DeviceAdapters/AAAOTF/AAAOTF.vcxproj @@ -20,13 +20,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/ABS/ABSCamera.vcxproj b/DeviceAdapters/ABS/ABSCamera.vcxproj index 3de213e3a..ddd620d75 100644 --- a/DeviceAdapters/ABS/ABSCamera.vcxproj +++ b/DeviceAdapters/ABS/ABSCamera.vcxproj @@ -21,13 +21,13 @@ DynamicLibrary Unicode true - v142 + v143 false DynamicLibrary Unicode - v142 + v143 true diff --git a/DeviceAdapters/AOTF/AOTF.vcxproj b/DeviceAdapters/AOTF/AOTF.vcxproj index 4cc840963..32fda92f8 100644 --- a/DeviceAdapters/AOTF/AOTF.vcxproj +++ b/DeviceAdapters/AOTF/AOTF.vcxproj @@ -20,13 +20,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/ASIFW1000/ASIFW1000.vcxproj b/DeviceAdapters/ASIFW1000/ASIFW1000.vcxproj index 5c01acc5f..28dc0280b 100644 --- a/DeviceAdapters/ASIFW1000/ASIFW1000.vcxproj +++ b/DeviceAdapters/ASIFW1000/ASIFW1000.vcxproj @@ -20,13 +20,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/ASIStage/ASIStage.vcxproj b/DeviceAdapters/ASIStage/ASIStage.vcxproj index 5e316356d..91a9f4401 100644 --- a/DeviceAdapters/ASIStage/ASIStage.vcxproj +++ b/DeviceAdapters/ASIStage/ASIStage.vcxproj @@ -20,13 +20,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true @@ -124,4 +124,4 @@ - + \ No newline at end of file diff --git a/DeviceAdapters/ASITiger/ASITiger.vcxproj b/DeviceAdapters/ASITiger/ASITiger.vcxproj index d6f9b5dee..727d67e90 100644 --- a/DeviceAdapters/ASITiger/ASITiger.vcxproj +++ b/DeviceAdapters/ASITiger/ASITiger.vcxproj @@ -20,13 +20,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true @@ -136,4 +136,4 @@ - + \ No newline at end of file diff --git a/DeviceAdapters/ASIWPTR/ASIwptr.vcxproj b/DeviceAdapters/ASIWPTR/ASIwptr.vcxproj index b4974caf5..b0355d1ed 100644 --- a/DeviceAdapters/ASIWPTR/ASIwptr.vcxproj +++ b/DeviceAdapters/ASIWPTR/ASIwptr.vcxproj @@ -21,13 +21,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/AgilentLaserCombiner/AgilentLaserCombiner.vcxproj b/DeviceAdapters/AgilentLaserCombiner/AgilentLaserCombiner.vcxproj index 8366720b3..7785dcafc 100644 --- a/DeviceAdapters/AgilentLaserCombiner/AgilentLaserCombiner.vcxproj +++ b/DeviceAdapters/AgilentLaserCombiner/AgilentLaserCombiner.vcxproj @@ -21,13 +21,13 @@ DynamicLibrary MultiByte true - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/Aladdin/Aladdin.vcxproj b/DeviceAdapters/Aladdin/Aladdin.vcxproj index 99f316a12..c7b0e62cf 100644 --- a/DeviceAdapters/Aladdin/Aladdin.vcxproj +++ b/DeviceAdapters/Aladdin/Aladdin.vcxproj @@ -20,13 +20,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/AlliedVisionCamera/AlliedVisionCamera.vcxproj b/DeviceAdapters/AlliedVisionCamera/AlliedVisionCamera.vcxproj index 1aa16787b..2de89f15f 100644 --- a/DeviceAdapters/AlliedVisionCamera/AlliedVisionCamera.vcxproj +++ b/DeviceAdapters/AlliedVisionCamera/AlliedVisionCamera.vcxproj @@ -39,13 +39,13 @@ DynamicLibrary true - v142 + v143 Unicode DynamicLibrary false - v142 + v143 true Unicode diff --git a/DeviceAdapters/AmScope/AmScope.vcxproj b/DeviceAdapters/AmScope/AmScope.vcxproj index 49ed05569..e89ccad9f 100644 --- a/DeviceAdapters/AmScope/AmScope.vcxproj +++ b/DeviceAdapters/AmScope/AmScope.vcxproj @@ -21,14 +21,14 @@ DynamicLibrary true Unicode - v142 + v143 DynamicLibrary false false MultiByte - v142 + v143 diff --git a/DeviceAdapters/Andor/Andor.vcxproj b/DeviceAdapters/Andor/Andor.vcxproj index f2b158b08..d854e4663 100644 --- a/DeviceAdapters/Andor/Andor.vcxproj +++ b/DeviceAdapters/Andor/Andor.vcxproj @@ -20,13 +20,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/AndorLaserCombiner/AndorLaserCombiner.vcxproj b/DeviceAdapters/AndorLaserCombiner/AndorLaserCombiner.vcxproj index 0f40d9fa5..5077bdd78 100644 --- a/DeviceAdapters/AndorLaserCombiner/AndorLaserCombiner.vcxproj +++ b/DeviceAdapters/AndorLaserCombiner/AndorLaserCombiner.vcxproj @@ -20,13 +20,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/AndorSDK3/AndorSDK3.vcxproj b/DeviceAdapters/AndorSDK3/AndorSDK3.vcxproj index 6b0b25608..38237c1e5 100644 --- a/DeviceAdapters/AndorSDK3/AndorSDK3.vcxproj +++ b/DeviceAdapters/AndorSDK3/AndorSDK3.vcxproj @@ -20,13 +20,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/AndorShamrock/AndorShamrock.vcxproj b/DeviceAdapters/AndorShamrock/AndorShamrock.vcxproj index 4f7dd0d60..35b56121b 100755 --- a/DeviceAdapters/AndorShamrock/AndorShamrock.vcxproj +++ b/DeviceAdapters/AndorShamrock/AndorShamrock.vcxproj @@ -20,13 +20,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/Aquinas/Aquinas.vcxproj b/DeviceAdapters/Aquinas/Aquinas.vcxproj index 87969e1d4..85374042c 100644 --- a/DeviceAdapters/Aquinas/Aquinas.vcxproj +++ b/DeviceAdapters/Aquinas/Aquinas.vcxproj @@ -21,13 +21,13 @@ DynamicLibrary Unicode true - v142 + v143 false DynamicLibrary Unicode - v142 + v143 true diff --git a/DeviceAdapters/Arduino/Arduino.vcxproj b/DeviceAdapters/Arduino/Arduino.vcxproj index 4cd4566bc..26f80dcf3 100644 --- a/DeviceAdapters/Arduino/Arduino.vcxproj +++ b/DeviceAdapters/Arduino/Arduino.vcxproj @@ -20,13 +20,13 @@ DynamicLibrary MultiByte true - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/Arduino32bitBoards/Arduino32bitBoards.vcxproj b/DeviceAdapters/Arduino32bitBoards/Arduino32bitBoards.vcxproj index efb53fdf6..77e21c6df 100644 --- a/DeviceAdapters/Arduino32bitBoards/Arduino32bitBoards.vcxproj +++ b/DeviceAdapters/Arduino32bitBoards/Arduino32bitBoards.vcxproj @@ -20,13 +20,13 @@ DynamicLibrary MultiByte true - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/Atik/AtikCamera.vcxproj b/DeviceAdapters/Atik/AtikCamera.vcxproj index c53fc01ef..f32a11373 100644 --- a/DeviceAdapters/Atik/AtikCamera.vcxproj +++ b/DeviceAdapters/Atik/AtikCamera.vcxproj @@ -22,13 +22,13 @@ DynamicLibrary Unicode true - v142 + v143 false DynamicLibrary Unicode - v142 + v143 true diff --git a/DeviceAdapters/BDPathway/BDPathway.vcxproj b/DeviceAdapters/BDPathway/BDPathway.vcxproj index 48e2b735d..869bd9b6b 100644 --- a/DeviceAdapters/BDPathway/BDPathway.vcxproj +++ b/DeviceAdapters/BDPathway/BDPathway.vcxproj @@ -20,13 +20,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/BH_DCC_DCU/BH_DCC_DCU.vcxproj b/DeviceAdapters/BH_DCC_DCU/BH_DCC_DCU.vcxproj index 778cd1b5d..c74c11cd2 100644 --- a/DeviceAdapters/BH_DCC_DCU/BH_DCC_DCU.vcxproj +++ b/DeviceAdapters/BH_DCC_DCU/BH_DCC_DCU.vcxproj @@ -36,13 +36,13 @@ DynamicLibrary true - v142 + v143 Unicode DynamicLibrary false - v142 + v143 true Unicode diff --git a/DeviceAdapters/Basler/BaslerPylon.vcxproj b/DeviceAdapters/Basler/BaslerPylon.vcxproj index 6887a2011..39c790ba3 100644 --- a/DeviceAdapters/Basler/BaslerPylon.vcxproj +++ b/DeviceAdapters/Basler/BaslerPylon.vcxproj @@ -22,13 +22,13 @@ DynamicLibrary Unicode true - v142 + v143 false DynamicLibrary Unicode - v142 + v143 true diff --git a/DeviceAdapters/BaumerOptronic/BaumerOptronic.vcxproj b/DeviceAdapters/BaumerOptronic/BaumerOptronic.vcxproj index 1c2f9a3f5..623a2e07c 100644 --- a/DeviceAdapters/BaumerOptronic/BaumerOptronic.vcxproj +++ b/DeviceAdapters/BaumerOptronic/BaumerOptronic.vcxproj @@ -20,13 +20,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/BlueboxOptics_niji/BlueboxOptics_niji.vcxproj b/DeviceAdapters/BlueboxOptics_niji/BlueboxOptics_niji.vcxproj index cf046bc20..dde4878bf 100644 --- a/DeviceAdapters/BlueboxOptics_niji/BlueboxOptics_niji.vcxproj +++ b/DeviceAdapters/BlueboxOptics_niji/BlueboxOptics_niji.vcxproj @@ -20,13 +20,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/CARVII/CARVII.vcxproj b/DeviceAdapters/CARVII/CARVII.vcxproj index 22f15d7be..d8ecdc3ea 100644 --- a/DeviceAdapters/CARVII/CARVII.vcxproj +++ b/DeviceAdapters/CARVII/CARVII.vcxproj @@ -21,13 +21,13 @@ DynamicLibrary Unicode true - v142 + v143 false DynamicLibrary Unicode - v142 + v143 true diff --git a/DeviceAdapters/CNCMicroscope/ArduinoNeoPixelShutter/ArduinoNeoPixel.vcxproj b/DeviceAdapters/CNCMicroscope/ArduinoNeoPixelShutter/ArduinoNeoPixel.vcxproj index 14d037163..5379b8636 100644 --- a/DeviceAdapters/CNCMicroscope/ArduinoNeoPixelShutter/ArduinoNeoPixel.vcxproj +++ b/DeviceAdapters/CNCMicroscope/ArduinoNeoPixelShutter/ArduinoNeoPixel.vcxproj @@ -22,14 +22,14 @@ DynamicLibrary true Unicode - v142 + v143 DynamicLibrary false true Unicode - v142 + v143 diff --git a/DeviceAdapters/CNCMicroscope/RAMPSStage/RAMPS.vcxproj b/DeviceAdapters/CNCMicroscope/RAMPSStage/RAMPS.vcxproj index 1ae6fe210..b6e8bede3 100644 --- a/DeviceAdapters/CNCMicroscope/RAMPSStage/RAMPS.vcxproj +++ b/DeviceAdapters/CNCMicroscope/RAMPSStage/RAMPS.vcxproj @@ -22,14 +22,14 @@ DynamicLibrary true Unicode - v142 + v143 DynamicLibrary false true Unicode - v142 + v143 diff --git a/DeviceAdapters/CSUW1/CSUW1.vcxproj b/DeviceAdapters/CSUW1/CSUW1.vcxproj index 126183015..cc1771a64 100644 --- a/DeviceAdapters/CSUW1/CSUW1.vcxproj +++ b/DeviceAdapters/CSUW1/CSUW1.vcxproj @@ -20,13 +20,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/ChuoSeiki_MD5000/ChuoSeiki_MD5000.vcxproj b/DeviceAdapters/ChuoSeiki_MD5000/ChuoSeiki_MD5000.vcxproj index 74e893589..443903f01 100644 --- a/DeviceAdapters/ChuoSeiki_MD5000/ChuoSeiki_MD5000.vcxproj +++ b/DeviceAdapters/ChuoSeiki_MD5000/ChuoSeiki_MD5000.vcxproj @@ -21,14 +21,14 @@ DynamicLibrary true Unicode - v142 + v143 DynamicLibrary false false Unicode - v142 + v143 diff --git a/DeviceAdapters/ChuoSeiki_QT/ChuoSeiki_QT.vcxproj b/DeviceAdapters/ChuoSeiki_QT/ChuoSeiki_QT.vcxproj index 1aad1c44a..d1178a235 100644 --- a/DeviceAdapters/ChuoSeiki_QT/ChuoSeiki_QT.vcxproj +++ b/DeviceAdapters/ChuoSeiki_QT/ChuoSeiki_QT.vcxproj @@ -22,14 +22,14 @@ DynamicLibrary true Unicode - v142 + v143 DynamicLibrary false true Unicode - v142 + v143 diff --git a/DeviceAdapters/Cobolt/Cobolt.vcxproj b/DeviceAdapters/Cobolt/Cobolt.vcxproj index ed40fb2bf..7eb308896 100644 --- a/DeviceAdapters/Cobolt/Cobolt.vcxproj +++ b/DeviceAdapters/Cobolt/Cobolt.vcxproj @@ -20,13 +20,13 @@ DynamicLibrary NotSet - v142 + v143 false DynamicLibrary NotSet - v142 + v143 true diff --git a/DeviceAdapters/CoboltOfficial/CoboltOfficial.vcxproj b/DeviceAdapters/CoboltOfficial/CoboltOfficial.vcxproj index c72d40364..3360f6e6b 100644 --- a/DeviceAdapters/CoboltOfficial/CoboltOfficial.vcxproj +++ b/DeviceAdapters/CoboltOfficial/CoboltOfficial.vcxproj @@ -21,14 +21,14 @@ DynamicLibrary true Unicode - v142 + v143 DynamicLibrary false true Unicode - v142 + v143 diff --git a/DeviceAdapters/CoherentCube/CoherentCube.vcxproj b/DeviceAdapters/CoherentCube/CoherentCube.vcxproj index b12fd7fc7..99ec1f286 100644 --- a/DeviceAdapters/CoherentCube/CoherentCube.vcxproj +++ b/DeviceAdapters/CoherentCube/CoherentCube.vcxproj @@ -20,13 +20,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/CoherentOBIS/CoherentOBIS.vcxproj b/DeviceAdapters/CoherentOBIS/CoherentOBIS.vcxproj index dcd8a6e52..abc737923 100644 --- a/DeviceAdapters/CoherentOBIS/CoherentOBIS.vcxproj +++ b/DeviceAdapters/CoherentOBIS/CoherentOBIS.vcxproj @@ -21,14 +21,14 @@ DynamicLibrary true Unicode - v142 + v143 DynamicLibrary false true Unicode - v142 + v143 diff --git a/DeviceAdapters/CoherentScientificRemote/CoherentScientificRemote.vcxproj b/DeviceAdapters/CoherentScientificRemote/CoherentScientificRemote.vcxproj index 1778fe481..8b1c814ae 100644 --- a/DeviceAdapters/CoherentScientificRemote/CoherentScientificRemote.vcxproj +++ b/DeviceAdapters/CoherentScientificRemote/CoherentScientificRemote.vcxproj @@ -21,14 +21,14 @@ DynamicLibrary true Unicode - v142 + v143 DynamicLibrary false true Unicode - v142 + v143 diff --git a/DeviceAdapters/Conix/Conix.vcxproj b/DeviceAdapters/Conix/Conix.vcxproj index c12d473c2..9e697d01d 100644 --- a/DeviceAdapters/Conix/Conix.vcxproj +++ b/DeviceAdapters/Conix/Conix.vcxproj @@ -21,13 +21,13 @@ DynamicLibrary MultiByte true - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/CoolLEDpE300/pE300.vcxproj b/DeviceAdapters/CoolLEDpE300/pE300.vcxproj index ee1ac8388..5a240a7a1 100644 --- a/DeviceAdapters/CoolLEDpE300/pE300.vcxproj +++ b/DeviceAdapters/CoolLEDpE300/pE300.vcxproj @@ -22,14 +22,14 @@ DynamicLibrary true Unicode - v142 + v143 DynamicLibrary false true Unicode - v142 + v143 diff --git a/DeviceAdapters/CoolLEDpE4000/pE4000.vcxproj b/DeviceAdapters/CoolLEDpE4000/pE4000.vcxproj index 3eae4bafa..2b4015b07 100644 --- a/DeviceAdapters/CoolLEDpE4000/pE4000.vcxproj +++ b/DeviceAdapters/CoolLEDpE4000/pE4000.vcxproj @@ -22,14 +22,14 @@ DynamicLibrary true Unicode - v142 + v143 DynamicLibrary false true Unicode - v142 + v143 diff --git a/DeviceAdapters/Corvus/Corvus.vcxproj b/DeviceAdapters/Corvus/Corvus.vcxproj index eba0ee6b9..a395a0479 100644 --- a/DeviceAdapters/Corvus/Corvus.vcxproj +++ b/DeviceAdapters/Corvus/Corvus.vcxproj @@ -20,13 +20,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/DTOpenLayer/DTOpenLayer.vcxproj b/DeviceAdapters/DTOpenLayer/DTOpenLayer.vcxproj index 6e3e9e09b..db94da919 100644 --- a/DeviceAdapters/DTOpenLayer/DTOpenLayer.vcxproj +++ b/DeviceAdapters/DTOpenLayer/DTOpenLayer.vcxproj @@ -20,13 +20,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/DirectElectron/vsprojects/DECamera.vcxproj b/DeviceAdapters/DirectElectron/vsprojects/DECamera.vcxproj index ffd6e9b6b..bc8b63b77 100644 --- a/DeviceAdapters/DirectElectron/vsprojects/DECamera.vcxproj +++ b/DeviceAdapters/DirectElectron/vsprojects/DECamera.vcxproj @@ -20,13 +20,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/DirectElectron/vsprojects/DEClientLib.vcxproj b/DeviceAdapters/DirectElectron/vsprojects/DEClientLib.vcxproj index 2efd13095..3aa7bb6d6 100644 --- a/DeviceAdapters/DirectElectron/vsprojects/DEClientLib.vcxproj +++ b/DeviceAdapters/DirectElectron/vsprojects/DEClientLib.vcxproj @@ -20,13 +20,13 @@ StaticLibrary Unicode - v142 + v143 false StaticLibrary Unicode - v142 + v143 true @@ -97,4 +97,4 @@ - + \ No newline at end of file diff --git a/DeviceAdapters/DirectElectron/vsprojects/DEMessaging.vcxproj b/DeviceAdapters/DirectElectron/vsprojects/DEMessaging.vcxproj index 20bfd106c..6efb50877 100644 --- a/DeviceAdapters/DirectElectron/vsprojects/DEMessaging.vcxproj +++ b/DeviceAdapters/DirectElectron/vsprojects/DEMessaging.vcxproj @@ -20,13 +20,13 @@ StaticLibrary Unicode - v142 + v143 false StaticLibrary Unicode - v142 + v143 true @@ -106,4 +106,4 @@ - + \ No newline at end of file diff --git a/DeviceAdapters/Diskovery/Diskovery.vcxproj b/DeviceAdapters/Diskovery/Diskovery.vcxproj index 9d537e7db..26a62bb34 100644 --- a/DeviceAdapters/Diskovery/Diskovery.vcxproj +++ b/DeviceAdapters/Diskovery/Diskovery.vcxproj @@ -21,14 +21,14 @@ DynamicLibrary true Unicode - v142 + v143 DynamicLibrary false true Unicode - v142 + v143 diff --git a/DeviceAdapters/Dragonfly/Dragonfly.vcxproj b/DeviceAdapters/Dragonfly/Dragonfly.vcxproj index 94dea928e..f07e24ad2 100644 --- a/DeviceAdapters/Dragonfly/Dragonfly.vcxproj +++ b/DeviceAdapters/Dragonfly/Dragonfly.vcxproj @@ -20,13 +20,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/ESP32/ESP32.vcxproj b/DeviceAdapters/ESP32/ESP32.vcxproj index cfbd67cdd..de65f1311 100644 --- a/DeviceAdapters/ESP32/ESP32.vcxproj +++ b/DeviceAdapters/ESP32/ESP32.vcxproj @@ -32,13 +32,13 @@ DynamicLibrary true - v142 + v143 Unicode DynamicLibrary false - v142 + v143 true Unicode diff --git a/DeviceAdapters/ETL/ETL.vcxproj b/DeviceAdapters/ETL/ETL.vcxproj index 0a8350c0f..824dc4ee7 100644 --- a/DeviceAdapters/ETL/ETL.vcxproj +++ b/DeviceAdapters/ETL/ETL.vcxproj @@ -32,13 +32,13 @@ DynamicLibrary true - v142 + v143 Unicode DynamicLibrary false - v142 + v143 true Unicode diff --git a/DeviceAdapters/FLICamera/FLICamera.vcxproj b/DeviceAdapters/FLICamera/FLICamera.vcxproj index ab3d95c9f..52641a83e 100644 --- a/DeviceAdapters/FLICamera/FLICamera.vcxproj +++ b/DeviceAdapters/FLICamera/FLICamera.vcxproj @@ -20,13 +20,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/FakeCamera/FakeCamera.vcxproj b/DeviceAdapters/FakeCamera/FakeCamera.vcxproj index 5f17ae5a0..f86688b60 100644 --- a/DeviceAdapters/FakeCamera/FakeCamera.vcxproj +++ b/DeviceAdapters/FakeCamera/FakeCamera.vcxproj @@ -21,14 +21,14 @@ DynamicLibrary true Unicode - v142 + v143 DynamicLibrary false true Unicode - v142 + v143 diff --git a/DeviceAdapters/Fli/FirstLightImagingCameras.vcxproj b/DeviceAdapters/Fli/FirstLightImagingCameras.vcxproj index 97d40631b..b54e4d9b7 100644 --- a/DeviceAdapters/Fli/FirstLightImagingCameras.vcxproj +++ b/DeviceAdapters/Fli/FirstLightImagingCameras.vcxproj @@ -20,13 +20,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/FreeSerialPort/FreeSerialPort.vcxproj b/DeviceAdapters/FreeSerialPort/FreeSerialPort.vcxproj index 895843efb..1bebbbc19 100644 --- a/DeviceAdapters/FreeSerialPort/FreeSerialPort.vcxproj +++ b/DeviceAdapters/FreeSerialPort/FreeSerialPort.vcxproj @@ -20,13 +20,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/GenericSLM/GenericSLM.vcxproj b/DeviceAdapters/GenericSLM/GenericSLM.vcxproj index 25c64c9d9..7d5e256c5 100644 --- a/DeviceAdapters/GenericSLM/GenericSLM.vcxproj +++ b/DeviceAdapters/GenericSLM/GenericSLM.vcxproj @@ -20,13 +20,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/GigECamera/GigECamera.vcxproj b/DeviceAdapters/GigECamera/GigECamera.vcxproj index 292d8ccc0..7f7b8d4b1 100644 --- a/DeviceAdapters/GigECamera/GigECamera.vcxproj +++ b/DeviceAdapters/GigECamera/GigECamera.vcxproj @@ -20,13 +20,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/HIDManager/HIDManager.vcxproj b/DeviceAdapters/HIDManager/HIDManager.vcxproj index c7619795b..7b6cf3a8c 100644 --- a/DeviceAdapters/HIDManager/HIDManager.vcxproj +++ b/DeviceAdapters/HIDManager/HIDManager.vcxproj @@ -20,13 +20,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/HamiltonMVP/HamiltonMVP.vcxproj b/DeviceAdapters/HamiltonMVP/HamiltonMVP.vcxproj index 321c9c0b6..ae7e5c341 100644 --- a/DeviceAdapters/HamiltonMVP/HamiltonMVP.vcxproj +++ b/DeviceAdapters/HamiltonMVP/HamiltonMVP.vcxproj @@ -21,14 +21,14 @@ DynamicLibrary true Unicode - v142 + v143 DynamicLibrary false true Unicode - v142 + v143 diff --git a/DeviceAdapters/HydraLMT200/Hydra.vcxproj b/DeviceAdapters/HydraLMT200/Hydra.vcxproj index d1bd18c01..66854c804 100644 --- a/DeviceAdapters/HydraLMT200/Hydra.vcxproj +++ b/DeviceAdapters/HydraLMT200/Hydra.vcxproj @@ -21,14 +21,14 @@ DynamicLibrary true Unicode - v142 + v143 DynamicLibrary false true Unicode - v142 + v143 diff --git a/DeviceAdapters/IDSPeak/IDSPeak.vcxproj b/DeviceAdapters/IDSPeak/IDSPeak.vcxproj index 95c7f99e3..431e2f805 100644 --- a/DeviceAdapters/IDSPeak/IDSPeak.vcxproj +++ b/DeviceAdapters/IDSPeak/IDSPeak.vcxproj @@ -35,13 +35,13 @@ DynamicLibrary true - v142 + v143 Unicode DynamicLibrary false - v142 + v143 true Unicode diff --git a/DeviceAdapters/IDS_uEye/IDS_uEye.vcxproj b/DeviceAdapters/IDS_uEye/IDS_uEye.vcxproj index bb8eaf744..9e459879a 100644 --- a/DeviceAdapters/IDS_uEye/IDS_uEye.vcxproj +++ b/DeviceAdapters/IDS_uEye/IDS_uEye.vcxproj @@ -21,13 +21,13 @@ DynamicLibrary Unicode true - v142 + v143 false DynamicLibrary Unicode - v142 + v143 true @@ -102,4 +102,4 @@ - + \ No newline at end of file diff --git a/DeviceAdapters/IIDC/IIDC.vcxproj b/DeviceAdapters/IIDC/IIDC.vcxproj index aaf3284c3..19eb2265b 100644 --- a/DeviceAdapters/IIDC/IIDC.vcxproj +++ b/DeviceAdapters/IIDC/IIDC.vcxproj @@ -20,13 +20,13 @@ DynamicLibrary true Unicode - v142 + v143 DynamicLibrary false Unicode - v142 + v143 diff --git a/DeviceAdapters/IlluminateLEDArray/LEDArray.vcxproj b/DeviceAdapters/IlluminateLEDArray/LEDArray.vcxproj index 4c49f2a70..5471bccf6 100644 --- a/DeviceAdapters/IlluminateLEDArray/LEDArray.vcxproj +++ b/DeviceAdapters/IlluminateLEDArray/LEDArray.vcxproj @@ -21,13 +21,13 @@ DynamicLibrary MultiByte true - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/ImageProcessorChain/ImageProcessorChain.vcxproj b/DeviceAdapters/ImageProcessorChain/ImageProcessorChain.vcxproj index e97daa27c..6d7b879c1 100644 --- a/DeviceAdapters/ImageProcessorChain/ImageProcessorChain.vcxproj +++ b/DeviceAdapters/ImageProcessorChain/ImageProcessorChain.vcxproj @@ -20,13 +20,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/IntegratedLaserEngine/IntegratedLaserEngine.vcxproj b/DeviceAdapters/IntegratedLaserEngine/IntegratedLaserEngine.vcxproj index a021d2ebb..b2fb25807 100644 --- a/DeviceAdapters/IntegratedLaserEngine/IntegratedLaserEngine.vcxproj +++ b/DeviceAdapters/IntegratedLaserEngine/IntegratedLaserEngine.vcxproj @@ -21,13 +21,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/IsmatecMCP/IsmatecMCP.vcxproj b/DeviceAdapters/IsmatecMCP/IsmatecMCP.vcxproj index cd3180593..a0bf24f24 100644 --- a/DeviceAdapters/IsmatecMCP/IsmatecMCP.vcxproj +++ b/DeviceAdapters/IsmatecMCP/IsmatecMCP.vcxproj @@ -21,14 +21,14 @@ DynamicLibrary true Unicode - v142 + v143 DynamicLibrary false true Unicode - v142 + v143 diff --git a/DeviceAdapters/JAI/JAI.vcxproj b/DeviceAdapters/JAI/JAI.vcxproj index 999abf8b5..2bb018861 100644 --- a/DeviceAdapters/JAI/JAI.vcxproj +++ b/DeviceAdapters/JAI/JAI.vcxproj @@ -21,13 +21,13 @@ DynamicLibrary MultiByte true - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/K8055/K8055.vcxproj b/DeviceAdapters/K8055/K8055.vcxproj index fe862a340..d572c5a7e 100644 --- a/DeviceAdapters/K8055/K8055.vcxproj +++ b/DeviceAdapters/K8055/K8055.vcxproj @@ -21,13 +21,13 @@ DynamicLibrary NotSet true - v142 + v143 false DynamicLibrary NotSet - v142 + v143 true diff --git a/DeviceAdapters/K8061/K8061.vcxproj b/DeviceAdapters/K8061/K8061.vcxproj index 34ade99ff..605ec644c 100644 --- a/DeviceAdapters/K8061/K8061.vcxproj +++ b/DeviceAdapters/K8061/K8061.vcxproj @@ -21,13 +21,13 @@ DynamicLibrary MultiByte true - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/KuriosLCTF/KuriosLCTF.vcxproj b/DeviceAdapters/KuriosLCTF/KuriosLCTF.vcxproj index 1b134e9c9..832ae4d4b 100644 --- a/DeviceAdapters/KuriosLCTF/KuriosLCTF.vcxproj +++ b/DeviceAdapters/KuriosLCTF/KuriosLCTF.vcxproj @@ -21,14 +21,14 @@ DynamicLibrary true Unicode - v142 + v143 DynamicLibrary false true Unicode - v142 + v143 diff --git a/DeviceAdapters/LaserQuantumLaser/LaserQuantumLaser.vcxproj b/DeviceAdapters/LaserQuantumLaser/LaserQuantumLaser.vcxproj index 043ae77b1..c857bbe23 100644 --- a/DeviceAdapters/LaserQuantumLaser/LaserQuantumLaser.vcxproj +++ b/DeviceAdapters/LaserQuantumLaser/LaserQuantumLaser.vcxproj @@ -21,13 +21,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/LeicaDMI/LeicaDMI.vcxproj b/DeviceAdapters/LeicaDMI/LeicaDMI.vcxproj index 887b9b6f2..8d768ad4d 100644 --- a/DeviceAdapters/LeicaDMI/LeicaDMI.vcxproj +++ b/DeviceAdapters/LeicaDMI/LeicaDMI.vcxproj @@ -21,13 +21,13 @@ DynamicLibrary MultiByte true - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/LeicaDMR/LeicaDMR.vcxproj b/DeviceAdapters/LeicaDMR/LeicaDMR.vcxproj index af4c61796..58d6fcc53 100644 --- a/DeviceAdapters/LeicaDMR/LeicaDMR.vcxproj +++ b/DeviceAdapters/LeicaDMR/LeicaDMR.vcxproj @@ -20,13 +20,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/LeicaDMSTC/LeicaDMSTC.vcxproj b/DeviceAdapters/LeicaDMSTC/LeicaDMSTC.vcxproj index e3b42ae2d..8188da47b 100644 --- a/DeviceAdapters/LeicaDMSTC/LeicaDMSTC.vcxproj +++ b/DeviceAdapters/LeicaDMSTC/LeicaDMSTC.vcxproj @@ -20,13 +20,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/LightSheetManager/LightSheetManager.vcxproj b/DeviceAdapters/LightSheetManager/LightSheetManager.vcxproj index 0ad3ea46b..f826188e4 100644 --- a/DeviceAdapters/LightSheetManager/LightSheetManager.vcxproj +++ b/DeviceAdapters/LightSheetManager/LightSheetManager.vcxproj @@ -21,13 +21,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/Ludl/Ludl.vcxproj b/DeviceAdapters/Ludl/Ludl.vcxproj index 0d5690b51..b94fdf0c4 100644 --- a/DeviceAdapters/Ludl/Ludl.vcxproj +++ b/DeviceAdapters/Ludl/Ludl.vcxproj @@ -20,13 +20,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/LudlLow/LudlLow.vcxproj b/DeviceAdapters/LudlLow/LudlLow.vcxproj index 28c8b1955..893776672 100644 --- a/DeviceAdapters/LudlLow/LudlLow.vcxproj +++ b/DeviceAdapters/LudlLow/LudlLow.vcxproj @@ -19,13 +19,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/Lumencor/Lumencor.vcxproj b/DeviceAdapters/Lumencor/Lumencor.vcxproj index 9c65d2d99..0d3a50abc 100644 --- a/DeviceAdapters/Lumencor/Lumencor.vcxproj +++ b/DeviceAdapters/Lumencor/Lumencor.vcxproj @@ -21,13 +21,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/LumencorCIA/LumencorCIA.vcxproj b/DeviceAdapters/LumencorCIA/LumencorCIA.vcxproj index d01624337..4fec1ee4f 100644 --- a/DeviceAdapters/LumencorCIA/LumencorCIA.vcxproj +++ b/DeviceAdapters/LumencorCIA/LumencorCIA.vcxproj @@ -20,13 +20,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/LumencorSpectra/LumencorSpectra.vcxproj b/DeviceAdapters/LumencorSpectra/LumencorSpectra.vcxproj index f5a0adb18..8bfdf9eb2 100644 --- a/DeviceAdapters/LumencorSpectra/LumencorSpectra.vcxproj +++ b/DeviceAdapters/LumencorSpectra/LumencorSpectra.vcxproj @@ -21,13 +21,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/Lumenera/Lumenera.vcxproj b/DeviceAdapters/Lumenera/Lumenera.vcxproj index dea13c7f1..186af0299 100644 --- a/DeviceAdapters/Lumenera/Lumenera.vcxproj +++ b/DeviceAdapters/Lumenera/Lumenera.vcxproj @@ -34,13 +34,13 @@ DynamicLibrary true - v142 + v143 Unicode DynamicLibrary false - v142 + v143 true Unicode diff --git a/DeviceAdapters/MCCDAQ/MCCDAQ.vcxproj b/DeviceAdapters/MCCDAQ/MCCDAQ.vcxproj index 57d213f8a..69e2a6e8a 100644 --- a/DeviceAdapters/MCCDAQ/MCCDAQ.vcxproj +++ b/DeviceAdapters/MCCDAQ/MCCDAQ.vcxproj @@ -20,13 +20,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/MCL_MicroDrive/MCL_MicroDrive.vcxproj b/DeviceAdapters/MCL_MicroDrive/MCL_MicroDrive.vcxproj index c2b0d4359..1544ba826 100644 --- a/DeviceAdapters/MCL_MicroDrive/MCL_MicroDrive.vcxproj +++ b/DeviceAdapters/MCL_MicroDrive/MCL_MicroDrive.vcxproj @@ -20,13 +20,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/MCL_NanoDrive/MCL_NanoDrive.vcxproj b/DeviceAdapters/MCL_NanoDrive/MCL_NanoDrive.vcxproj index 3bb8f546f..826aecffc 100644 --- a/DeviceAdapters/MCL_NanoDrive/MCL_NanoDrive.vcxproj +++ b/DeviceAdapters/MCL_NanoDrive/MCL_NanoDrive.vcxproj @@ -20,13 +20,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/MP285/MP285.vcxproj b/DeviceAdapters/MP285/MP285.vcxproj index 3bfd70041..96a34e905 100644 --- a/DeviceAdapters/MP285/MP285.vcxproj +++ b/DeviceAdapters/MP285/MP285.vcxproj @@ -21,14 +21,14 @@ DynamicLibrary MultiByte false - v142 + v143 false DynamicLibrary MultiByte false - v142 + v143 true diff --git a/DeviceAdapters/MPBLaser/MPBLaser.vcxproj b/DeviceAdapters/MPBLaser/MPBLaser.vcxproj index 8dda7965e..7a8af85ae 100644 --- a/DeviceAdapters/MPBLaser/MPBLaser.vcxproj +++ b/DeviceAdapters/MPBLaser/MPBLaser.vcxproj @@ -21,14 +21,14 @@ DynamicLibrary true Unicode - v142 + v143 DynamicLibrary false true Unicode - v142 + v143 diff --git a/DeviceAdapters/MT20/MT20.vcxproj b/DeviceAdapters/MT20/MT20.vcxproj index 191021525..0de543e6e 100644 --- a/DeviceAdapters/MT20/MT20.vcxproj +++ b/DeviceAdapters/MT20/MT20.vcxproj @@ -20,13 +20,13 @@ DynamicLibrary MultiByte true - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/MaestroServo/MaestroServo.vcxproj b/DeviceAdapters/MaestroServo/MaestroServo.vcxproj index 902cb3cfe..64bb221bb 100644 --- a/DeviceAdapters/MaestroServo/MaestroServo.vcxproj +++ b/DeviceAdapters/MaestroServo/MaestroServo.vcxproj @@ -20,13 +20,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/Marzhauser-LStep/MarzhauserLStep.vcxproj b/DeviceAdapters/Marzhauser-LStep/MarzhauserLStep.vcxproj index fa2e03ee6..b1c64d771 100644 --- a/DeviceAdapters/Marzhauser-LStep/MarzhauserLStep.vcxproj +++ b/DeviceAdapters/Marzhauser-LStep/MarzhauserLStep.vcxproj @@ -21,13 +21,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/Marzhauser/Marzhauser.vcxproj b/DeviceAdapters/Marzhauser/Marzhauser.vcxproj index fcb356a89..20e312f55 100644 --- a/DeviceAdapters/Marzhauser/Marzhauser.vcxproj +++ b/DeviceAdapters/Marzhauser/Marzhauser.vcxproj @@ -20,13 +20,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/MarzhauserLStepOld/MarzhauserLStepOld.vcxproj b/DeviceAdapters/MarzhauserLStepOld/MarzhauserLStepOld.vcxproj index 370749962..6dce28e8b 100644 --- a/DeviceAdapters/MarzhauserLStepOld/MarzhauserLStepOld.vcxproj +++ b/DeviceAdapters/MarzhauserLStepOld/MarzhauserLStepOld.vcxproj @@ -21,14 +21,14 @@ DynamicLibrary true Unicode - v142 + v143 DynamicLibrary false true Unicode - v142 + v143 diff --git a/DeviceAdapters/MatrixVision/MatrixVision.vcxproj b/DeviceAdapters/MatrixVision/MatrixVision.vcxproj index aa1dcc218..b943002dd 100644 --- a/DeviceAdapters/MatrixVision/MatrixVision.vcxproj +++ b/DeviceAdapters/MatrixVision/MatrixVision.vcxproj @@ -21,14 +21,14 @@ DynamicLibrary true Unicode - v142 + v143 DynamicLibrary false true Unicode - v142 + v143 diff --git a/DeviceAdapters/MeadowlarkLC/MeadowlarkLC.vcxproj b/DeviceAdapters/MeadowlarkLC/MeadowlarkLC.vcxproj index f8ac1f3fc..b5ccf14ff 100644 --- a/DeviceAdapters/MeadowlarkLC/MeadowlarkLC.vcxproj +++ b/DeviceAdapters/MeadowlarkLC/MeadowlarkLC.vcxproj @@ -35,13 +35,13 @@ DynamicLibrary true - v142 + v143 Unicode DynamicLibrary false - v142 + v143 true Unicode diff --git a/DeviceAdapters/MicroFPGA/MicroFPGA.vcxproj b/DeviceAdapters/MicroFPGA/MicroFPGA.vcxproj index 169a838af..597536cfe 100644 --- a/DeviceAdapters/MicroFPGA/MicroFPGA.vcxproj +++ b/DeviceAdapters/MicroFPGA/MicroFPGA.vcxproj @@ -34,13 +34,13 @@ DynamicLibrary MultiByte true - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/MicroPoint/MicroPoint.vcxproj b/DeviceAdapters/MicroPoint/MicroPoint.vcxproj index be9ab365e..ca33d0384 100644 --- a/DeviceAdapters/MicroPoint/MicroPoint.vcxproj +++ b/DeviceAdapters/MicroPoint/MicroPoint.vcxproj @@ -20,13 +20,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/Mightex/Mightex.vcxproj b/DeviceAdapters/Mightex/Mightex.vcxproj index bf3db316d..a5e06df46 100644 --- a/DeviceAdapters/Mightex/Mightex.vcxproj +++ b/DeviceAdapters/Mightex/Mightex.vcxproj @@ -20,13 +20,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/Mightex_BLS/Mightex_BLS.vcxproj b/DeviceAdapters/Mightex_BLS/Mightex_BLS.vcxproj index 2bdba5ef4..ab884c39a 100644 --- a/DeviceAdapters/Mightex_BLS/Mightex_BLS.vcxproj +++ b/DeviceAdapters/Mightex_BLS/Mightex_BLS.vcxproj @@ -20,13 +20,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/Mightex_C_Cam/Mightex_C_Cam.vcxproj b/DeviceAdapters/Mightex_C_Cam/Mightex_C_Cam.vcxproj index 4c779091b..626e76b92 100644 --- a/DeviceAdapters/Mightex_C_Cam/Mightex_C_Cam.vcxproj +++ b/DeviceAdapters/Mightex_C_Cam/Mightex_C_Cam.vcxproj @@ -21,14 +21,14 @@ DynamicLibrary true MultiByte - v142 + v143 DynamicLibrary false true MultiByte - v142 + v143 diff --git a/DeviceAdapters/Modbus/Modbus.vcxproj b/DeviceAdapters/Modbus/Modbus.vcxproj index 8d71ba351..3548e1c98 100644 --- a/DeviceAdapters/Modbus/Modbus.vcxproj +++ b/DeviceAdapters/Modbus/Modbus.vcxproj @@ -20,13 +20,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/Motic/MoticCamera.vcxproj b/DeviceAdapters/Motic/MoticCamera.vcxproj index ec6d8c87a..6195ad8ff 100644 --- a/DeviceAdapters/Motic/MoticCamera.vcxproj +++ b/DeviceAdapters/Motic/MoticCamera.vcxproj @@ -21,13 +21,13 @@ DynamicLibrary MultiByte true - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/MoticMicroscope/MoticMicroscope.vcxproj b/DeviceAdapters/MoticMicroscope/MoticMicroscope.vcxproj index 5e1b34bb9..1cfa2dbcc 100644 --- a/DeviceAdapters/MoticMicroscope/MoticMicroscope.vcxproj +++ b/DeviceAdapters/MoticMicroscope/MoticMicroscope.vcxproj @@ -20,13 +20,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/NI100X/NI100X.vcxproj b/DeviceAdapters/NI100X/NI100X.vcxproj index 1029f9b95..d649e74f7 100644 --- a/DeviceAdapters/NI100X/NI100X.vcxproj +++ b/DeviceAdapters/NI100X/NI100X.vcxproj @@ -21,13 +21,13 @@ DynamicLibrary Unicode true - v142 + v143 false DynamicLibrary Unicode - v142 + v143 true diff --git a/DeviceAdapters/NIDAQ/NIDAQ.vcxproj b/DeviceAdapters/NIDAQ/NIDAQ.vcxproj index 587636144..8dbbf87a2 100644 --- a/DeviceAdapters/NIDAQ/NIDAQ.vcxproj +++ b/DeviceAdapters/NIDAQ/NIDAQ.vcxproj @@ -22,13 +22,13 @@ DynamicLibrary Unicode true - v142 + v143 false DynamicLibrary Unicode - v142 + v143 true diff --git a/DeviceAdapters/NIMultiAnalog/NIMultiAnalog.vcxproj b/DeviceAdapters/NIMultiAnalog/NIMultiAnalog.vcxproj index 2e6d5f48c..d75fd12ba 100644 --- a/DeviceAdapters/NIMultiAnalog/NIMultiAnalog.vcxproj +++ b/DeviceAdapters/NIMultiAnalog/NIMultiAnalog.vcxproj @@ -21,13 +21,13 @@ DynamicLibrary Unicode true - v142 + v143 false DynamicLibrary Unicode - v142 + v143 true diff --git a/DeviceAdapters/NKTSuperK/NKTSuperK.vcxproj b/DeviceAdapters/NKTSuperK/NKTSuperK.vcxproj index 9f037cd74..83016b815 100644 --- a/DeviceAdapters/NKTSuperK/NKTSuperK.vcxproj +++ b/DeviceAdapters/NKTSuperK/NKTSuperK.vcxproj @@ -21,14 +21,14 @@ DynamicLibrary true MultiByte - v142 + v143 DynamicLibrary false true MultiByte - v142 + v143 diff --git a/DeviceAdapters/Neos/Neos.vcxproj b/DeviceAdapters/Neos/Neos.vcxproj index dd81d71f2..3f434d5ca 100644 --- a/DeviceAdapters/Neos/Neos.vcxproj +++ b/DeviceAdapters/Neos/Neos.vcxproj @@ -20,13 +20,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/NewportCONEX/NewportCONEX.vcxproj b/DeviceAdapters/NewportCONEX/NewportCONEX.vcxproj index ea48364a7..897e3b968 100644 --- a/DeviceAdapters/NewportCONEX/NewportCONEX.vcxproj +++ b/DeviceAdapters/NewportCONEX/NewportCONEX.vcxproj @@ -21,12 +21,12 @@ DynamicLibrary MultiByte - v142 + v143 DynamicLibrary MultiByte - v142 + v143 diff --git a/DeviceAdapters/NewportSMC/NewportSMC.vcxproj b/DeviceAdapters/NewportSMC/NewportSMC.vcxproj index 66e5e0f54..93eb74427 100644 --- a/DeviceAdapters/NewportSMC/NewportSMC.vcxproj +++ b/DeviceAdapters/NewportSMC/NewportSMC.vcxproj @@ -21,14 +21,14 @@ DynamicLibrary true Unicode - v142 + v143 DynamicLibrary false true Unicode - v142 + v143 diff --git a/DeviceAdapters/Nikon/Nikon.vcxproj b/DeviceAdapters/Nikon/Nikon.vcxproj index c2707f621..56fb737f3 100644 --- a/DeviceAdapters/Nikon/Nikon.vcxproj +++ b/DeviceAdapters/Nikon/Nikon.vcxproj @@ -20,13 +20,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/NikonTE2000/NikonTE2000.vcxproj b/DeviceAdapters/NikonTE2000/NikonTE2000.vcxproj index 2a5ab7212..b71882b3c 100644 --- a/DeviceAdapters/NikonTE2000/NikonTE2000.vcxproj +++ b/DeviceAdapters/NikonTE2000/NikonTE2000.vcxproj @@ -20,13 +20,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/NotificationTester/NotificationTester.vcxproj b/DeviceAdapters/NotificationTester/NotificationTester.vcxproj index 56a5b3dfc..60218fdd5 100644 --- a/DeviceAdapters/NotificationTester/NotificationTester.vcxproj +++ b/DeviceAdapters/NotificationTester/NotificationTester.vcxproj @@ -33,13 +33,13 @@ DynamicLibrary true - v142 + v143 Unicode DynamicLibrary false - v142 + v143 true Unicode diff --git a/DeviceAdapters/OVP_ECS2/OVP_ECS2.vcxproj b/DeviceAdapters/OVP_ECS2/OVP_ECS2.vcxproj index 5817996fa..0c6432cfb 100644 --- a/DeviceAdapters/OVP_ECS2/OVP_ECS2.vcxproj +++ b/DeviceAdapters/OVP_ECS2/OVP_ECS2.vcxproj @@ -20,13 +20,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/ObjectiveImaging/ObjectiveImaging.vcxproj b/DeviceAdapters/ObjectiveImaging/ObjectiveImaging.vcxproj index d871fbf04..f5e1a30a7 100644 --- a/DeviceAdapters/ObjectiveImaging/ObjectiveImaging.vcxproj +++ b/DeviceAdapters/ObjectiveImaging/ObjectiveImaging.vcxproj @@ -20,13 +20,13 @@ DynamicLibrary Unicode - v142 + v143 false DynamicLibrary Unicode - v142 + v143 true diff --git a/DeviceAdapters/Okolab/Okolab.vcxproj b/DeviceAdapters/Okolab/Okolab.vcxproj index 1b0361b4a..3dc6c36aa 100644 --- a/DeviceAdapters/Okolab/Okolab.vcxproj +++ b/DeviceAdapters/Okolab/Okolab.vcxproj @@ -21,13 +21,13 @@ DynamicLibrary true Unicode - v142 + v143 DynamicLibrary true Unicode - v142 + v143 diff --git a/DeviceAdapters/Omicron/Omicron.vcxproj b/DeviceAdapters/Omicron/Omicron.vcxproj index cf0b93787..b2570f5fc 100644 --- a/DeviceAdapters/Omicron/Omicron.vcxproj +++ b/DeviceAdapters/Omicron/Omicron.vcxproj @@ -20,13 +20,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/OpenCVgrabber/OpenCVgrabber.vcxproj b/DeviceAdapters/OpenCVgrabber/OpenCVgrabber.vcxproj index fe45fe03f..394c5b5a9 100644 --- a/DeviceAdapters/OpenCVgrabber/OpenCVgrabber.vcxproj +++ b/DeviceAdapters/OpenCVgrabber/OpenCVgrabber.vcxproj @@ -21,13 +21,13 @@ DynamicLibrary NotSet true - v142 + v143 false DynamicLibrary NotSet - v142 + v143 true diff --git a/DeviceAdapters/Oxxius/Oxxius.vcxproj b/DeviceAdapters/Oxxius/Oxxius.vcxproj index 42bb6e1be..b888e78e3 100644 --- a/DeviceAdapters/Oxxius/Oxxius.vcxproj +++ b/DeviceAdapters/Oxxius/Oxxius.vcxproj @@ -20,13 +20,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/OxxiusCombiner/OxxiusCombiner.vcxproj b/DeviceAdapters/OxxiusCombiner/OxxiusCombiner.vcxproj index 16a36d06e..b3111bca7 100644 --- a/DeviceAdapters/OxxiusCombiner/OxxiusCombiner.vcxproj +++ b/DeviceAdapters/OxxiusCombiner/OxxiusCombiner.vcxproj @@ -20,13 +20,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/PCO_Generic/PCO_Camera.vcxproj b/DeviceAdapters/PCO_Generic/PCO_Camera.vcxproj index 88a88e36b..81361d9f1 100644 --- a/DeviceAdapters/PCO_Generic/PCO_Camera.vcxproj +++ b/DeviceAdapters/PCO_Generic/PCO_Camera.vcxproj @@ -21,13 +21,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/PI/PI.vcxproj b/DeviceAdapters/PI/PI.vcxproj index 8b8ee970b..56964287b 100644 --- a/DeviceAdapters/PI/PI.vcxproj +++ b/DeviceAdapters/PI/PI.vcxproj @@ -20,13 +20,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/PICAM/PICAM.vcxproj b/DeviceAdapters/PICAM/PICAM.vcxproj index b6e8592a0..599ad7b71 100644 --- a/DeviceAdapters/PICAM/PICAM.vcxproj +++ b/DeviceAdapters/PICAM/PICAM.vcxproj @@ -20,13 +20,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/PIEZOCONCEPT/PIEZOCONCEPT.vcxproj b/DeviceAdapters/PIEZOCONCEPT/PIEZOCONCEPT.vcxproj index 63d3e2653..9f41d1f0b 100644 --- a/DeviceAdapters/PIEZOCONCEPT/PIEZOCONCEPT.vcxproj +++ b/DeviceAdapters/PIEZOCONCEPT/PIEZOCONCEPT.vcxproj @@ -21,14 +21,14 @@ DynamicLibrary true Unicode - v142 + v143 DynamicLibrary false true Unicode - v142 + v143 diff --git a/DeviceAdapters/PI_GCS/PI_GCS.vcxproj b/DeviceAdapters/PI_GCS/PI_GCS.vcxproj index 105bb7da1..3a1d6b893 100644 --- a/DeviceAdapters/PI_GCS/PI_GCS.vcxproj +++ b/DeviceAdapters/PI_GCS/PI_GCS.vcxproj @@ -20,13 +20,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/PI_GCS_2/PI_GCS_2.vcxproj b/DeviceAdapters/PI_GCS_2/PI_GCS_2.vcxproj index da62c13af..d627f3a42 100644 --- a/DeviceAdapters/PI_GCS_2/PI_GCS_2.vcxproj +++ b/DeviceAdapters/PI_GCS_2/PI_GCS_2.vcxproj @@ -20,13 +20,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/PI_GCS_2/PI_GCS_2.vcxproj.filters b/DeviceAdapters/PI_GCS_2/PI_GCS_2.vcxproj.filters index a70291a09..359f88259 100644 --- a/DeviceAdapters/PI_GCS_2/PI_GCS_2.vcxproj.filters +++ b/DeviceAdapters/PI_GCS_2/PI_GCS_2.vcxproj.filters @@ -64,5 +64,8 @@ Header Files + + Header Files + \ No newline at end of file diff --git a/DeviceAdapters/PVCAM/PVCAM.vcxproj b/DeviceAdapters/PVCAM/PVCAM.vcxproj index 7641d2817..87cdf848d 100644 --- a/DeviceAdapters/PVCAM/PVCAM.vcxproj +++ b/DeviceAdapters/PVCAM/PVCAM.vcxproj @@ -20,13 +20,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/ParallelPort/ParallelPort.vcxproj b/DeviceAdapters/ParallelPort/ParallelPort.vcxproj index fad743c48..1d9ee12b2 100644 --- a/DeviceAdapters/ParallelPort/ParallelPort.vcxproj +++ b/DeviceAdapters/ParallelPort/ParallelPort.vcxproj @@ -20,13 +20,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/PeCon2000/PeCon2000.vcxproj b/DeviceAdapters/PeCon2000/PeCon2000.vcxproj index e259db56b..34797dd4d 100644 --- a/DeviceAdapters/PeCon2000/PeCon2000.vcxproj +++ b/DeviceAdapters/PeCon2000/PeCon2000.vcxproj @@ -21,14 +21,14 @@ DynamicLibrary true MultiByte - v142 + v143 DynamicLibrary false true MultiByte - v142 + v143 diff --git a/DeviceAdapters/Pecon/Pecon.vcxproj b/DeviceAdapters/Pecon/Pecon.vcxproj index 5947142f6..0d5203605 100644 --- a/DeviceAdapters/Pecon/Pecon.vcxproj +++ b/DeviceAdapters/Pecon/Pecon.vcxproj @@ -20,13 +20,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/PicardStage/PicardStage.vcxproj b/DeviceAdapters/PicardStage/PicardStage.vcxproj index 61ddf8d9f..f58ed1dc0 100644 --- a/DeviceAdapters/PicardStage/PicardStage.vcxproj +++ b/DeviceAdapters/PicardStage/PicardStage.vcxproj @@ -20,12 +20,12 @@ DynamicLibrary MultiByte - v142 + v143 DynamicLibrary MultiByte - v142 + v143 diff --git a/DeviceAdapters/Piezosystem_30DV50/Piezosystem_30DV50.vcxproj b/DeviceAdapters/Piezosystem_30DV50/Piezosystem_30DV50.vcxproj index 823098b0a..ed3b6e6a8 100644 --- a/DeviceAdapters/Piezosystem_30DV50/Piezosystem_30DV50.vcxproj +++ b/DeviceAdapters/Piezosystem_30DV50/Piezosystem_30DV50.vcxproj @@ -20,13 +20,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/Piezosystem_NV120_1/Piezosystem_NV120_1.vcxproj b/DeviceAdapters/Piezosystem_NV120_1/Piezosystem_NV120_1.vcxproj index f32c4a29d..2b4ebb59a 100644 --- a/DeviceAdapters/Piezosystem_NV120_1/Piezosystem_NV120_1.vcxproj +++ b/DeviceAdapters/Piezosystem_NV120_1/Piezosystem_NV120_1.vcxproj @@ -20,13 +20,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/Piezosystem_NV40_1/Piezosystem_NV40_1.vcxproj b/DeviceAdapters/Piezosystem_NV40_1/Piezosystem_NV40_1.vcxproj index c61bea520..7bfdd0df9 100644 --- a/DeviceAdapters/Piezosystem_NV40_1/Piezosystem_NV40_1.vcxproj +++ b/DeviceAdapters/Piezosystem_NV40_1/Piezosystem_NV40_1.vcxproj @@ -20,13 +20,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/Piezosystem_NV40_3/Piezosystem_NV40_3.vcxproj b/DeviceAdapters/Piezosystem_NV40_3/Piezosystem_NV40_3.vcxproj index b6fce56d0..da15a7007 100644 --- a/DeviceAdapters/Piezosystem_NV40_3/Piezosystem_NV40_3.vcxproj +++ b/DeviceAdapters/Piezosystem_NV40_3/Piezosystem_NV40_3.vcxproj @@ -20,13 +20,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/Piezosystem_dDrive/Piezosystem_dDrive.vcxproj b/DeviceAdapters/Piezosystem_dDrive/Piezosystem_dDrive.vcxproj index 2b9c5d776..8fde0819d 100644 --- a/DeviceAdapters/Piezosystem_dDrive/Piezosystem_dDrive.vcxproj +++ b/DeviceAdapters/Piezosystem_dDrive/Piezosystem_dDrive.vcxproj @@ -20,13 +20,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/Piper/Piper.vcxproj b/DeviceAdapters/Piper/Piper.vcxproj index 000c16374..db1bc34b9 100644 --- a/DeviceAdapters/Piper/Piper.vcxproj +++ b/DeviceAdapters/Piper/Piper.vcxproj @@ -21,13 +21,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/Pixelink/Pixelink.vcxproj b/DeviceAdapters/Pixelink/Pixelink.vcxproj index 163c7d3e1..7fd9c90fc 100644 --- a/DeviceAdapters/Pixelink/Pixelink.vcxproj +++ b/DeviceAdapters/Pixelink/Pixelink.vcxproj @@ -20,13 +20,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/PointGrey/PointGrey.vcxproj b/DeviceAdapters/PointGrey/PointGrey.vcxproj index fecc2f1f0..5faee892a 100644 --- a/DeviceAdapters/PointGrey/PointGrey.vcxproj +++ b/DeviceAdapters/PointGrey/PointGrey.vcxproj @@ -21,13 +21,13 @@ DynamicLibrary MultiByte true - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/PrecisExcite/PrecisExcite.vcxproj b/DeviceAdapters/PrecisExcite/PrecisExcite.vcxproj index 643e6dc3f..0abba583f 100644 --- a/DeviceAdapters/PrecisExcite/PrecisExcite.vcxproj +++ b/DeviceAdapters/PrecisExcite/PrecisExcite.vcxproj @@ -20,13 +20,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/Prior/Prior.vcxproj b/DeviceAdapters/Prior/Prior.vcxproj index e351b357d..f2679eb97 100644 --- a/DeviceAdapters/Prior/Prior.vcxproj +++ b/DeviceAdapters/Prior/Prior.vcxproj @@ -20,13 +20,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/PriorLegacy/PriorLegacy.vcxproj b/DeviceAdapters/PriorLegacy/PriorLegacy.vcxproj index eaade2c19..ad5c73372 100644 --- a/DeviceAdapters/PriorLegacy/PriorLegacy.vcxproj +++ b/DeviceAdapters/PriorLegacy/PriorLegacy.vcxproj @@ -20,13 +20,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/PrizmatixDevice/PrizmatixDevice.vcxproj b/DeviceAdapters/PrizmatixDevice/PrizmatixDevice.vcxproj index 11c77052f..7ecd83c11 100644 --- a/DeviceAdapters/PrizmatixDevice/PrizmatixDevice.vcxproj +++ b/DeviceAdapters/PrizmatixDevice/PrizmatixDevice.vcxproj @@ -21,14 +21,14 @@ DynamicLibrary true Unicode - v142 + v143 DynamicLibrary false true Unicode - v142 + v143 diff --git a/DeviceAdapters/QCam/QCam.vcxproj b/DeviceAdapters/QCam/QCam.vcxproj index 3953ddae1..9ee86baed 100644 --- a/DeviceAdapters/QCam/QCam.vcxproj +++ b/DeviceAdapters/QCam/QCam.vcxproj @@ -20,13 +20,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/QSI/QSI.vcxproj b/DeviceAdapters/QSI/QSI.vcxproj index a70bba956..0e0892992 100644 --- a/DeviceAdapters/QSI/QSI.vcxproj +++ b/DeviceAdapters/QSI/QSI.vcxproj @@ -34,13 +34,13 @@ DynamicLibrary true - v142 + v143 Unicode DynamicLibrary false - v142 + v143 true Unicode @@ -109,4 +109,4 @@ - + \ No newline at end of file diff --git a/DeviceAdapters/Rapp/Rapp.vcxproj b/DeviceAdapters/Rapp/Rapp.vcxproj index 553eacc49..59a69de92 100644 --- a/DeviceAdapters/Rapp/Rapp.vcxproj +++ b/DeviceAdapters/Rapp/Rapp.vcxproj @@ -20,13 +20,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true @@ -106,4 +106,4 @@ - + \ No newline at end of file diff --git a/DeviceAdapters/RaptorEPIX/HoribaEPIX.vcxproj b/DeviceAdapters/RaptorEPIX/HoribaEPIX.vcxproj index 4ad975482..ab6423ae9 100644 --- a/DeviceAdapters/RaptorEPIX/HoribaEPIX.vcxproj +++ b/DeviceAdapters/RaptorEPIX/HoribaEPIX.vcxproj @@ -20,13 +20,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/RaptorEPIX/RaptorEPIX.vcxproj b/DeviceAdapters/RaptorEPIX/RaptorEPIX.vcxproj index be45906b0..0dfa4b6ad 100644 --- a/DeviceAdapters/RaptorEPIX/RaptorEPIX.vcxproj +++ b/DeviceAdapters/RaptorEPIX/RaptorEPIX.vcxproj @@ -20,13 +20,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/Sapphire/Sapphire.vcxproj b/DeviceAdapters/Sapphire/Sapphire.vcxproj index 74abbaf9f..7a3700b2a 100644 --- a/DeviceAdapters/Sapphire/Sapphire.vcxproj +++ b/DeviceAdapters/Sapphire/Sapphire.vcxproj @@ -20,13 +20,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/Scientifica/Scientifica.vcxproj b/DeviceAdapters/Scientifica/Scientifica.vcxproj index 92a90ecdd..36195e32a 100644 --- a/DeviceAdapters/Scientifica/Scientifica.vcxproj +++ b/DeviceAdapters/Scientifica/Scientifica.vcxproj @@ -20,13 +20,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/ScopeLED/ScopeLED.vcxproj b/DeviceAdapters/ScopeLED/ScopeLED.vcxproj index 751a35590..896c3e645 100644 --- a/DeviceAdapters/ScopeLED/ScopeLED.vcxproj +++ b/DeviceAdapters/ScopeLED/ScopeLED.vcxproj @@ -19,12 +19,12 @@ DynamicLibrary - v142 + v143 false DynamicLibrary - v142 + v143 true diff --git a/DeviceAdapters/SequenceTester/SequenceTester.vcxproj b/DeviceAdapters/SequenceTester/SequenceTester.vcxproj index 5b63e7852..b11b54315 100644 --- a/DeviceAdapters/SequenceTester/SequenceTester.vcxproj +++ b/DeviceAdapters/SequenceTester/SequenceTester.vcxproj @@ -43,13 +43,13 @@ DynamicLibrary true - v142 + v143 Unicode DynamicLibrary false - v142 + v143 true Unicode diff --git a/DeviceAdapters/SerialManager/SerialManager.vcxproj b/DeviceAdapters/SerialManager/SerialManager.vcxproj index 8a40c4b94..15f17ad82 100644 --- a/DeviceAdapters/SerialManager/SerialManager.vcxproj +++ b/DeviceAdapters/SerialManager/SerialManager.vcxproj @@ -20,13 +20,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/SigmaKoki/SigmaKoki.vcxproj b/DeviceAdapters/SigmaKoki/SigmaKoki.vcxproj index 7e042b67b..b278ecd50 100644 --- a/DeviceAdapters/SigmaKoki/SigmaKoki.vcxproj +++ b/DeviceAdapters/SigmaKoki/SigmaKoki.vcxproj @@ -22,13 +22,13 @@ DynamicLibrary true - v142 + v143 Unicode DynamicLibrary false - v142 + v143 true Unicode diff --git a/DeviceAdapters/Skyra/Skyra.vcxproj b/DeviceAdapters/Skyra/Skyra.vcxproj index 231b6a4a3..2fc8bdbde 100644 --- a/DeviceAdapters/Skyra/Skyra.vcxproj +++ b/DeviceAdapters/Skyra/Skyra.vcxproj @@ -20,13 +20,13 @@ DynamicLibrary NotSet - v142 + v143 false DynamicLibrary NotSet - v142 + v143 true diff --git a/DeviceAdapters/SmarActHCU-3D/SmarActHCU-3D.vcxproj b/DeviceAdapters/SmarActHCU-3D/SmarActHCU-3D.vcxproj index 6082aa82c..5523e54f1 100644 --- a/DeviceAdapters/SmarActHCU-3D/SmarActHCU-3D.vcxproj +++ b/DeviceAdapters/SmarActHCU-3D/SmarActHCU-3D.vcxproj @@ -21,13 +21,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/SouthPort/SouthPort.vcxproj b/DeviceAdapters/SouthPort/SouthPort.vcxproj index 4a165d9b4..06cf7cbcb 100644 --- a/DeviceAdapters/SouthPort/SouthPort.vcxproj +++ b/DeviceAdapters/SouthPort/SouthPort.vcxproj @@ -19,13 +19,13 @@ DynamicLibrary true - v142 + v143 MultiByte DynamicLibrary false - v142 + v143 true MultiByte diff --git a/DeviceAdapters/SpectralLMM5/SpectralLMM5.vcxproj b/DeviceAdapters/SpectralLMM5/SpectralLMM5.vcxproj index b74dec662..4888d3227 100644 --- a/DeviceAdapters/SpectralLMM5/SpectralLMM5.vcxproj +++ b/DeviceAdapters/SpectralLMM5/SpectralLMM5.vcxproj @@ -21,13 +21,13 @@ DynamicLibrary NotSet true - v142 + v143 false DynamicLibrary NotSet - v142 + v143 true diff --git a/DeviceAdapters/Spinnaker/SpinnakerCamera.vcxproj b/DeviceAdapters/Spinnaker/SpinnakerCamera.vcxproj index 53197c8e3..6adc11e90 100644 --- a/DeviceAdapters/Spinnaker/SpinnakerCamera.vcxproj +++ b/DeviceAdapters/Spinnaker/SpinnakerCamera.vcxproj @@ -20,13 +20,13 @@ DynamicLibrary true - v142 + v143 Unicode DynamicLibrary false - v142 + v143 true Unicode diff --git a/DeviceAdapters/Standa/Standa.vcxproj b/DeviceAdapters/Standa/Standa.vcxproj index bdf0e090d..8ac1442d0 100644 --- a/DeviceAdapters/Standa/Standa.vcxproj +++ b/DeviceAdapters/Standa/Standa.vcxproj @@ -22,14 +22,14 @@ Unicode false true - v142 + v143 false DynamicLibrary Unicode false - v142 + v143 true diff --git a/DeviceAdapters/Standa8SMC4/Standa8SMC4.vcxproj b/DeviceAdapters/Standa8SMC4/Standa8SMC4.vcxproj index 5b8c556cf..b6eb68981 100644 --- a/DeviceAdapters/Standa8SMC4/Standa8SMC4.vcxproj +++ b/DeviceAdapters/Standa8SMC4/Standa8SMC4.vcxproj @@ -21,14 +21,14 @@ DynamicLibrary true Unicode - v142 + v143 DynamicLibrary false true Unicode - v142 + v143 diff --git a/DeviceAdapters/StandaStage/StandaStage.vcxproj b/DeviceAdapters/StandaStage/StandaStage.vcxproj index ebb29f7ad..42a613e3f 100644 --- a/DeviceAdapters/StandaStage/StandaStage.vcxproj +++ b/DeviceAdapters/StandaStage/StandaStage.vcxproj @@ -21,14 +21,14 @@ DynamicLibrary true Unicode - v142 + v143 DynamicLibrary false true Unicode - v142 + v143 diff --git a/DeviceAdapters/StarlightXpress/StarlightXpress.vcxproj b/DeviceAdapters/StarlightXpress/StarlightXpress.vcxproj index f10db1205..683bedc52 100644 --- a/DeviceAdapters/StarlightXpress/StarlightXpress.vcxproj +++ b/DeviceAdapters/StarlightXpress/StarlightXpress.vcxproj @@ -20,13 +20,13 @@ DynamicLibrary true - v142 + v143 Unicode DynamicLibrary false - v142 + v143 true Unicode diff --git a/DeviceAdapters/SutterLambda/SutterLambda.vcxproj b/DeviceAdapters/SutterLambda/SutterLambda.vcxproj index a9331534a..e7bf06df3 100644 --- a/DeviceAdapters/SutterLambda/SutterLambda.vcxproj +++ b/DeviceAdapters/SutterLambda/SutterLambda.vcxproj @@ -20,13 +20,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true @@ -104,4 +104,4 @@ - + \ No newline at end of file diff --git a/DeviceAdapters/SutterLambda2/SutterLambda2.vcxproj b/DeviceAdapters/SutterLambda2/SutterLambda2.vcxproj index 4a2fe06bd..3bb1b2491 100644 --- a/DeviceAdapters/SutterLambda2/SutterLambda2.vcxproj +++ b/DeviceAdapters/SutterLambda2/SutterLambda2.vcxproj @@ -21,13 +21,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/SutterLambdaParallelArduino/SutterLambdaParallelArduino.vcxproj b/DeviceAdapters/SutterLambdaParallelArduino/SutterLambdaParallelArduino.vcxproj index 3e3a7b4de..efd6ffe49 100644 --- a/DeviceAdapters/SutterLambdaParallelArduino/SutterLambdaParallelArduino.vcxproj +++ b/DeviceAdapters/SutterLambdaParallelArduino/SutterLambdaParallelArduino.vcxproj @@ -21,14 +21,14 @@ DynamicLibrary true Unicode - v142 + v143 DynamicLibrary false true Unicode - v142 + v143 diff --git a/DeviceAdapters/SutterStage/SutterStage.vcxproj b/DeviceAdapters/SutterStage/SutterStage.vcxproj index 8e1b40bbc..e5125c569 100644 --- a/DeviceAdapters/SutterStage/SutterStage.vcxproj +++ b/DeviceAdapters/SutterStage/SutterStage.vcxproj @@ -20,13 +20,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/TCPIPPort/TCPIPPort.vcxproj b/DeviceAdapters/TCPIPPort/TCPIPPort.vcxproj index 7125c6c0c..c15698eae 100644 --- a/DeviceAdapters/TCPIPPort/TCPIPPort.vcxproj +++ b/DeviceAdapters/TCPIPPort/TCPIPPort.vcxproj @@ -22,14 +22,14 @@ DynamicLibrary true Unicode - v142 + v143 DynamicLibrary false true Unicode - v142 + v143 diff --git a/DeviceAdapters/TISCam/TIScam.vcxproj b/DeviceAdapters/TISCam/TIScam.vcxproj index 2f4fb6705..b67ae8b19 100644 --- a/DeviceAdapters/TISCam/TIScam.vcxproj +++ b/DeviceAdapters/TISCam/TIScam.vcxproj @@ -21,13 +21,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/TSI/TSI.vcxproj b/DeviceAdapters/TSI/TSI.vcxproj index 21c4d8f67..fdaec15a2 100644 --- a/DeviceAdapters/TSI/TSI.vcxproj +++ b/DeviceAdapters/TSI/TSI.vcxproj @@ -21,13 +21,13 @@ DynamicLibrary MultiByte true - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/TUCam/MMTUCam.vcxproj b/DeviceAdapters/TUCam/MMTUCam.vcxproj index 1c8845a52..17eb0adf7 100644 --- a/DeviceAdapters/TUCam/MMTUCam.vcxproj +++ b/DeviceAdapters/TUCam/MMTUCam.vcxproj @@ -21,12 +21,12 @@ DynamicLibrary MultiByte - v142 + v143 DynamicLibrary MultiByte - v142 + v143 diff --git a/DeviceAdapters/TeesnySLM/TeensySLM.vcxproj b/DeviceAdapters/TeesnySLM/TeensySLM.vcxproj index a928f21b5..e6b909cc4 100644 --- a/DeviceAdapters/TeesnySLM/TeensySLM.vcxproj +++ b/DeviceAdapters/TeesnySLM/TeensySLM.vcxproj @@ -21,13 +21,13 @@ DynamicLibrary MultiByte true - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/Thorlabs/Thorlabs.vcxproj b/DeviceAdapters/Thorlabs/Thorlabs.vcxproj index fa58362d9..7e2cfbef6 100644 --- a/DeviceAdapters/Thorlabs/Thorlabs.vcxproj +++ b/DeviceAdapters/Thorlabs/Thorlabs.vcxproj @@ -21,13 +21,13 @@ DynamicLibrary Unicode true - v142 + v143 false DynamicLibrary Unicode - v142 + v143 true diff --git a/DeviceAdapters/ThorlabsAPTStage/ThorlabsAPTStage.vcxproj b/DeviceAdapters/ThorlabsAPTStage/ThorlabsAPTStage.vcxproj index 9fba9c6b8..44309b9a1 100644 --- a/DeviceAdapters/ThorlabsAPTStage/ThorlabsAPTStage.vcxproj +++ b/DeviceAdapters/ThorlabsAPTStage/ThorlabsAPTStage.vcxproj @@ -20,13 +20,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/ThorlabsCHROLIS/ThorlabsCHROLIS.vcxproj b/DeviceAdapters/ThorlabsCHROLIS/ThorlabsCHROLIS.vcxproj index 4b12160c8..9fbcbf4f3 100644 --- a/DeviceAdapters/ThorlabsCHROLIS/ThorlabsCHROLIS.vcxproj +++ b/DeviceAdapters/ThorlabsCHROLIS/ThorlabsCHROLIS.vcxproj @@ -33,13 +33,13 @@ DynamicLibrary true - v142 + v143 Unicode DynamicLibrary false - v142 + v143 true Unicode diff --git a/DeviceAdapters/ThorlabsDCxxxx/ThorlabsDCxxxx.vcxproj b/DeviceAdapters/ThorlabsDCxxxx/ThorlabsDCxxxx.vcxproj index d9b46f8c2..7d6363dab 100644 --- a/DeviceAdapters/ThorlabsDCxxxx/ThorlabsDCxxxx.vcxproj +++ b/DeviceAdapters/ThorlabsDCxxxx/ThorlabsDCxxxx.vcxproj @@ -20,13 +20,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/ThorlabsElliptecSlider/ThorlabsElliptecSlider.vcxproj b/DeviceAdapters/ThorlabsElliptecSlider/ThorlabsElliptecSlider.vcxproj index 18a3d60df..132b1b02b 100644 --- a/DeviceAdapters/ThorlabsElliptecSlider/ThorlabsElliptecSlider.vcxproj +++ b/DeviceAdapters/ThorlabsElliptecSlider/ThorlabsElliptecSlider.vcxproj @@ -21,13 +21,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/ThorlabsFilterWheel/ThorlabsFilterWheel.vcxproj b/DeviceAdapters/ThorlabsFilterWheel/ThorlabsFilterWheel.vcxproj index 457789049..9c875eb52 100644 --- a/DeviceAdapters/ThorlabsFilterWheel/ThorlabsFilterWheel.vcxproj +++ b/DeviceAdapters/ThorlabsFilterWheel/ThorlabsFilterWheel.vcxproj @@ -20,13 +20,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/ThorlabsPM100x/ThorlabsPM100x.vcxproj b/DeviceAdapters/ThorlabsPM100x/ThorlabsPM100x.vcxproj index c4478ee06..88edcff14 100644 --- a/DeviceAdapters/ThorlabsPM100x/ThorlabsPM100x.vcxproj +++ b/DeviceAdapters/ThorlabsPM100x/ThorlabsPM100x.vcxproj @@ -20,13 +20,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/ThorlabsSC10/ThorlabsSC10.vcxproj b/DeviceAdapters/ThorlabsSC10/ThorlabsSC10.vcxproj index a8cf4c0bb..6e5e86f42 100644 --- a/DeviceAdapters/ThorlabsSC10/ThorlabsSC10.vcxproj +++ b/DeviceAdapters/ThorlabsSC10/ThorlabsSC10.vcxproj @@ -20,13 +20,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/ThorlabsUSBCamera/ThorlabsUSBCamera.vcxproj b/DeviceAdapters/ThorlabsUSBCamera/ThorlabsUSBCamera.vcxproj index 8354a8d6d..310fb7313 100644 --- a/DeviceAdapters/ThorlabsUSBCamera/ThorlabsUSBCamera.vcxproj +++ b/DeviceAdapters/ThorlabsUSBCamera/ThorlabsUSBCamera.vcxproj @@ -20,13 +20,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/Thorlabs_ELL14/Thorlabs_ELL14.vcxproj b/DeviceAdapters/Thorlabs_ELL14/Thorlabs_ELL14.vcxproj index e12776bce..d403589c2 100644 --- a/DeviceAdapters/Thorlabs_ELL14/Thorlabs_ELL14.vcxproj +++ b/DeviceAdapters/Thorlabs_ELL14/Thorlabs_ELL14.vcxproj @@ -32,13 +32,13 @@ DynamicLibrary true - v142 + v143 Unicode DynamicLibrary false - v142 + v143 true Unicode diff --git a/DeviceAdapters/Tofra/Tofra.vcxproj b/DeviceAdapters/Tofra/Tofra.vcxproj index d609e9d55..80157771b 100644 --- a/DeviceAdapters/Tofra/Tofra.vcxproj +++ b/DeviceAdapters/Tofra/Tofra.vcxproj @@ -20,13 +20,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/Toptica_iBeamSmartCW/Toptica_iBeamSmartCW.vcxproj b/DeviceAdapters/Toptica_iBeamSmartCW/Toptica_iBeamSmartCW.vcxproj index 5306fe1b6..1c4a9b706 100644 --- a/DeviceAdapters/Toptica_iBeamSmartCW/Toptica_iBeamSmartCW.vcxproj +++ b/DeviceAdapters/Toptica_iBeamSmartCW/Toptica_iBeamSmartCW.vcxproj @@ -21,13 +21,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/TriggerScope/TriggerScope.vcxproj b/DeviceAdapters/TriggerScope/TriggerScope.vcxproj index 4f3fb7777..58c62ea6a 100644 --- a/DeviceAdapters/TriggerScope/TriggerScope.vcxproj +++ b/DeviceAdapters/TriggerScope/TriggerScope.vcxproj @@ -21,14 +21,14 @@ DynamicLibrary true MultiByte - v142 + v143 DynamicLibrary false true MultiByte - v142 + v143 diff --git a/DeviceAdapters/TriggerScopeMM/TriggerScopeMM.vcxproj b/DeviceAdapters/TriggerScopeMM/TriggerScopeMM.vcxproj index 32d5e0ed5..6e76aeb67 100644 --- a/DeviceAdapters/TriggerScopeMM/TriggerScopeMM.vcxproj +++ b/DeviceAdapters/TriggerScopeMM/TriggerScopeMM.vcxproj @@ -22,14 +22,14 @@ DynamicLibrary true MultiByte - v142 + v143 DynamicLibrary false true MultiByte - v142 + v143 diff --git a/DeviceAdapters/TwainCamera/TwainCamera.vcxproj b/DeviceAdapters/TwainCamera/TwainCamera.vcxproj index 7119c5f55..9108864a1 100644 --- a/DeviceAdapters/TwainCamera/TwainCamera.vcxproj +++ b/DeviceAdapters/TwainCamera/TwainCamera.vcxproj @@ -21,13 +21,13 @@ DynamicLibrary NotSet true - v142 + v143 false DynamicLibrary NotSet - v142 + v143 true diff --git a/DeviceAdapters/TwoPhoton/TwoPhoton.vcxproj b/DeviceAdapters/TwoPhoton/TwoPhoton.vcxproj index 01a503b12..68c0838da 100644 --- a/DeviceAdapters/TwoPhoton/TwoPhoton.vcxproj +++ b/DeviceAdapters/TwoPhoton/TwoPhoton.vcxproj @@ -21,13 +21,13 @@ DynamicLibrary Unicode true - v142 + v143 false DynamicLibrary Unicode - v142 + v143 true diff --git a/DeviceAdapters/USBManager/USBManager.vcxproj b/DeviceAdapters/USBManager/USBManager.vcxproj index 678ce0061..cb0b69d7a 100644 --- a/DeviceAdapters/USBManager/USBManager.vcxproj +++ b/DeviceAdapters/USBManager/USBManager.vcxproj @@ -20,13 +20,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/USB_Viper_QPL/USB_Viper_QPL.vcxproj b/DeviceAdapters/USB_Viper_QPL/USB_Viper_QPL.vcxproj index f406a7bc3..a6f059b71 100644 --- a/DeviceAdapters/USB_Viper_QPL/USB_Viper_QPL.vcxproj +++ b/DeviceAdapters/USB_Viper_QPL/USB_Viper_QPL.vcxproj @@ -21,13 +21,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/UniversalMMHubSerial/UniversalMMHubSerial.vcxproj b/DeviceAdapters/UniversalMMHubSerial/UniversalMMHubSerial.vcxproj index 03b05e887..3ca93b194 100644 --- a/DeviceAdapters/UniversalMMHubSerial/UniversalMMHubSerial.vcxproj +++ b/DeviceAdapters/UniversalMMHubSerial/UniversalMMHubSerial.vcxproj @@ -20,13 +20,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/UniversalMMHubUsb/UniversalMMHubUsb.vcxproj b/DeviceAdapters/UniversalMMHubUsb/UniversalMMHubUsb.vcxproj index 635ca62d8..fa935c51f 100644 --- a/DeviceAdapters/UniversalMMHubUsb/UniversalMMHubUsb.vcxproj +++ b/DeviceAdapters/UniversalMMHubUsb/UniversalMMHubUsb.vcxproj @@ -20,13 +20,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/UserDefinedSerial/UserDefinedSerial.vcxproj b/DeviceAdapters/UserDefinedSerial/UserDefinedSerial.vcxproj index d949056c7..e92315787 100644 --- a/DeviceAdapters/UserDefinedSerial/UserDefinedSerial.vcxproj +++ b/DeviceAdapters/UserDefinedSerial/UserDefinedSerial.vcxproj @@ -21,14 +21,14 @@ DynamicLibrary true Unicode - v142 + v143 DynamicLibrary false true Unicode - v142 + v143 diff --git a/DeviceAdapters/Utilities/Utilities.vcxproj b/DeviceAdapters/Utilities/Utilities.vcxproj index 540094967..3011ea924 100644 --- a/DeviceAdapters/Utilities/Utilities.vcxproj +++ b/DeviceAdapters/Utilities/Utilities.vcxproj @@ -20,13 +20,13 @@ DynamicLibrary MultiByte true - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/Utilities/Utilities.vcxproj.filters b/DeviceAdapters/Utilities/Utilities.vcxproj.filters index 6fb30c3d1..3d0647137 100644 --- a/DeviceAdapters/Utilities/Utilities.vcxproj.filters +++ b/DeviceAdapters/Utilities/Utilities.vcxproj.filters @@ -18,6 +18,51 @@ Source Files + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + diff --git a/DeviceAdapters/VariLC/VariLC.vcxproj b/DeviceAdapters/VariLC/VariLC.vcxproj index f61885955..2e1953b89 100644 --- a/DeviceAdapters/VariLC/VariLC.vcxproj +++ b/DeviceAdapters/VariLC/VariLC.vcxproj @@ -20,13 +20,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/VarispecLCTF/VarispecLCTF.vcxproj b/DeviceAdapters/VarispecLCTF/VarispecLCTF.vcxproj index ed0084cc2..441a95622 100644 --- a/DeviceAdapters/VarispecLCTF/VarispecLCTF.vcxproj +++ b/DeviceAdapters/VarispecLCTF/VarispecLCTF.vcxproj @@ -21,13 +21,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/Vincent/Vincent.vcxproj b/DeviceAdapters/Vincent/Vincent.vcxproj index f80b9e2b2..4b5604669 100644 --- a/DeviceAdapters/Vincent/Vincent.vcxproj +++ b/DeviceAdapters/Vincent/Vincent.vcxproj @@ -20,13 +20,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/VisiTech_iSIM/VisiTech_iSIM.vcxproj b/DeviceAdapters/VisiTech_iSIM/VisiTech_iSIM.vcxproj index 6a6782ad3..c59254b68 100644 --- a/DeviceAdapters/VisiTech_iSIM/VisiTech_iSIM.vcxproj +++ b/DeviceAdapters/VisiTech_iSIM/VisiTech_iSIM.vcxproj @@ -21,14 +21,14 @@ DynamicLibrary true Unicode - v142 + v143 DynamicLibrary false true Unicode - v142 + v143 diff --git a/DeviceAdapters/Vortran/Stradus.vcxproj b/DeviceAdapters/Vortran/Stradus.vcxproj index 2cc9ca196..12ae709d8 100644 --- a/DeviceAdapters/Vortran/Stradus.vcxproj +++ b/DeviceAdapters/Vortran/Stradus.vcxproj @@ -20,13 +20,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/Vortran/VersaLase.vcxproj b/DeviceAdapters/Vortran/VersaLase.vcxproj index 70bc6daa8..e52c7e9f0 100644 --- a/DeviceAdapters/Vortran/VersaLase.vcxproj +++ b/DeviceAdapters/Vortran/VersaLase.vcxproj @@ -20,13 +20,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/WOSM/WOSM.vcxproj b/DeviceAdapters/WOSM/WOSM.vcxproj index 937832a2f..cb85a8312 100644 --- a/DeviceAdapters/WOSM/WOSM.vcxproj +++ b/DeviceAdapters/WOSM/WOSM.vcxproj @@ -32,13 +32,13 @@ DynamicLibrary true - v142 + v143 Unicode DynamicLibrary false - v142 + v143 true Unicode diff --git a/DeviceAdapters/WieneckeSinske/WieneckeSinske.vcxproj b/DeviceAdapters/WieneckeSinske/WieneckeSinske.vcxproj index 66e0adc6f..b5375fc66 100644 --- a/DeviceAdapters/WieneckeSinske/WieneckeSinske.vcxproj +++ b/DeviceAdapters/WieneckeSinske/WieneckeSinske.vcxproj @@ -21,13 +21,13 @@ DynamicLibrary MultiByte true - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/XCite120PC_Exacte/XCite120PC_Exacte.vcxproj b/DeviceAdapters/XCite120PC_Exacte/XCite120PC_Exacte.vcxproj index 8b5e72ace..177b61fb7 100644 --- a/DeviceAdapters/XCite120PC_Exacte/XCite120PC_Exacte.vcxproj +++ b/DeviceAdapters/XCite120PC_Exacte/XCite120PC_Exacte.vcxproj @@ -20,13 +20,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/XCiteLed/XCiteLed.vcxproj b/DeviceAdapters/XCiteLed/XCiteLed.vcxproj index 6a1802dab..5f4a6a427 100644 --- a/DeviceAdapters/XCiteLed/XCiteLed.vcxproj +++ b/DeviceAdapters/XCiteLed/XCiteLed.vcxproj @@ -21,13 +21,13 @@ DynamicLibrary MultiByte true - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/XCiteXT600/XCiteXT600.vcxproj b/DeviceAdapters/XCiteXT600/XCiteXT600.vcxproj index eb0888020..6406d9962 100644 --- a/DeviceAdapters/XCiteXT600/XCiteXT600.vcxproj +++ b/DeviceAdapters/XCiteXT600/XCiteXT600.vcxproj @@ -21,13 +21,13 @@ DynamicLibrary MultiByte true - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/XLight/XLight.vcxproj b/DeviceAdapters/XLight/XLight.vcxproj index b3927c52b..af4ce1095 100644 --- a/DeviceAdapters/XLight/XLight.vcxproj +++ b/DeviceAdapters/XLight/XLight.vcxproj @@ -21,14 +21,14 @@ DynamicLibrary true Unicode - v142 + v143 DynamicLibrary false true Unicode - v142 + v143 diff --git a/DeviceAdapters/XLightV3/XLightV3.vcxproj b/DeviceAdapters/XLightV3/XLightV3.vcxproj index a1f7106cc..de7d060c4 100644 --- a/DeviceAdapters/XLightV3/XLightV3.vcxproj +++ b/DeviceAdapters/XLightV3/XLightV3.vcxproj @@ -33,13 +33,13 @@ DynamicLibrary true - v142 + v143 Unicode DynamicLibrary false - v142 + v143 true Unicode diff --git a/DeviceAdapters/Xcite/Xcite.vcxproj b/DeviceAdapters/Xcite/Xcite.vcxproj index cf2031876..519ac4ac0 100644 --- a/DeviceAdapters/Xcite/Xcite.vcxproj +++ b/DeviceAdapters/Xcite/Xcite.vcxproj @@ -20,13 +20,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/Ximea/XIMEACamera.vcxproj b/DeviceAdapters/Ximea/XIMEACamera.vcxproj index 36ce12437..8bc4fd6b4 100644 --- a/DeviceAdapters/Ximea/XIMEACamera.vcxproj +++ b/DeviceAdapters/Ximea/XIMEACamera.vcxproj @@ -21,13 +21,13 @@ DynamicLibrary MultiByte true - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/YodnE600/YodnE600.vcxproj b/DeviceAdapters/YodnE600/YodnE600.vcxproj index 53cea4bad..a248cb347 100644 --- a/DeviceAdapters/YodnE600/YodnE600.vcxproj +++ b/DeviceAdapters/YodnE600/YodnE600.vcxproj @@ -19,13 +19,13 @@ DynamicLibrary true - v142 + v143 MultiByte DynamicLibrary false - v142 + v143 true MultiByte diff --git a/DeviceAdapters/Yokogawa/CSUX/CSUX.vcxproj b/DeviceAdapters/Yokogawa/CSUX/CSUX.vcxproj index fc6db5e7d..6482945a9 100644 --- a/DeviceAdapters/Yokogawa/CSUX/CSUX.vcxproj +++ b/DeviceAdapters/Yokogawa/CSUX/CSUX.vcxproj @@ -19,13 +19,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/Yokogawa/Yokogawa.vcxproj b/DeviceAdapters/Yokogawa/Yokogawa.vcxproj index 5e1a54ccf..c10137473 100644 --- a/DeviceAdapters/Yokogawa/Yokogawa.vcxproj +++ b/DeviceAdapters/Yokogawa/Yokogawa.vcxproj @@ -20,13 +20,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/ZWO/ZWO.vcxproj b/DeviceAdapters/ZWO/ZWO.vcxproj index 3d065a5b2..996cd7375 100644 --- a/DeviceAdapters/ZWO/ZWO.vcxproj +++ b/DeviceAdapters/ZWO/ZWO.vcxproj @@ -21,13 +21,13 @@ DynamicLibrary true - v142 + v143 Unicode DynamicLibrary false - v142 + v143 true Unicode diff --git a/DeviceAdapters/Zaber/Zaber.vcxproj b/DeviceAdapters/Zaber/Zaber.vcxproj index b485aec5c..8c9fa0815 100644 --- a/DeviceAdapters/Zaber/Zaber.vcxproj +++ b/DeviceAdapters/Zaber/Zaber.vcxproj @@ -20,7 +20,7 @@ DynamicLibrary true Unicode - v142 + v143 false @@ -28,7 +28,7 @@ false false Unicode - v142 + v143 diff --git a/DeviceAdapters/ZeissAxioZoom/ZeissAxioZoom.vcxproj b/DeviceAdapters/ZeissAxioZoom/ZeissAxioZoom.vcxproj index 8ab4df04f..0315fad27 100644 --- a/DeviceAdapters/ZeissAxioZoom/ZeissAxioZoom.vcxproj +++ b/DeviceAdapters/ZeissAxioZoom/ZeissAxioZoom.vcxproj @@ -22,13 +22,13 @@ DynamicLibrary MultiByte true - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/ZeissCAN/ZeissCAN.vcxproj b/DeviceAdapters/ZeissCAN/ZeissCAN.vcxproj index 555fd62a4..7eb236fa0 100644 --- a/DeviceAdapters/ZeissCAN/ZeissCAN.vcxproj +++ b/DeviceAdapters/ZeissCAN/ZeissCAN.vcxproj @@ -21,13 +21,13 @@ DynamicLibrary Unicode true - v142 + v143 false DynamicLibrary Unicode - v142 + v143 true diff --git a/DeviceAdapters/ZeissCAN29/ZeissCAN29.vcxproj b/DeviceAdapters/ZeissCAN29/ZeissCAN29.vcxproj index ffc8f437e..dcb0c75b4 100644 --- a/DeviceAdapters/ZeissCAN29/ZeissCAN29.vcxproj +++ b/DeviceAdapters/ZeissCAN29/ZeissCAN29.vcxproj @@ -21,13 +21,13 @@ DynamicLibrary MultiByte true - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/dc1394/dc1394.vcxproj b/DeviceAdapters/dc1394/dc1394.vcxproj index 6d3b61fc4..83d4403a1 100644 --- a/DeviceAdapters/dc1394/dc1394.vcxproj +++ b/DeviceAdapters/dc1394/dc1394.vcxproj @@ -20,13 +20,13 @@ DynamicLibrary MultiByte - v142 + v143 false DynamicLibrary MultiByte - v142 + v143 true diff --git a/DeviceAdapters/go2scope/AcqZarrStorage.cpp b/DeviceAdapters/go2scope/AcqZarrStorage.cpp new file mode 100644 index 000000000..31a9a1e5e --- /dev/null +++ b/DeviceAdapters/go2scope/AcqZarrStorage.cpp @@ -0,0 +1,571 @@ +/////////////////////////////////////////////////////////////////////////////// +// FILE: AcqZarrStorage.cpp +// PROJECT: Micro-Manager +// SUBSYSTEM: DeviceAdapters +//----------------------------------------------------------------------------- +// DESCRIPTION: Zarr writer based on the CZI acquire-zarr library +// +// AUTHOR: Nenad Amodaj +// +// COPYRIGHT: Nenad Amodaj, Chan Zuckerberg Initiative, 2024 +// +// LICENSE: This file is distributed under the BSD license. +// License text is included with the source distribution. +// +// This file is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty +// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +// +// IN NO EVENT SHALL THE COPYRIGHT OWNER OR +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES. +// +// NOTE: Storage Device development is supported in part by +// Chan Zuckerberg Initiative (CZI) +// +/////////////////////////////////////////////////////////////////////////////// +#include "G2SStorage.h" +#include "AcqZarrStorage.h" +#include "zarr.h" +#include "nlohmann/json.hpp" +#include +#include +#include +#include + + +using namespace std; + + +std::string generate_guid() { + std::random_device rd; + std::mt19937 gen(rd()); + std::uniform_int_distribution<> dis(0, 15); + std::uniform_int_distribution<> dis2(8, 11); + + std::stringstream ss; + ss << std::hex; + + for (int i = 0; i < 8; i++) { + ss << dis(gen); + } + ss << "-"; + for (int i = 0; i < 4; i++) { + ss << dis(gen); + } + ss << "-4"; + for (int i = 0; i < 3; i++) { + ss << dis(gen); + } + ss << "-" << dis2(gen); + for (int i = 0; i < 3; i++) { + ss << dis(gen); + } + ss << "-"; + for (int i = 0; i < 12; i++) { + ss << dis(gen); + } + + return ss.str(); +} + +/////////////////////////////////////////////////////////////////////////////// +// Zarr storage + +AcqZarrStorage::AcqZarrStorage() : + initialized(false), zarrStream(nullptr), currentImageNumber(0), dataType(MM::StorageDataType_UNKNOWN) +{ + InitializeDefaultErrorMessages(); + + // set device specific error messages + SetErrorText(ERR_ZARR, "Generic Zarr writer error. Check log for more information."); + SetErrorText(ERR_INTERNAL, "Internal driver error, see log file for details"); + SetErrorText(ERR_ZARR_SETTINGS, "Error in creating Zarr settings."); + SetErrorText(ERR_ZARR_NUMDIMS, "Number of Zarr dimensions is not valid."); + SetErrorText(ERR_ZARR_STREAM_CREATE, "Error creating Zarr stream. See log for more info."); + SetErrorText(ERR_ZARR_STREAM_CLOSE, "Error closing Zarr stream. See log for more info."); + SetErrorText(ERR_ZARR_STREAM_LOAD, "Error opening an existing Zarr stream."); + SetErrorText(ERR_ZARR_STREAM_APPEND, "Error appending image to Zarr stream."); + SetErrorText(ERR_ZARR_STREAM_ACCESS, "Error accessing Zarr stream. See log for more info."); + SetErrorText(ERR_ZARR_STREAM_LOAD, "Error opening an existing Zarr stream."); + + auto ver = Zarr_get_api_version(); + + // create pre-initialization properties + // ------------------------------------ + // + + // Name + CreateProperty(MM::g_Keyword_Name, g_AcqZarrStorage, MM::String, true); + // + // Description + ostringstream os; + os << "Acquire Zarr Storage v" << ver; + CreateProperty(MM::g_Keyword_Description, os.str().c_str(), MM::String, true); +} + +AcqZarrStorage::~AcqZarrStorage() +{ + Shutdown(); +} + +void AcqZarrStorage::GetName(char* Name) const +{ + CDeviceUtils::CopyLimitedString(Name, g_AcqZarrStorage); +} + +int AcqZarrStorage::Initialize() +{ + if (initialized) + return DEVICE_OK; + + int ret(DEVICE_OK); + + UpdateStatus(); + + initialized = true; + return DEVICE_OK; +} + +int AcqZarrStorage::Shutdown() +{ + if (initialized) + { + initialized = false; + } + destroyStream(); + + return DEVICE_OK; +} + +// Never busy because all commands block +bool AcqZarrStorage::Busy() +{ + return false; +} + +/** + * Creates Zarr dataset + * + * \param path - parent directory of the dataset + * \param name - name of the dataset (the actual name will follow the micro-manager convention for not overwriting) + * \param numberOfDimensions - how many dimensions + * \param shape - array of dimension sizes, from slow to fast. Y and X are always the last two. + * \param pixType - pixel type + * \param meta - JSON encoded string representing "summary" metadata. Can be empty. + * \param handle - handle to the dataset. + * \return + */ +int AcqZarrStorage::Create(const char* path, const char* name, int numberOfDimensions, const int shape[], MM::StorageDataType pixType, const char* meta, char* handle) +{ + if (zarrStream) + { + LogMessage("Another stream is already open. Currently this device supports only one stream."); + return ERR_ZARR_NUMDIMS; + } + + if (numberOfDimensions < 3) + { + LogMessage("Number of dimensions is lower than 3."); + return ERR_ZARR_NUMDIMS; + } + + auto settings = ZarrStreamSettings_create(); + if (!settings) + { + LogMessage("Failed creating Zarr stream settings."); + return ERR_ZARR_SETTINGS; + } + + // set path + string savePrefix(name); + string savePrefixTmp(name); + string saveRoot(path); + string dsName = string(path) + "/" + savePrefixTmp; + int counter(1); + while (boost::filesystem::exists(dsName)) + { + savePrefixTmp = savePrefix + "_" + to_string(counter++); + dsName = saveRoot + "/" + savePrefixTmp; + } + boost::system::error_code errCode; + if (!boost::filesystem::create_directory(dsName, errCode)) + return ERR_FAILED_CREATING_FILE; + + char* streamPathName = new char[dsName.size() + 1]; + strcpy(streamPathName, dsName.c_str()); + ZarrStatus status = ZarrStreamSettings_set_store(settings, + streamPathName, + dsName.size() + 1, + nullptr); + if (status != ZarrStatus_Success) + { + LogMessage(getErrorMessage(status)); + ZarrStreamSettings_destroy(settings); + return ERR_ZARR_SETTINGS; + } + + // set data type and convert to zarr + int ztype = ConvertToZarrType(pixType); + if (ztype == -1) + { + LogMessage("Pixel data type is not supported by Zarr writer " + pixType); + ZarrStreamSettings_destroy(settings); + return ERR_ZARR_SETTINGS; + } + + status = ZarrStreamSettings_set_data_type(settings, (ZarrDataType)ztype); + if (status != ZarrStatus_Success) + { + LogMessage(getErrorMessage(status)); + ZarrStreamSettings_destroy(settings); + return ERR_ZARR_SETTINGS; + } + + status = ZarrStreamSettings_reserve_dimensions(settings, numberOfDimensions); + if (status != ZarrStatus_Success) + { + LogMessage(getErrorMessage(status)); + ZarrStreamSettings_destroy(settings); + return ERR_ZARR_SETTINGS; + } + + for (size_t i = 0; i < numberOfDimensions - 2; i++) + { + ZarrDimensionProperties dimProps; + ostringstream osd; + osd << "dim-" << i; + auto dimName(osd.str()); + dimProps.name = new char[dimName.size() + 1]; + strcpy(const_cast(dimProps.name), osd.str().c_str()); + dimProps.bytes_of_name = dimName.size() + 1; + dimProps.array_size_px = shape[i]; + dimProps.chunk_size_px = 1; + dimProps.shard_size_chunks = 1; + ZarrStatus status = ZarrStreamSettings_set_dimension(settings, i, &dimProps); + if (status != ZarrStatus_Success) + { + LogMessage(getErrorMessage(status)); + ZarrStreamSettings_destroy(settings); + return ERR_ZARR_SETTINGS; + } + } + + ZarrDimensionProperties dimPropsY; + string nameY("y"); + dimPropsY.name = new char[nameY.size() + 1]; + strcpy(const_cast(dimPropsY.name), nameY.c_str()); + dimPropsY.bytes_of_name = nameY.size() + 1; + dimPropsY.array_size_px = shape[numberOfDimensions - 2]; + dimPropsY.chunk_size_px = dimPropsY.array_size_px; + dimPropsY.shard_size_chunks = 1; + dimPropsY.kind = ZarrDimensionType_Space; + + status = ZarrStreamSettings_set_dimension(settings, numberOfDimensions - 2, &dimPropsY); + if (status != ZarrStatus_Success) + { + LogMessage(getErrorMessage(status)); + ZarrStreamSettings_destroy(settings); + return ERR_ZARR_SETTINGS; + } + + ZarrDimensionProperties dimPropsX; + string nameX("x"); + dimPropsX.name = new char[nameX.size() + 1]; + strcpy(const_cast(dimPropsX.name), nameX.c_str()); + dimPropsX.bytes_of_name = nameX.size() + 1; + dimPropsX.array_size_px = shape[numberOfDimensions - 1]; + dimPropsX.chunk_size_px = dimPropsX.array_size_px; + dimPropsX.shard_size_chunks = 1; + dimPropsX.kind = ZarrDimensionType_Space; + + status = ZarrStreamSettings_set_dimension(settings, numberOfDimensions - 1, &dimPropsX); + if (status != ZarrStatus_Success) + { + LogMessage(getErrorMessage(status)); + ZarrStreamSettings_destroy(settings); + return ERR_ZARR_SETTINGS; + } + + if (strlen(meta)) + { + status = ZarrStreamSettings_set_custom_metadata(settings, meta, strlen(meta) + 1); + if (status != ZarrStatus_Success) + { + LogMessage("Invalid summary metadata."); + ZarrStreamSettings_destroy(settings); + return ERR_ZARR_SETTINGS; + } + } + + zarrStream = ZarrStream_create(settings, ZarrVersion_2); + if (zarrStream == nullptr) + { + LogMessage("Failed creating Zarr stream: " + dsName); + ZarrStreamSettings_destroy(settings); + return ERR_ZARR_STREAM_CREATE; + } + + dataType = pixType; + streamHandle = generate_guid(); + streamDimensions.clear(); + for (int i = 0; i < numberOfDimensions; i++) streamDimensions.push_back(shape[i]); + // TODO: allow many streams + + currentImageNumber = 0; + strncpy(handle, streamHandle.c_str(), MM::MaxStrLength); + + ZarrStreamSettings_destroy(settings); + + streamPath = dsName; + + return DEVICE_OK; +} + +int AcqZarrStorage::ConfigureDimension(const char* handle, int dimension, const char* name, const char* meaning) +{ + return DEVICE_OK; +} + +int AcqZarrStorage::ConfigureCoordinate(const char* handle, int dimension, int coordinate, const char* name) +{ + return DEVICE_OK; +} + +int AcqZarrStorage::Close(const char* handle) +{ + if (zarrStream == nullptr) + { + LogMessage("No stream is currently open."); + return ERR_ZARR_STREAM_CLOSE; + } + if (streamHandle.compare(handle) != 0) + { + LogMessage("Handle is not valid."); + return ERR_ZARR_STREAM_CLOSE; + } + + streamPath.clear(); + destroyStream(); + + return DEVICE_OK; +} + +int AcqZarrStorage::Load(const char* path, char* handle) +{ + return DEVICE_NOT_YET_IMPLEMENTED; +} + +int AcqZarrStorage::GetShape(const char* handle, int shape[]) +{ + if (zarrStream == nullptr) + { + LogMessage("No stream is currently open."); + return ERR_ZARR_STREAM_ACCESS; + } + if (streamHandle.compare(handle) != 0) + { + LogMessage("Handle is not valid."); + return ERR_ZARR_STREAM_ACCESS; + } + + int i(0); + for (auto d : streamDimensions) shape[i++] = d; + + return DEVICE_OK; +} + +int AcqZarrStorage::Delete(char* handle) +{ + return DEVICE_NOT_YET_IMPLEMENTED; +} + +int AcqZarrStorage::List(const char* path, char** listOfDatasets, int maxItems, int maxItemLength) +{ + return DEVICE_NOT_YET_IMPLEMENTED; +} + +int AcqZarrStorage::AddImage(const char* handle, int sizeInBytes, unsigned char* pixels, int coordinates[], int numCoordinates, const char* imageMeta) +{ + // acquire-zarr supports append-only images + // TODO: check if the coordinates are coming in the right order and return run-time error if they dont + return AppendImage(handle, sizeInBytes, pixels, imageMeta); +} + +int AcqZarrStorage::AppendImage(const char* handle, int sizeInBytes, unsigned char* pixels, const char* imageMeta) +{ + if (zarrStream == nullptr) + { + LogMessage("No stream is currently open."); + return ERR_ZARR_STREAM_ACCESS; + } + if (streamHandle.compare(handle) != 0) + { + LogMessage("Handle is not valid."); + return ERR_ZARR_STREAM_ACCESS; + } + + if (streamDimensions[streamDimensions.size() - 2] * streamDimensions[streamDimensions.size() - 1] * MM::GetPixelDataSizeInBytes(dataType) != sizeInBytes) + { + LogMessage("Stream dimensions do not match image size"); + return ERR_ZARR_STREAM_APPEND; + } + + size_t bytesIn(sizeInBytes); + size_t bytesOut(0); + ZarrStatus status = ZarrStream_append(zarrStream, pixels, bytesIn, &bytesOut); + if (status != ZarrStatus_Success) + { + LogMessage(getErrorMessage(status)); + return ERR_ZARR_STREAM_APPEND; + } + + if (bytesOut != bytesIn) + { + ostringstream os; + os << "Bytes in " << bytesIn << " does not match bytes out " << bytesOut; + LogMessage(os.str()); + return ERR_ZARR_STREAM_APPEND; + } + currentImageNumber++; + + return DEVICE_OK; +} + +int AcqZarrStorage::GetSummaryMeta(const char* handle, char* meta, int bufSize) +{ + if (zarrStream == nullptr) + { + LogMessage("No stream is currently open."); + return ERR_ZARR_STREAM_ACCESS; + } + if (streamHandle.compare(handle) != 0) + { + LogMessage("Handle is not valid."); + return ERR_ZARR_STREAM_ACCESS; + } + + if (bufSize > 0) + meta[0] = 0; + + return 0; +} + +int AcqZarrStorage::GetImageMeta(const char* handle, int coordinates[], int numCoordinates, char* meta, int bufSize) +{ + if (zarrStream == nullptr) + { + LogMessage("No stream is currently open."); + return ERR_ZARR_STREAM_ACCESS; + } + if (streamHandle.compare(handle) != 0) + { + LogMessage("Handle is not valid."); + return ERR_ZARR_STREAM_ACCESS; + } + + if (bufSize > 0) + meta[0] = 0; + + return 0; +} + +const unsigned char* AcqZarrStorage::GetImage(const char* handle, int coordinates[], int numCoordinates) +{ + if (zarrStream == nullptr) + { + LogMessage("No stream is currently open."); + return nullptr; + } + if (streamHandle.compare(handle) != 0) + { + LogMessage("Handle is not valid."); + return nullptr; + } + + return nullptr; +} + +int AcqZarrStorage::GetNumberOfDimensions(const char* handle, int& numDimensions) +{ + if (streamHandle.compare(handle) != 0) + { + LogMessage("Handle is not valid."); + return ERR_ZARR_STREAM_ACCESS; + } + return streamDimensions.size(); +} + +int AcqZarrStorage::GetDimension(const char* handle, int dimension, char* name, int nameLength, char* meaning, int meaningLength) +{ + return DEVICE_NOT_YET_IMPLEMENTED; +} + +int AcqZarrStorage::GetCoordinate(const char* handle, int dimension, int coordinate, char* name, int nameLength) +{ + return DEVICE_NOT_YET_IMPLEMENTED; +} + +int AcqZarrStorage::GetImageCount(const char* handle, int& imgcount) +{ + return DEVICE_NOT_YET_IMPLEMENTED; +} + +bool AcqZarrStorage::IsOpen(const char* handle) +{ + if (streamHandle.compare(handle) != 0) + { + return false; + } + return true; +} + +bool AcqZarrStorage::IsReadOnly(const char* handle) +{ + return false; +} + +int AcqZarrStorage::GetPath(const char* handle, char* path, int maxPathLength) +{ + return 0; +} + +std::string AcqZarrStorage::getErrorMessage(int code) +{ + return std::string(Zarr_get_error_message((ZarrStatus)code)); +} + +void AcqZarrStorage::destroyStream() +{ + if (zarrStream) + { + ZarrStream_destroy(zarrStream); + zarrStream = nullptr; + streamHandle = ""; + } +} + +int AcqZarrStorage::ConvertToZarrType(MM::StorageDataType type) +{ + ZarrDataType ztype; + switch (type) + { + case MM::StorageDataType_GRAY8: + ztype = ZarrDataType_uint8; + break; + + case MM::StorageDataType_GRAY16: + ztype = ZarrDataType_int16; // why is there no uint16? + break; + + default: + return -1; + } + return (int)ztype; +} + + +/////////////////////////////////////////////////////////////////////////////// +// Action handlers +/////////////////////////////////////////////////////////////////////////////// + diff --git a/DeviceAdapters/go2scope/AcqZarrStorage.h b/DeviceAdapters/go2scope/AcqZarrStorage.h new file mode 100644 index 000000000..cd054e5a5 --- /dev/null +++ b/DeviceAdapters/go2scope/AcqZarrStorage.h @@ -0,0 +1,90 @@ +/////////////////////////////////////////////////////////////////////////////// +// FILE: AcqZarrStorage.h +// PROJECT: Micro-Manager +// SUBSYSTEM: DeviceAdapters +//----------------------------------------------------------------------------- +// DESCRIPTION: Go2Scope devices. Includes the experimental StorageDevice +// +// AUTHOR: Nenad Amodaj +// +// COPYRIGHT: Nenad Amodaj, Chan Zuckerberg Initiative, 2024 +// +// LICENSE: This file is distributed under the BSD license. +// License text is included with the source distribution. +// +// This file is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty +// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +// +// IN NO EVENT SHALL THE COPYRIGHT OWNER OR +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES. +// +// NOTE: Storage Device development is supported in part by +// Chan Zuckerberg Initiative (CZI) +// +/////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "MMDevice.h" +#include "DeviceBase.h" + +struct ZarrStream_s; + +class AcqZarrStorage : public CStorageBase +{ +public: + AcqZarrStorage(); + virtual ~AcqZarrStorage(); + + // Device API + // ---------- + int Initialize(); + int Shutdown(); + + void GetName(char* pszName) const; + bool Busy(); + + // Storage API + // ----------- + int Create(const char* path, const char* name, int numberOfDimensions, const int shape[], MM::StorageDataType pixType, const char* meta, char* handle); + int ConfigureDimension(const char* handle, int dimension, const char* name, const char* meaning); + int ConfigureCoordinate(const char* handle, int dimension, int coordinate, const char* name); + int Close(const char* handle); + int Load(const char* path, char* handle); + int GetShape(const char* handle, int shape[]); + int GetDataType(const char* handle, MM::StorageDataType& pixelDataType) { return dataType; } + + int Delete(char* handle); + int List(const char* path, char** listOfDatasets, int maxItems, int maxItemLength); + int AddImage(const char* handle, int sizeInBytes, unsigned char* pixels, int coordinates[], int numCoordinates, const char* imageMeta); + int AppendImage(const char* handle, int sizeInBytes, unsigned char* pixels, const char* imageMeta); + int GetSummaryMeta(const char* handle, char* meta, int bufSize); + int GetImageMeta(const char* handle, int coordinates[], int numCoordinates, char* meta, int bufSize); + const unsigned char* GetImage(const char* handle, int coordinates[], int numCoordinates); + int GetNumberOfDimensions(const char* handle, int& numDimensions); + int GetDimension(const char* handle, int dimension, char* name, int nameLength, char* meaning, int meaningLength); + int GetCoordinate(const char* handle, int dimension, int coordinate, char* name, int nameLength); + int GetImageCount(const char* handle, int& imgcnt); + bool IsOpen(const char* handle); + bool IsReadOnly(const char* handle); + int GetPath(const char* handle, char* path, int maxPathLength); + + + // action interface + // ---------------- + +private: + bool initialized; + ZarrStream_s* zarrStream; + std::vector streamDimensions; + MM::StorageDataType dataType; + std::vector currentCoordinate; + int currentImageNumber; + std::string streamHandle; + std::string getErrorMessage(int code); + void destroyStream(); + int ConvertToZarrType(MM::StorageDataType type); + std::string streamPath; +}; + diff --git a/DeviceAdapters/go2scope/CFileUtil.cpp b/DeviceAdapters/go2scope/CFileUtil.cpp new file mode 100644 index 000000000..c69e4e279 --- /dev/null +++ b/DeviceAdapters/go2scope/CFileUtil.cpp @@ -0,0 +1,113 @@ +/////////////////////////////////////////////////////////////////////////////// +// FILE: G2SFileUtil.cpp +// PROJECT: Micro-Manager +// SUBSYSTEM: DeviceAdapters +//----------------------------------------------------------------------------- +// DESCRIPTION: Go2Scope devices. Includes the experimental StorageDevice +// +// AUTHOR: Milos Jovanovic +// +// COPYRIGHT: Nenad Amodaj, Chan Zuckerberg Initiative, 2024 +// +// LICENSE: This file is distributed under the BSD license. +// License text is included with the source distribution. +// +// This file is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty +// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +// +// IN NO EVENT SHALL THE COPYRIGHT OWNER OR +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES. +// +// NOTE: Storage Device development is supported in part by +// Chan Zuckerberg Initiative (CZI) +// +/////////////////////////////////////////////////////////////////////////////// +#include "G2SFileUtil.h" + +/** + * Write integer value to a byte buffer + * @param buff Byte buffer + * @param len Value length (in bytes) + * @param val Integer value + * @author Miloš Jovanović + * @version 1.0 + */ +void writeInt(unsigned char* buff, std::uint8_t len, std::uint64_t val) noexcept +{ + if(buff == nullptr || len == 0) + return; + for(auto i = 0; i < len; i++) + buff[i] = (val >> (i * 8)) & 0xff; +} + +/** + * Read integer value from a byte buffer + * @param buff Byte buffer + * @param len Value length (in bytes) + * @return Integer value + * @author Miloš Jovanović + * @version 1.0 + */ +std::uint64_t readInt(const unsigned char* buff, std::uint8_t len) noexcept +{ + if(buff == nullptr || len == 0 || len > 8) + return 0; + std::uint64_t ret = 0; + for(std::uint8_t i = 0; i < len; i++) + { + auto shift = i * 8; + std::uint64_t xval = (std::uint64_t)buff[i] << shift; + ret |= xval; + } + return ret; +} + +/** + * Split CSV line into tokens + * @param line CSV line + * @return Tokens list + */ +std::vector splitLineCSV(const std::string& line) noexcept +{ + std::vector ret; + if(line.empty()) + return ret; + + std::string curr = ""; + bool qopen = false; + int qcnt = 0; + for(char c : line) + { + bool endswithQ = curr.size() >= 1 && curr[curr.size() - 1] == '\"'; + bool endswithS = curr.size() >= 1 && curr[curr.size() - 1] == ' '; + bool endswithEQ = curr.size() >= 2 && curr[curr.size() - 1] == '\"' && curr[curr.size() - 1] == '\\'; + if(c == ',' && (!qopen || (qcnt % 2 == 0 && (endswithQ || endswithS) && !endswithEQ))) + { + if(curr.size() >= 2 && curr[0] == '\"' && curr[curr.size() - 1] == '\"') + curr = curr.substr(1, curr.size() - 2); + ret.push_back(curr); + curr = ""; + qcnt = 0; + qopen = false; + } + else if(c == '"') + { + if(qcnt == 0) + qopen = true; + qcnt++; + //if(qcnt > 1 && qcnt % 2 == 1) + curr += "\""; + } + else + curr += c; + } + if(!curr.empty()) + { + if(curr.size() >= 2 && curr[0] == '\"' && curr[curr.size() - 1] == '\"') + curr = curr.substr(1, curr.size() - 2); + ret.push_back(curr); + } + return ret; +} diff --git a/DeviceAdapters/go2scope/G2SBigTiffDataset.cpp b/DeviceAdapters/go2scope/G2SBigTiffDataset.cpp new file mode 100644 index 000000000..fc9f81b59 --- /dev/null +++ b/DeviceAdapters/go2scope/G2SBigTiffDataset.cpp @@ -0,0 +1,894 @@ +/////////////////////////////////////////////////////////////////////////////// +// FILE: G2STiffFile.cpp +// PROJECT: Micro-Manager +// SUBSYSTEM: DeviceAdapters +//----------------------------------------------------------------------------- +// DESCRIPTION: Go2Scope devices. Includes the experimental StorageDevice +// +// AUTHOR: Milos Jovanovic +// +// COPYRIGHT: Nenad Amodaj, Chan Zuckerberg Initiative, 2024 +// +// LICENSE: This file is distributed under the BSD license. +// License text is included with the source distribution. +// +// This file is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty +// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +// +// IN NO EVENT SHALL THE COPYRIGHT OWNER OR +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES. +// +// NOTE: Storage Device development is supported in part by +// Chan Zuckerberg Initiative (CZI) +// +/////////////////////////////////////////////////////////////////////////////// +#define _LARGEFILE64_SOURCE +#include +#include +#include +#include +#include "G2SBigTiffDataset.h" +#ifdef _WIN32 +#include +#else +#include +#include +#include +#include +#endif + +#define G2SFOLDER_EXT ".g2s" +#define G2SFILE_EXT ".g2s.tif" +#define G2SAXISINFO_FILE "axisinfo.txt" + +/** + * Class constructor + * Constructor doesn't open the file, just creates an object set sets the configuration + * By convention G2S format files end with a .g2s.tif extension + * First data chunk doesn't have a index (e.g. SampleDataset.g2s.tif) + * Other data chunks contain an index (1-based, e.g. SampleDataset_1.g2s.tif, SampleDataset_2.g2s.tif..) + * Dataset files are contained within a directory. The name of the directory matches the dataset name with the .g2s sufix (e.g. SampleDataset.g2s) + */ +G2SBigTiffDataset::G2SBigTiffDataset() noexcept +{ + dspath = ""; + datasetuid = ""; + bitdepth = 8; + samples = 1; + imgcounter = 0; + flushcnt = 0; + chunksize = 0; + directIo = false; + bigTiff = true; + writemode = false; +} + +/** + * Create a dataset + * All datasets are stored in separate folders, folder names have a .g2s suffix + * If the folder with the specified name already exists, a name with the index in the suffix will be used + * If the dataset is chunked files will be created only when the active chunk is filled + * @param path Dataset (folder) path + * @param dio Use direct I/O + * @param fbig Use BigTIFF format + * @param chunksz Chunk size + * @throws std::runtime_error + */ +void G2SBigTiffDataset::create(const std::string& path, bool dio, bool fbig, std::uint32_t chunksz) +{ + if(isOpen()) + throw std::runtime_error("Invalid operation. Dataset is already created"); + if(path.empty()) + throw std::runtime_error("Unable to create a file stream. Dataset path is undefined"); + directIo = dio; + writemode = true; + chunksize = chunksz; + bigTiff = fbig; + + // Extract dataset name + std::filesystem::path basepath = std::filesystem::u8path(path); + dsname = basepath.stem().u8string(); + if(dsname.find(".g2s") == dsname.size() - 4) + dsname = dsname.substr(0, dsname.size() - 4); + + // Determine dataset path + std::uint32_t counter = 1; + std::filesystem::path xpath = basepath.parent_path() / (dsname + G2SFOLDER_EXT); + while(std::filesystem::exists(xpath)) + { + // If the file path (path + name) exists, it should not be an error + // nor the file should be overwritten, first available suffix (index) will be appended to the file name + auto tmpname = dsname + "_" + std::to_string(counter++) + G2SFOLDER_EXT; + xpath = basepath.parent_path() / tmpname; + } + dspath = xpath.u8string(); + + + // Create a first file (data chunk) + std::error_code ec; + std::filesystem::path fp = xpath / (dsname + G2SFILE_EXT); + std::filesystem::create_directories(fp.parent_path(), ec); + if(ec.value() != 0) + throw std::runtime_error("Unable to create a file stream. Directory tree creation failed"); + activechunk = std::make_shared(fp.u8string(), directIo, bigTiff); + if(!activechunk) + throw std::runtime_error("Unable to create a file stream. Data chunk allocation failed"); + activechunk->open(true); + if(activechunk->getHeader().empty()) + throw std::runtime_error("Unable to create a file stream. File header creation failed"); + if(!datasetuid.empty()) + activechunk->writeDatasetUid(datasetuid); + if(!shape.empty()) + activechunk->writeShapeInfo(shape, chunksize); + datachunks.push_back(activechunk); +} + +/** + * Load a dataset + * If the dataset doesn't exist an exception will be thrown + * If the dataset exists dataset parameters and metadata will be parsed + * If the dataset is chunked all files will be enumerated, but only the first file will be loaded + * @param path Dataset (folder) path or File path of the first data chunk + * @param dio Use direct I/O + * @throws std::runtime_error + */ +void G2SBigTiffDataset::load(const std::string& path, bool dio) +{ + if(isOpen()) + throw std::runtime_error("Invalid operation. Dataset is already loaded"); + if(path.empty()) + throw std::runtime_error("Unable to load a dataset. Dataset path is undefined"); + directIo = dio; + writemode = false; + + // Check dataset / file path + auto xp = std::filesystem::u8path(path); + if(!std::filesystem::exists(xp)) + { + // Check if the dataset path has a .g2s extension + std::string fpath(path); + if(fpath.find(".g2s") != fpath.size() - 4) + fpath += ".g2s"; + xp = std::filesystem::u8path(path); + if(!std::filesystem::exists(xp)) + throw std::runtime_error("Unable to load a dataset. Specified path doesn't exist"); + } + + // If the first data chunk (file) path is specified -> use parent folder path + if(std::filesystem::is_regular_file(xp)) + xp = xp.parent_path(); + dspath = xp.u8string(); + dsname = xp.stem().u8string(); + if(dsname.find(".g2s") == dsname.size() - 4) + dsname = dsname.substr(0, dsname.size() - 4); + + // Enumerate files + for(const auto& entry : std::filesystem::directory_iterator(xp)) + { + // Skip auto folder paths + auto fname = entry.path().filename().u8string(); + if(fname == "." || fname == "..") + continue; + + // Skip folders + if(std::filesystem::is_directory(entry)) + continue; + + // Skip unsupported file formats + auto fext = entry.path().extension().u8string(); + if(fext.size() == 0) + continue; + if(fext[0] == '.') + fext = fext.substr(1); + std::transform(fext.begin(), fext.end(), fext.begin(), [](char c) { return (char)tolower(c); }); + if(fext != "tiff" && fext != "tif" && fext != "g2s.tiff" && fext != "g2s.tif") + continue; + + // We found a supported file type -> Add to results list + auto abspath = std::filesystem::absolute(entry).u8string(); + auto dchunk = std::make_shared(abspath, directIo); + datachunks.push_back(dchunk); + } + if(datachunks.empty()) + throw std::runtime_error("Unable to load a dataset. No files found"); + + // Load first data chunk + samples = 1; + imgcounter = 0; + metadata.clear(); + activechunk = datachunks.front(); + activechunk->open(false); + activechunk->parse(datasetuid, shape, chunksize, metadata, bitdepth); + imgcounter += activechunk->getImageCount(); + resetAxisInfo(); + parseAxisInfo(); + + // Validate dataset parameters + if(activechunk->getChunkIndex() != 0) + { + close(); + throw std::runtime_error("Unable to load a dataset. First data chunk is missing"); + } + if(datasetuid.empty()) + { + close(); + throw std::runtime_error("Unable to load a dataset. Invalid dataset UID"); + } + if(shape.size() < 3) + { + close(); + throw std::runtime_error("Unable to load a dataset. Invalid dataset shape"); + } + if(bitdepth < 8 || bitdepth > 16) + { + close(); + throw std::runtime_error("Unable to load a dataset. Unsupported pixel format"); + } + + // Parse headers for other data chunks + for(std::size_t i = 1; i < datachunks.size(); i++) + { + validateDataChunk(i, false); + imgcounter += datachunks[i]->getImageCount(); + datachunks[i]->close(); + } +} + +/** + * Close the dataset + * If a dataset hasn't been created / loaded this method will have no effect + * File handles will be released / closed + * In the create mode during closing final section (dataset metadata) is commited to the first data chunk (file) + */ +void G2SBigTiffDataset::close() noexcept +{ + if(writemode && datachunks.size() == 1 && datachunks[0]->isOpen()) + datachunks[0]->appendMetadata(metadata); + writeAxisInfo(); + for(const auto& fx : datachunks) + fx->close(); + imgcounter = 0; + bitdepth = 8; + samples = 1; + metadata.clear(); + shape.clear(); + datachunks.clear(); + activechunk.reset(); + axisinfo.clear(); +} + +/** + * Set dataset shape / dimension & axis sizes + * First two axis are always width and height + * If the shape info is invalid this method will take no effect + * Shape can only be set in the write mode, before adding any images + * @param dims Axis sizes list + * @throws std::runtime_error + */ +void G2SBigTiffDataset::setShape(const std::vector& dims) +{ + if(dims.size() < 2) + throw std::runtime_error("Unable to set dataset shape. Invalid shape info"); + if(!writemode) + throw std::runtime_error("Unable to set dataset shape in read mode"); + if(datachunks.size() > 1) + throw std::runtime_error("Unable to set dataset shape. Dataset configuration is already set"); + if(imgcounter > 0 && shape.size() >= 2) + { + if(dims.size() != shape.size()) + throw std::runtime_error("Unable to set dataset shape. Invalid axis count"); + if(dims[dims.size() - 2] != shape[shape.size() - 2] || dims[dims.size() - 1] != shape[shape.size() - 1]) + throw std::runtime_error("Unable to set dataset shape. Image dimensions don't match the existing image dimensions"); + return; + } + shape = dims; + + // Resize axis descriptors vector + resetAxisInfo(); + + // Write shape info + if(activechunk) + activechunk->writeShapeInfo(shape, chunksize); +} + +/** + * Set dataset shape / dimension & axis sizes + * First two axis are always width and height + * If the shape info is invalid this method will take no effect + * Shape can only be set in the write mode, before adding any images + * @param dims Axis sizes list + * @throws std::runtime_error + */ +void G2SBigTiffDataset::setShape(std::initializer_list dims) +{ + if(dims.size() < 2) + throw std::runtime_error("Unable to set dataset shape. Invalid shape info"); + if(!writemode) + throw std::runtime_error("Unable to set dataset shape in read mode"); + if(datachunks.size() > 1) + throw std::runtime_error("Unable to set dataset shape. Dataset configuration is already set"); + if(imgcounter > 0 && shape.size() >= 2) + { + if(dims.size() != shape.size()) + throw std::runtime_error("Unable to set dataset shape. Invalid axis count"); + if(*(dims.end() - 2) != shape[shape.size() - 2] || *(dims.end() - 1) != shape[shape.size() - 1]) + throw std::runtime_error("Unable to set dataset shape. Image dimensions don't match the existing image dimensions"); + return; + } + shape = dims; + + // Resize axis descriptors vector + resetAxisInfo(); + + // Write shape info + if(activechunk) + activechunk->writeShapeInfo(shape, chunksize); +} + +/** + * Set pixel format + * If the pixel format is invalid this method will take no effect + * Pixel format can only be set in the write mode, before adding any images + * @param depth Bit depth (bits per sample) + * @parma vsamples Samples per pixel + * @throws std::runtime_error + */ +void G2SBigTiffDataset::setPixelFormat(std::uint8_t depth, std::uint8_t vsamples) +{ + if(!writemode) + throw std::runtime_error("Unable to set pixel format in read mode"); + if(datachunks.size() > 1) + throw std::runtime_error("Unable to set pixel format. Dataset configuration is already set"); + if(imgcounter > 0) + { + if(bitdepth != depth || samples != vsamples) + throw std::runtime_error("Unable to set pixel format. Specified pixel format doesn't match current pixel format"); + return; + } + bitdepth = depth; + samples = vsamples; +} + +/** + * Set dataset metadata + * Metadata will be stored in byte buffer whose size is 1 byte larger than the metadata string length + * @param meta Metadata string + */ +void G2SBigTiffDataset::setMetadata(const std::string& meta) +{ + if(!writemode) + throw std::runtime_error("Unable to set dataset metadata in read mode"); + + metadata.clear(); + if(meta.empty()) + return; + metadata.resize(meta.size() + 1); + std::copy(meta.begin(), meta.end(), metadata.begin()); +} + +/** + * Set dataset UID + * UID must be in a standard UUID format, 16-bytes long hex string with or without the dash delimiters: + * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX + * @param val Dataset UID + * @throws std::runtime_error + */ +void G2SBigTiffDataset::setUID(const std::string& val) +{ + if(!writemode) + throw std::runtime_error("Unable to set dataset UID in read mode"); + if(datachunks.size() > 1) + throw std::runtime_error("Unable to set dataset UID. Dataset configuration is already set"); + + if(val.empty()) + datasetuid = val; + else + { + if(val.size() != 32 && val.size() != 36) + throw std::runtime_error("Unable to set the dataset UID. Invalid UID format"); + auto hasdashes = val.size() == 36; + if(hasdashes && (val[8] != '-' || val[13] != '-' || val[18] != '-' || val[23] != '-')) + throw std::runtime_error("Unable to set the dataset UID. Invalid UID format"); + for(std::size_t i = 0; i < val.size(); i++) + { + if(hasdashes && (i == 8 || i == 13 || i == 18 || i == 23)) + continue; + if(val[i] < 48 || val[i] > 102 || (val[i] > 57 && val[i] < 65) || (val[i] > 70 && val[i] < 97)) + throw std::runtime_error("Unable to set the dataset UID. Invalid UID format"); + } + datasetuid = hasdashes ? val : val.substr(0, 8) + "-" + val.substr(8, 4) + "-" + val.substr(12, 4) + "-" + val.substr(16, 4) + "-" + val.substr(20); + } + + // Update file header + if(activechunk) + activechunk->writeDatasetUid(datasetuid); +} + +/** + * Configure axis info + * If axis index is invalid this method will have no effect + * @param dim Axis index + * @param name Axis name + * @param desc Axis description + */ +void G2SBigTiffDataset::configureAxis(int dim, const std::string& name, const std::string& desc) noexcept +{ + if(!writemode) + return; + if(dim < 0 || (std::size_t)dim >= axisinfo.size()) + return; + axisinfo[dim].Name = name; + axisinfo[dim].Description = desc; +} + +/** + * Configure axis coordinate info + * If axis / coordinate index is invalid this method will have no effect + * @param dim Axis index + * @param coord Axis coordinate index + * @param desc Coordinate description + */ +void G2SBigTiffDataset::configureCoordinate(int dim, int coord, const std::string& desc) noexcept +{ + if(!writemode) + return; + if(dim < 0 || (std::size_t)dim >= axisinfo.size() - 2) + return; + if(coord < 0 || (std::size_t)coord >= axisinfo[dim].Coordinates.size()) + return; + axisinfo[dim].Coordinates[coord] = desc; +} + +/** + * Get dataset metadata + * If metadata is specified value will be returned from cache, otherwise it will be read from a file stream + * @return Metadata string + */ +std::string G2SBigTiffDataset::getMetadata() const noexcept +{ + // Check metadata cache + if(metadata.empty()) + return ""; + std::string str(metadata.begin(), metadata.end() - 1); + return str; +} + +/** + * Get image metadata + * If the coordinates are not specified images are read sequentially, metadata for the current image + * will be returned, in which case the current image won't be changed + * If no metadata is defined this method will return an empty string + * If no images are defined this method will return an empty string + * In the sequential mode the image IFD will be loaded if this method is called before getImage() (only for the first image) + * For other images getImage() should always be called prior to calling getImageMetadata() + * @param coord Image coordinates + * @return Image metadata + * @throws std::runtime_error + */ +std::string G2SBigTiffDataset::getImageMetadata(const std::vector& coord) +{ + if(!isOpen()) + throw std::runtime_error("Invalid operation. No open file stream available"); + if(imgcounter == 0) + throw std::runtime_error("Invalid operation. No images available"); + + // Select current image (IFD) + if(!coord.empty()) + selectImage(coord); + else if(activechunk->getCurrentIFD().empty()) + // Load IFD + activechunk->loadIFD(activechunk->getCurrentIFDOffset()); + + return activechunk->getImageMetadata(); +} + +/** + * Add image / write image to the file + * Images are added sequentially + * Image data is stored uncompressed + * Metadata is stored in plain text, after the pixel data + * Image IFD is stored before pixel data + * If the new image doesn't belong to the current chunk, a new file will be created automatically, and the current one will be closed + * @param buff Image buffer + * @param len Image buffer length + * @param meta Image metadata (optional) + * @throws std::runtime_error + */ +void G2SBigTiffDataset::addImage(const unsigned char* buff, std::size_t len, const std::string& meta) +{ + if(!isOpen()) + throw std::runtime_error("Invalid operation. No open file stream available"); + if(!writemode) + throw std::runtime_error("Invalid operation. Unable to add images in read mode"); + if(shape.size() < 2) + throw std::runtime_error("Invalid operation. Dataset shape is not defined"); + if(!bigTiff && len > TIFF_MAX_BUFFER_SIZE) + throw std::runtime_error("Invalid operation. Image data is too long"); + if(!bigTiff && meta.size() > TIFF_MAX_BUFFER_SIZE) + throw std::runtime_error("Invalid operation. Metadata string is too large"); + + // Check active data chunk + if(chunksize > 0 && imgcounter > 0 && imgcounter % getChunkImageCount() == 0) + { + // Close current data chunk + // Only the first data chunk should contain dataset metadata + if(datachunks.size() == 1) + activechunk->appendMetadata(metadata); + activechunk->close(); + + // Create new data chunk + std::filesystem::path fp = std::filesystem::path(dspath) / (dsname + "_" + std::to_string(datachunks.size()) + G2SFILE_EXT); + activechunk = std::make_shared(fp.u8string(), directIo, bigTiff, (std::uint32_t)datachunks.size()); + if(!activechunk) + throw std::runtime_error("Unable to add an image. Data chunk allocation failed"); + activechunk->open(true); + if(activechunk->getHeader().empty()) + throw std::runtime_error("Unable to add an image. File header creation failed"); + activechunk->writeDatasetUid(datasetuid); + activechunk->writeShapeInfo(shape, chunksize); + datachunks.push_back(activechunk); + } + + // Check file size limits + activechunk->addImage(buff, len, getWidth(), getHeight(), bitdepth, meta); + imgcounter++; + + // Flush pending data + if(flushcnt > 0 && activechunk->getImageCount() % flushcnt == 0) + activechunk->flush(); +} + +/** + * Get image data (pixel buffer) + * If the coordinates are not specified images are read sequentially + * This method will change (advance) the current image + * If this method is called after the last available image (in sequential mode), or with invalid coordinates an exception will be thrown + * @param coord Image coordinates + * @return Image data + * @throws std::runtime_error + */ +std::vector G2SBigTiffDataset::getImage(const std::vector& coord) +{ + if(!isOpen()) + throw std::runtime_error("Invalid operation. No open file stream available"); + if(imgcounter == 0) + throw std::runtime_error("Invalid operation. No images available"); + + // Select current image (IFD) + if(!coord.empty()) + selectImage(coord); + else + advanceImage(); + return activechunk->getImage(); +} + +/** + * Check if image for the specified coordinates is already set + * @param coordinates Coordinates list + * @param numCoordinates Coordinates count + * @return Does image at the specified coordinates exists + */ +bool G2SBigTiffDataset::isCoordinateSet(int coordinates[], int numCoordinates) const noexcept +{ + std::uint32_t imgind = 0; + for(int i = 0; i < numCoordinates; i++) + { + if(i >= shape.size() - 2) + break; + std::uint32_t sum = 1; + for(int j = i + 1; j < shape.size() - 2; j++) + sum *= shape[j]; + imgind += sum * coordinates[i]; + } + return imgind < imgcounter; +} + +/** + * Change active data chunk + * This method is used only for reading data + * Dataset properties from the new data chunk will be validated + * @param chunkind Data chunk index + * @throws std::runtime_error + */ +void G2SBigTiffDataset::switchDataChunk(std::uint32_t chunkind) +{ + // Validate next data chunk + validateDataChunk(chunkind, true); + + // Change active data chunk + activechunk->close(); + activechunk = datachunks[chunkind]; +} + +/** + * Validate data chunk + * Data chunk (file stream) will be opened in order to parse the header + * File stream won't be closed unless validation fails + * @param chunkind Data chunk index + * @param index Index data chunk IFDs + * @throws std::runtime_error + */ +void G2SBigTiffDataset::validateDataChunk(std::uint32_t chunkind, bool index) +{ + std::string ldataseuid = ""; + std::vector lshape; + std::uint32_t lchunksz = 0; + std::vector lmetadata; + std::uint8_t lbitdepth = 0; + + // Open & parse data chunk (file) + datachunks[chunkind]->open(false); + datachunks[chunkind]->parse(ldataseuid, lshape, lchunksz, lmetadata, lbitdepth, index); + + // Validate dataset properties + if(datasetuid != ldataseuid) + { + datachunks[chunkind]->close(); + throw std::runtime_error("Invalid data chunk. Dataset UID missmatch"); + } + if(shape.size() != lshape.size()) + { + datachunks[chunkind]->close(); + throw std::runtime_error("Invalid data chunk. Dataset shape missmatch"); + } + for(std::size_t i = 0; i < shape.size(); i++) + { + if(shape[i] != lshape[i]) + { + datachunks[chunkind]->close(); + throw std::runtime_error("Invalid data chunk. Axis " + std::to_string(i) + " size missmatch"); + } + } + if(chunksize != lchunksz) + { + datachunks[chunkind]->close(); + throw std::runtime_error("Invalid data chunk. Chunk size missmatch"); + } + if(index && bitdepth != lbitdepth) + { + datachunks[chunkind]->close(); + throw std::runtime_error("Invalid data chunk. Pixel format missmatch"); + } +} + +/** + * Select image + * This method will automatically switch active data chunk + * @param coord Image coordinates + * @throws std::runtime_error + */ +void G2SBigTiffDataset::selectImage(const std::vector& coord) +{ + if(coord.empty()) + return; + if(!activechunk) + throw std::runtime_error("Invalid operation. Invalid data chunk"); + + // Calculate data chunk & image index + std::uint32_t chunkind = 0, imgind = 0; + calcImageIndex(coord, chunkind, imgind); + if(chunkind != activechunk->getChunkIndex()) + switchDataChunk(chunkind); + if(imgind >= activechunk->getIFDOffsets().size()) + throw std::runtime_error("Invalid operation. Invalid image coordinates"); + + // Change current image & load IFD + activechunk->setCurrentImage(imgind); + activechunk->loadIFD(activechunk->getIFDOffsets()[imgind]); +} + +/** + * Advance current image + * This method will automatically switch active data chunk + * @throws std::runtime_error + */ +void G2SBigTiffDataset::advanceImage() +{ + if(!activechunk) + throw std::runtime_error("Invalid operation. Invalid data chunk"); + if(activechunk == datachunks.back() && (activechunk->getCurrentImage() + 1 > activechunk->getImageCount() || activechunk->getNextIFDOffset() == 0)) + throw std::runtime_error("Invalid operation. No more images available"); + + // Check if need to switch the data chunk + if(activechunk->getCurrentImage() + 1 == activechunk->getImageCount()) + switchDataChunk(activechunk->getChunkIndex() + 1); + + // Clear current IFD before advancing + // In a case where getImageMetadata() is called before any getImage() call + // we should skip clearing the current IFD; this works only for the first image + if(activechunk->getCurrentImage() > 0) + activechunk->advanceIFD(); + + // Advance current image + activechunk->setCurrentImage(activechunk->getCurrentImage() + 1); + + // Load IFD (skip if already loaded by the getImageMetadata()) + if(activechunk->getCurrentIFD().empty()) + activechunk->loadNextIFD(); +} + +/** + * Get number of images in a data chunk + * Data chunk represents a dataset subset with one or more slowest changing dimension coordinates + * If chunking is turned OFF this method will return 0 + * @return Image count + */ +std::uint32_t G2SBigTiffDataset::getChunkImageCount() const noexcept +{ + if(chunksize == 0) + return 0; + std::uint32_t ret = 1; + for(std::size_t i = 1; i < shape.size() - 2; i++) + ret *= shape[i]; + return chunksize * ret; +} + +/** + * Calculate image index from image coordinates + * Image coordiantes should not contain indices for the last two dimensions (width & height) + * By convention image acquisitions loops through the coordinates in the descending order (higher coordinates are looped first) + * E.g. ZTC order means that all channels are acquired before changing the time point, and all specified time points + * are acquired before moving the Z-stage, in which case dataset with the shape 2-4-3 for coordinates 1-2-1 will return 19 (=1*12 + 2*3 + 1*1) + * First image coordinate can go beyond the specified shape size + * @param coord Image coordinates + * @param chunkind Data chunk index [out] + * @param imgind Image index (in the data chunk) [out] + * @throws std::runtime_error + */ +void G2SBigTiffDataset::calcImageIndex(const std::vector& coord, std::uint32_t& chunkind, std::uint32_t& imgind) const +{ + // Validate coordinates count + if(coord.size() > shape.size() - 2) + throw std::runtime_error("Invalid number of coordinates"); + if(chunkind >= datachunks.size() || (chunkind > 0 && chunksize == 0)) + throw std::runtime_error("Invalid data chunk index"); + if(coord.empty()) + { + chunkind = 0; + imgind = 0; + return; + } + + // Validate ranges for all axis (except the first) + for(std::size_t i = 1; i < coord.size(); i++) + { + if(coord[i] >= shape[i]) + throw std::runtime_error("Invalid coordinate for dimension " + std::to_string(i + 2)); + } + + // Determine chunk index + if(chunksize == 0) + chunkind = 0; + else + chunkind = coord[0] / chunksize; + + // Adjust slowest changing dimension index to set the base for image index calculation + std::vector lcoord = coord; + std::uint32_t baseind = chunkind * chunksize; + lcoord[0] -= baseind; + + // Calculate image index + std::uint32_t ind = 0; + for(int i = 0; i < lcoord.size(); i++) + { + if(lcoord[i] == 0) + continue; + std::uint32_t sum = 1; + for(int j = i + 1; j < shape.size() - 2; j++) + sum *= shape[j]; + ind += sum * lcoord[i]; + } + imgind = ind; +} + +/** + * Reset axis info structure + */ +void G2SBigTiffDataset::resetAxisInfo() noexcept +{ + axisinfo.clear(); + axisinfo.resize(shape.size()); + for(std::size_t i = 0; i < shape.size() - 2; i++) + axisinfo[i].setSize((std::size_t)shape[i]); +} + +/** + * Parse axis info + * Axis info is expected to be stored in a file: 'axisinfo.txt' + * @throws std::runtime_error + */ +void G2SBigTiffDataset::parseAxisInfo() +{ + auto fpath = std::filesystem::u8path(dspath) / G2SAXISINFO_FILE; + if(!std::filesystem::exists(fpath) || axisinfo.empty()) + return; + + // Load file content + std::fstream fs(fpath.u8string(), std::ios::in); + if(!fs.is_open()) + throw std::runtime_error("Unable to load axis info. Opening axis info file failed"); + + int ind = 0; + std::string line = ""; + while(std::getline(fs, line)) + { + if(line.empty()) + continue; + if((std::size_t)ind >= axisinfo.size()) + throw std::runtime_error("Unable to load axis info. Invalid axis info data"); + std::vector tokens = splitLineCSV(line); + if(tokens.size() < 3) + throw std::runtime_error("Unable to load axis info. Corrupted axis info, axis: " + std::to_string(ind)); + std::uint32_t axisdim = 0; + try + { + axisdim = std::stoul(tokens[2]); + } + catch(std::exception& e) + { + throw std::runtime_error("Unable to load axis info. " + std::string(e.what()) + ", axis: " + std::to_string(ind)); + } + if(axisinfo[ind].Coordinates.size() != axisdim || tokens.size() != (std::size_t)(3 + axisdim)) + throw std::runtime_error("Unable to load axis info. Axis size missmatch, axis: " + std::to_string(ind)); + axisinfo[ind].Name = tokens[0]; + axisinfo[ind].Description = tokens[1]; + for(std::uint32_t i = 0; i < axisdim; i++) + axisinfo[ind].Coordinates[i] = tokens[3 + i]; + ind++; + } +} + +/** + * Write axis info + * Axis info will be stored in a separate file: 'axisinfo.txt' + * If no axis info is defined file won't be created + * Axis info will be stored in plain text, CSV-like format + */ +void G2SBigTiffDataset::writeAxisInfo() const noexcept +{ + // Check if axis info is set, and that we are in WRITE mode + if(axisinfo.empty() || !writemode) + return; + + bool hasinfo = false; + for(const auto& dinf : axisinfo) + { + if(!dinf.Name.empty() || !dinf.Description.empty()) + { + hasinfo = true; + break; + } + for(const auto& cinf : dinf.Coordinates) + { + if(!cinf.empty()) + { + hasinfo = true; + break; + } + } + if(hasinfo) + break; + } + + // If axis info is empty, but the file exists -> delete it before exiting + auto fpath = std::filesystem::u8path(dspath) / G2SAXISINFO_FILE; + if(!hasinfo) + { + return; + } + + // Write data to a file + std::fstream fs(fpath.u8string(), std::ios::out | std::ios::trunc); + if(!fs.is_open()) + return; + for(const auto& dinf : axisinfo) + { + fs << "\"" << dinf.Name << "\",\"" << dinf.Description << "\"," << dinf.Coordinates.size(); + for(const auto& cinf : dinf.Coordinates) + fs << ",\"" << cinf << "\""; + fs << std::endl; + } + fs.close(); +} diff --git a/DeviceAdapters/go2scope/G2SBigTiffDataset.h b/DeviceAdapters/go2scope/G2SBigTiffDataset.h new file mode 100644 index 000000000..b3eb3d71e --- /dev/null +++ b/DeviceAdapters/go2scope/G2SBigTiffDataset.h @@ -0,0 +1,166 @@ +/////////////////////////////////////////////////////////////////////////////// +// FILE: G2STiffFile.h +// PROJECT: Micro-Manager +// SUBSYSTEM: DeviceAdapters +//----------------------------------------------------------------------------- +// DESCRIPTION: BIGTIFF storage device driver +// +// AUTHOR: Milos Jovanovic +// +// COPYRIGHT: Luminous Point LLC, Lumencor Inc. 2024 +// +// LICENSE: This file is distributed under the BSD license. +// License text is included with the source distribution. +// +// This file is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty +// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +// +// IN NO EVENT SHALL THE COPYRIGHT OWNER OR +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES. +//// +/////////////////////////////////////////////////////////////////////////////// +#pragma once +#include +#include +#include +#include +#include "G2SBigTiffStream.h" + +/** + * Go2Scope BigTiff File Parser + * Go2Scope BigTiff format is the extension of the BIgTIFF format (v6) + * Supports both storing the entire datasets (image acquisitions) in a single file + * or + * Chunking the dataset in multiple files, + * Chunk contains a subset of images that have a common slowest changing dimension + * Support for dataset and per-image metadata + * Support for large files (>2GB) + * Support for Direct and Cached I/O + * Support for sequential & random image access (read / write) + * @author Miloš Jovanović + * @version 1.0 + */ +class G2SBigTiffDataset +{ +public: + //============================================================================================================================ + // Constructors & Destructors + //============================================================================================================================ + G2SBigTiffDataset() noexcept; + G2SBigTiffDataset(const G2SBigTiffDataset& src) noexcept = default; + ~G2SBigTiffDataset() noexcept { close(); } + +public: + //============================================================================================================================ + // Internal data types + //============================================================================================================================ + /** + * Dataset dimension descriptor + * @author Miloš Jovanović + * @version 1.0 + */ + struct G2SDimensionInfo + { + /** + * Default initializer + * @param vname Axis name + * @param ndim Axis size + */ + G2SDimensionInfo(int ndim = 0) noexcept : Name(""), Description(""), Coordinates(ndim) { } + + /** + * Set dimensions size + * @param sz Number of axis coordinates + */ + void setSize(std::size_t sz) noexcept { Coordinates.resize(sz); } + /** + * Get dimension size + * @return Number of axis coordinates + */ + std::size_t getSize() const noexcept { return Coordinates.size(); } + + std::string Name; ///< Axis name + std::string Description; ///< Axis description + std::vector Coordinates; ///< Axis coordinates + }; + +public: + //============================================================================================================================ + // Public interface + //============================================================================================================================ + void create(const std::string& path, bool dio = DEFAULT_DIRECT_IO, bool fbig = DEFAULT_BIGTIFF, std::uint32_t chunksz = 0); + void load(const std::string& path, bool dio = DEFAULT_DIRECT_IO); + void close() noexcept; + void setFlushCycles(std::uint32_t val) noexcept { flushcnt = val; } + std::uint32_t getChunkSize() const noexcept { return chunksize; } + void setShape(const std::vector& dims); + void setShape(std::initializer_list dims); + std::vector getShape() const noexcept { return shape; } + std::size_t getDimension() const noexcept { return shape.size(); } + std::uint32_t getAxisSize(std::size_t ind) const noexcept { return ind < shape.size() ? shape[ind] : 0; } + std::uint32_t getWidth() const noexcept { return shape.size() < 2 ? 0 : shape[shape.size() - 1]; } + std::uint32_t getHeight() const noexcept { return shape.size() < 2 ? 0 : shape[shape.size() - 2]; } + void setPixelFormat(std::uint8_t depth, std::uint8_t vsamples = 1); + int getBitDepth() const noexcept { return (int)bitdepth; } + int getBpp() const noexcept { return (int)std::ceil(bitdepth / 8.0); } + int getSamples() const noexcept { return (int)samples; } + void setMetadata(const std::string& meta); + std::string getMetadata() const noexcept; + void setUID(const std::string& val); + std::string getUID() const noexcept { return datasetuid; } + void configureAxis(int dim, const std::string& name, const std::string& desc) noexcept; + void configureCoordinate(int dim, int coord, const std::string& desc) noexcept; + const G2SDimensionInfo& getAxisInfo(std::uint32_t dim) const { if(dim >= axisinfo.size()) throw std::runtime_error("Unable to obtain axis info. Invalid axis index"); return axisinfo[dim]; } + std::string getImageMetadata(const std::vector& coord = {}); + void addImage(const std::vector& buff, const std::string& meta = "") { addImage(&buff[0], buff.size(), meta); } + void addImage(const unsigned char* buff, std::size_t len, const std::string& meta = ""); + std::vector getImage(const std::vector& coord = {}); + std::uint32_t getDatasetImageCount() const noexcept { std::uint32_t ret = 1; for(std::size_t i = 0; i < shape.size() - 2; i++) ret *= shape[i]; return ret; } + std::uint32_t getImageCount() const noexcept { return imgcounter; } + std::string getPath() const noexcept { return dspath; } + std::string getName() const noexcept { return dsname; } + bool isDirectIO() const noexcept { return directIo; } + bool isBigTIFF() const noexcept { return bigTiff; } + bool isInWriteMode() const noexcept { return writemode; } + bool isInReadMode() const noexcept { return !writemode; } + bool isCoordinateSet(int coordinates[], int numCoordinates) const noexcept; + bool isOpen() const noexcept { return !datachunks.empty() && activechunk; } + +private: + //============================================================================================================================ + // Internal methods + //============================================================================================================================ + void switchDataChunk(std::uint32_t chunkind); + void validateDataChunk(std::uint32_t chunkind, bool index); + void selectImage(const std::vector& coord); + void advanceImage(); + std::uint32_t getChunkImageCount() const noexcept; + void calcImageIndex(const std::vector& coord, std::uint32_t& chunkind, std::uint32_t& imgind) const; + void resetAxisInfo() noexcept; + void parseAxisInfo(); + void writeAxisInfo() const noexcept; + +private: + //============================================================================================================================ + // Data members - Dataset properties + //============================================================================================================================ + std::string dspath; ///< Dataset (directory) path + std::string dsname; ///< Dataset name + std::string datasetuid; ///< Dataset UID + std::vector shape; ///< Dataset shape (dimension / axis sizes) + std::vector datachunks; ///< Data chunks / File stream descriptors + G2SFileStreamHandle activechunk; ///< Active data chunk + std::vector metadata; ///< Dataset metdata (cache) + std::vector axisinfo; ///< Dataset axis descriptors + std::uint32_t imgcounter; ///< Image counter + std::uint32_t flushcnt; ///< Image flush cycles + std::uint32_t chunksize; ///< Chunk size + std::uint8_t bitdepth; ///< Bit depth + std::uint8_t samples; ///< Samples per pixel + bool directIo; ///< Use direct I/O for file operations + bool bigTiff; ///< Use big TIFF format + bool writemode; ///< Is dataset opened for writing +}; + diff --git a/DeviceAdapters/go2scope/G2SBigTiffStorage.cpp b/DeviceAdapters/go2scope/G2SBigTiffStorage.cpp new file mode 100644 index 000000000..07176df25 --- /dev/null +++ b/DeviceAdapters/go2scope/G2SBigTiffStorage.cpp @@ -0,0 +1,1109 @@ +/////////////////////////////////////////////////////////////////////////////// +// FILE: G2SBigTiffStorage.cpp +// PROJECT: Micro-Manager +// SUBSYSTEM: DeviceAdapters +//----------------------------------------------------------------------------- +// DESCRIPTION: BIGTIFF storage device driver +// +// AUTHOR: Milos Jovanovic +// +// COPYRIGHT: Luminous Point LLC, Lumencor Inc., 2024 +// +// LICENSE: This file is distributed under the BSD license. +// License text is included with the source distribution. +// +// This file is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty +// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +// +// IN NO EVENT SHALL THE COPYRIGHT OWNER OR +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES. +// +/////////////////////////////////////////////////////////////////////////////// +#include +#include +#include +#include +#include +#include "G2SBigTiffStorage.h" + +#define MAX_FILE_SEARCH_INDEX 128 +#define PROP_DIRECTIO "DirectIO" +#define PROP_FLUSHCYCLE "FlushCycle" +#define PROP_CHUNKSIZE "ChunkSize" + +/** + * Default class constructor + */ +G2SBigTiffStorage::G2SBigTiffStorage() : initialized(false) +{ + supportedFormats = { "g2s" }; + + InitializeDefaultErrorMessages(); + + // set device specific error messages + SetErrorText(ERR_INTERNAL, "Internal driver error, see log file for details"); + SetErrorText(ERR_TIFF, "Generic TIFF error. See log for more info."); + SetErrorText(ERR_TIFF_STREAM_UNAVAILABLE, "BigTIFF storage error. File stream is not available."); + SetErrorText(ERR_TIFF_INVALID_PATH, "Invalid path or name."); + SetErrorText(ERR_TIFF_INVALID_DIMENSIONS, "Invalid number of dimensions. Minimum is 3."); + SetErrorText(ERR_TIFF_INVALID_PIXEL_TYPE, "Invalid or unsupported pixel type."); + SetErrorText(ERR_TIFF_OPEN_FAILED, "Failed opening TIF file."); + SetErrorText(ERR_TIFF_HANDLE_INVALID, "Dataset handle is not valid."); + SetErrorText(ERR_TIFF_STRING_TOO_LONG, "Requested string is too long for the provided buffer."); + SetErrorText(ERR_TIFF_INVALID_COORDINATE, "Dataset coordinates are valid."); + SetErrorText(ERR_TIFF_DATASET_CLOSED, "Operation unavailable - dataset is closed."); + SetErrorText(ERR_TIFF_DATASET_READONLY, "Operation unavailable - dataset is read-only."); + SetErrorText(ERR_TIFF_DELETE_FAILED, "File / folder delete failed."); + SetErrorText(ERR_TIFF_ALLOCATION_FAILED, "Dataset memory allocation failed."); + + // create pre-initialization properties + // ------------------------------------ + // + + // Name + CreateProperty(MM::g_Keyword_Name, g_BigTiffStorage, MM::String, true); + // + // Description + std::ostringstream os; + os << "BigTIFF Storage " << G2STIFF_VERSION; + CreateProperty(MM::g_Keyword_Description, os.str().c_str(), MM::String, true); +} + +/** + * Get device name + * @param Name String buffer [out] + */ +void G2SBigTiffStorage::GetName(char* Name) const +{ + CDeviceUtils::CopyLimitedString(Name, g_BigTiffStorage); +} + +/** + * Device driver initialization routine + */ +int G2SBigTiffStorage::Initialize() +{ + if(initialized) + return DEVICE_OK; + + // Add DirectIO property + int nRet = CreateIntegerProperty(PROP_DIRECTIO, 0, false); + assert(nRet == DEVICE_OK); + AddAllowedValue(PROP_DIRECTIO,"0"); + AddAllowedValue(PROP_DIRECTIO,"1"); + + // Add flush counter property + nRet = CreateIntegerProperty(PROP_FLUSHCYCLE, 0, false); + assert(nRet == DEVICE_OK); + + // Add chunk size property + nRet = CreateIntegerProperty(PROP_CHUNKSIZE, 0, false); + assert(nRet == DEVICE_OK); + + UpdateStatus(); + + initialized = true; + return DEVICE_OK; +} + +/** + * Device driver shutdown routine + * During device shutdown cache will be emptied, + * and all open file handles will be closed + */ +int G2SBigTiffStorage::Shutdown() +{ + initialized = false; + for(auto it = cache.begin(); it != cache.end(); it++) + { + if(it->second.isOpen()) + { + auto fs = reinterpret_cast(it->second.FileHandle); + fs->close(); + it->second.close(); + delete fs; + } + } + cache.clear(); + return DEVICE_OK; +} + +/** + * Create storage entry + * Dataset storage descriptor will open a file handle, to close a file handle call Close() + * Dataset storage descriptor will reside in device driver cache + * If the file already exists this method will fail with 'DEVICE_DUPLICATE_PROPERTY' status code + * @param path Absolute file path (TIFF file) + * @param name Dataset name + * @param numberOfDimensions Number of dimensions + * @param shape Axis sizes + * @param pixType Pixel format + * @param meta Metadata + * @param handle Entry GUID [out] + * @return Status code + */ +int G2SBigTiffStorage::Create(const char* path, const char* name, int numberOfDimensions, const int shape[], MM::StorageDataType pixType, const char* meta, char* handle) +{ + if(path == nullptr) + return ERR_TIFF_INVALID_PATH; + if(numberOfDimensions < 3) + return ERR_TIFF_INVALID_DIMENSIONS; + if(!(pixType == MM::StorageDataType::StorageDataType_GRAY16 || pixType == MM::StorageDataType::StorageDataType_GRAY8 || pixType == MM::StorageDataType::StorageDataType_RGB32)) + return ERR_TIFF_INVALID_PIXEL_TYPE; + + // Check cache size limits + if(cache.size() >= MAX_CACHE_SIZE) + { + cacheReduce(); + if(CACHE_HARD_LIMIT && cache.size() >= MAX_CACHE_SIZE) + return ERR_TIFF_CACHE_OVERFLOW; + } + + // Compose dataset path + std::string dsname(name); + if(dsname.find(".tiff") == dsname.size() - 5) + dsname = dsname.substr(0, dsname.size() - 5); + else if(dsname.find(".tif") == dsname.size() - 4 || dsname.find(".tf8") == dsname.size() - 4) + dsname = dsname.substr(0, dsname.size() - 4); + if(dsname.find(".g2s") != dsname.size() - 4) + dsname += ".g2s"; + std::filesystem::path saveRoot = std::filesystem::u8path(path); + std::filesystem::path dsName = saveRoot / dsname; + + // Create dataset storage descriptor + std::string guid = boost::lexical_cast(boost::uuids::random_generator()()); // Entry UUID + if(guid.size() > MM::MaxStrLength) + { +#ifdef _NDEBUG + guid = guid.substr(0, MM::MaxStrLength); +#else + assert("Dataset handle size is too long"); +#endif + } + + // Create a file on disk and store the file handle + auto fhandle = new G2SBigTiffDataset(); + if(fhandle == nullptr) + { + LogMessage("Error obtaining file handle for: " + dsName.u8string()); + return ERR_TIFF_STREAM_UNAVAILABLE; + } + + try + { + fhandle->create(dsName.u8string(), getDirectIO(), true, (std::uint32_t)getChunkSize()); + if(!fhandle->isOpen()) + { + LogMessage("Failed to open file: " + dsName.u8string()); + return ERR_TIFF_OPEN_FAILED; + } + fhandle->setFlushCycles((std::uint32_t)getFlushCycle()); + } + catch(std::exception& err) + { + delete fhandle; + LogMessage(std::string(err.what()) + " for " + dsName.u8string()); + return ERR_TIFF_OPEN_FAILED; + } + + G2SStorageEntry sdesc(fhandle->getPath(), numberOfDimensions); + sdesc.FileHandle = fhandle; + + // Set dataset UUID / shape / metadata + std::vector vshape; + vshape.assign(shape, shape + numberOfDimensions); + fhandle->setUID(guid); + fhandle->setShape(vshape); + fhandle->setMetadata(meta); + + // Set pixel format + if(pixType == MM::StorageDataType::StorageDataType_GRAY8) + fhandle->setPixelFormat(8, 1); + else if(pixType == MM::StorageDataType::StorageDataType_GRAY16) + fhandle->setPixelFormat(16, 1); + else if(pixType == MM::StorageDataType::StorageDataType_RGB32) + fhandle->setPixelFormat(8, 4); + + // Append dataset storage descriptor to cache + auto it = cache.insert(std::make_pair(guid, sdesc)); + if(it.first == cache.end()) + { + delete fhandle; + LogMessage("Adding BigTIFF dataset to cache failed. Path: " + dsName.u8string() + ", GUID: " + guid); + return ERR_TIFF_CACHE_INSERT; + } + if(!it.second) + { + // Dataset already exists + delete fhandle; + LogMessage("Adding BigTIFF dataset to cache failed. Path: " + dsName.u8string() + ", GUID: " + guid); + return ERR_TIFF_CACHE_INSERT; + } + + // Copy UUID string to the GUID buffer + strncpy(handle, guid.c_str(), MM::MaxStrLength); + return DEVICE_OK; +} + +/** + * Load dataset from disk + * Dataset storage descriptor will be read from file + * Dataset storage descriptor will open a file handle, to close a file handle call Close() + * Dataset storage descriptor will reside in device driver cache + * @param path Absolute file path (TIFF file) / Absolute dataset folder path + * @param name Dataset name + * @param handle Entry GUID [out] + * @return Status code + */ +int G2SBigTiffStorage::Load(const char* path, char* handle) +{ + if(path == nullptr) + return DEVICE_INVALID_INPUT_PARAM; + + // Check if the file exists + std::filesystem::path actpath = std::filesystem::u8path(path); + if(!std::filesystem::exists(actpath)) + { + // Try finding the folder by adding the index (number suffix) + bool fnd = false; + auto dir = actpath.parent_path(); + auto fname = actpath.stem().u8string(); + auto ext = actpath.extension().u8string(); + for(int i = 0; i < MAX_FILE_SEARCH_INDEX; i++) + { + actpath = dir / (fname + "_" + std::to_string(i) + ext); + if(std::filesystem::exists(actpath)) + { + fnd = true; + break; + } + } + if(!fnd) + return ERR_TIFF_INVALID_PATH; + } + else if(std::filesystem::is_regular_file(actpath)) + { + // File path of the first data chunk is specified -> use parent folder path + actpath = actpath.parent_path(); + } + + // Check if file is already in cache + auto cit = cache.begin(); + while(cit != cache.end()) + { + if(std::filesystem::u8path(cit->second.Path) == actpath) + break; + cit++; + } + + G2SBigTiffDataset* fhandle = nullptr; + if(cit == cache.end()) + // Open a file on disk and store the file handle + fhandle = new G2SBigTiffDataset(); + else if(cit->second.FileHandle == nullptr) + { + // Open a file on disk and update the cache file handle + fhandle = new G2SBigTiffDataset(); + cit->second.FileHandle = fhandle; + } + else + // Use existing object descriptor + fhandle = (G2SBigTiffDataset*)cit->second.FileHandle; + if(fhandle == nullptr) + { + LogMessage("Loading BigTIFF dataset failed (" + actpath.u8string() + "). Dataset allocation failed"); + return ERR_TIFF_ALLOCATION_FAILED; + } + + try + { + if(!fhandle->isOpen()) + { + fhandle->load(std::filesystem::absolute(actpath).u8string(), getDirectIO()); + if(!fhandle->isOpen()) + return ERR_TIFF_OPEN_FAILED; + } + fhandle->setFlushCycles((std::uint32_t)getFlushCycle()); + } + catch(std::exception& e) + { + delete fhandle; + LogMessage("Loading BigTIFF dataset failed (" + actpath.u8string() + "). " + std::string(e.what())); + return ERR_TIFF_OPEN_FAILED; + } + + // Obtain / generate dataset UID + std::string guid = fhandle->getUID().empty() ? boost::lexical_cast(boost::uuids::random_generator()()) : fhandle->getUID(); + if(guid.size() > MM::MaxStrLength) + { + delete fhandle; + return ERR_TIFF_STRING_TOO_LONG; + } + + // Append dataset storage descriptor to cache + if(cit == cache.end()) + { + // Create dataset storage descriptor + G2SStorageEntry sdesc(std::filesystem::absolute(actpath).u8string(), (int)fhandle->getDimension()); + sdesc.FileHandle = fhandle; + + auto it = cache.insert(std::make_pair(guid, sdesc)); + if(it.first == cache.end()) + { + delete fhandle; + LogMessage("Loading BigTIFF dataset failed (" + actpath.u8string() + "). Dataset cache is full"); + return DEVICE_OUT_OF_MEMORY; + } + } + + // Copy UUID string to the GUID buffer + strncpy(handle, guid.c_str(), MM::MaxStrLength); + return DEVICE_OK; +} + +/** + * Get dataset shape + * Shape contains image width and height as first two dimensions + * @param handle Entry GUID + * @param shape Dataset shape [out] + * @return Status code + */ +int G2SBigTiffStorage::GetShape(const char* handle, int shape[]) +{ + if(handle == nullptr || shape == nullptr) + return DEVICE_INVALID_INPUT_PARAM; + + // Obtain dataset descriptor from cache + auto it = cache.find(handle); + if(it == cache.end()) + return ERR_TIFF_HANDLE_INVALID; + + auto fs = reinterpret_cast(it->second.FileHandle); + for(std::size_t i = 0; i < fs->getDimension(); i++) + shape[i] = fs->getShape()[i]; + return DEVICE_OK; +} + +/** + * Get dataset pixel format + * @param handle Entry GUID + * @param pixelDataType Pixel format [out] + * @return Status code + */ +int G2SBigTiffStorage::GetDataType(const char* handle, MM::StorageDataType& pixelDataType) +{ + if(handle == nullptr) + return DEVICE_INVALID_INPUT_PARAM; + + // Obtain dataset descriptor from cache + auto it = cache.find(handle); + if(it == cache.end()) + return ERR_TIFF_HANDLE_INVALID; + + // Get pixel format + if(!it->second.isOpen()) + pixelDataType = MM::StorageDataType_UNKNOWN; + else + { + auto fs = reinterpret_cast(it->second.FileHandle); + switch(fs->getBpp()) + { + case 1: + pixelDataType = MM::StorageDataType_GRAY8; + break; + case 2: + pixelDataType = MM::StorageDataType_GRAY16; + break; + case 3: + case 4: + pixelDataType = MM::StorageDataType_RGB32; + break; + default: + pixelDataType = MM::StorageDataType_UNKNOWN; + break; + } + } + return DEVICE_OK; +} + +/** + * Close the dataset + * File handle will be closed + * Metadata will be discarded + * Storage entry descriptor will remain in cache + * @param handle Entry GUID + * @return Status code + */ +int G2SBigTiffStorage::Close(const char* handle) +{ + auto it = cache.find(handle); + if(it == cache.end()) + return ERR_TIFF_HANDLE_INVALID; + if(it->second.isOpen()) + { + auto fs = reinterpret_cast(it->second.FileHandle); + fs->close(); + it->second.close(); + delete fs; + } + return DEVICE_OK; +} + +/** + * Delete existing dataset (file on disk) + * If the file doesn't exist this method will return 'DEVICE_NO_PROPERTY_DATA' status code + * Dataset storage descriptor will be removed from cache + * @param handle Entry GUID + * @return Status code + */ +int G2SBigTiffStorage::Delete(char* handle) +{ + if(handle == nullptr) + return DEVICE_INVALID_INPUT_PARAM; + auto it = cache.find(handle); + if(it == cache.end()) + return ERR_TIFF_HANDLE_INVALID; + + // Check if the file exists + auto fp = std::filesystem::u8path(it->second.Path); + if(!std::filesystem::exists(fp)) + return ERR_TIFF_INVALID_PATH; + + // Close the file handle + if(it->second.isOpen()) + { + auto fs = reinterpret_cast(it->second.FileHandle); + fs->close(); + it->second.close(); + delete fs; + } + + // Delete the file + if(!std::filesystem::remove(fp)) + return ERR_TIFF_DELETE_FAILED; + + // Discard the cache entry + cache.erase(it); + return DEVICE_OK; +} + +/** + * List datasets in the specified folder / path + * If the list of found datasets is longer than 'maxItems' only first [maxItems] will be + * returned and 'DEVICE_SEQUENCE_TOO_LARGE' status code will be returned + * If the dataset path is longer than 'maxItemLength' dataset path will be truncated + * If the specified path doesn't exist, or it's not a valid folder path 'DEVICE_INVALID_INPUT_PARAM' status code will be returned + * @param path Folder path + * @param listOfDatasets Dataset path list [out] + * @param maxItems Max dataset count + * @param maxItemLength Max dataset path length + * @return Status code + */ +int G2SBigTiffStorage::List(const char* path, char** listOfDatasets, int maxItems, int maxItemLength) +{ + if(path == nullptr || listOfDatasets == nullptr || maxItems <= 0 || maxItemLength <= 0) + return DEVICE_INVALID_INPUT_PARAM; + auto dp = std::filesystem::u8path(path); + if(!std::filesystem::exists(dp) || !std::filesystem::is_directory(dp)) + return ERR_TIFF_INVALID_PATH; + auto allfnd = scanDir(path, listOfDatasets, maxItems, maxItemLength, 0); + return allfnd ? DEVICE_OK : ERR_TIFF_STRING_TOO_LONG; +} + +/** + * Add image / write image to file + * Image metadata will be stored in cache + * @param handle Entry GUID + * @param pixels Pixel data buffer + * @param sizeInBytes pixel array size + * @param coordinates Image coordinates + * @param numCoordinates Coordinate count + * @param imageMeta Image metadata + * @return Status code + */ +int G2SBigTiffStorage::AddImage(const char* handle, int sizeInBytes, unsigned char* pixels, int coordinates[], int numCoordinates, const char* imageMeta) +{ + if(handle == nullptr || pixels == nullptr || sizeInBytes <= 0 || numCoordinates <= 0) + return DEVICE_INVALID_INPUT_PARAM; + + // Obtain dataset descriptor from cache + auto it = cache.find(handle); + if(it == cache.end()) + return ERR_TIFF_HANDLE_INVALID; + if(!it->second.isOpen()) + return ERR_TIFF_DATASET_CLOSED; + + // Validate image dimensions / coordinates + auto fs = reinterpret_cast(it->second.FileHandle); + if(fs->isInReadMode()) + return ERR_TIFF_DATASET_READONLY; + if(!validateCoordinates(fs, coordinates, numCoordinates)) + return ERR_TIFF_INVALID_COORDINATE; + if(fs->isCoordinateSet(coordinates, numCoordinates)) + return ERR_TIFF_INVALID_COORDINATE; + + // Add image + fs->addImage(pixels, sizeInBytes, imageMeta); + return DEVICE_OK; +} + +/** + * Append image / write image to file + * Image metadata will be stored in cache + * @param handle Entry GUID + * @param pixels Pixel data buffer + * @param sizeInBytes pixel array size + * @param imageMeta Image metadata + * @return Status code + */ +int G2SBigTiffStorage::AppendImage(const char* handle, int sizeInBytes, unsigned char* pixels, const char* imageMeta) +{ + if(handle == nullptr || pixels == nullptr || sizeInBytes <= 0) + return DEVICE_INVALID_INPUT_PARAM; + + // Obtain dataset descriptor from cache + auto it = cache.find(handle); + if(it == cache.end()) + return ERR_TIFF_HANDLE_INVALID; + if(!it->second.isOpen()) + return ERR_TIFF_DATASET_CLOSED; + + // Append image + auto fs = reinterpret_cast(it->second.FileHandle); + if(fs->isInReadMode()) + return ERR_TIFF_DATASET_READONLY; + fs->addImage(pixels, sizeInBytes, imageMeta); + return DEVICE_OK; +} + +/** + * Get dataset summary metadata + * If the netadata size is longer than the provided buffer, only the first [bufSize] bytes will be + * copied, and the status code 'DEVICE_SEQUENCE_TOO_LARGE' will be returned + * @param handle Entry GUID + * @param meta Metadata buffer [out] + * @param bufSize Buffer size + * @return Status code + */ +int G2SBigTiffStorage::GetSummaryMeta(const char* handle, char* meta, int bufSize) +{ + if(handle == nullptr || meta == nullptr || bufSize <= 0) + return DEVICE_INVALID_INPUT_PARAM; + + // Obtain dataset descriptor from cache + auto it = cache.find(handle); + if(it == cache.end()) + return ERR_TIFF_HANDLE_INVALID; + + if(!it->second.isOpen()) + return ERR_TIFF_DATASET_CLOSED; + + // Copy metadata string + auto fs = reinterpret_cast(it->second.FileHandle); + strncpy(meta, fs->getMetadata().c_str(), bufSize); + return fs->getMetadata().size() > (std::size_t)bufSize ? ERR_TIFF_STRING_TOO_LONG : DEVICE_OK; +} + +/** + * Get dataset image metadata + * If the netadata size is longer than the provided buffer, only the first [bufSize] bytes will be + * copied, and the status code 'DEVICE_SEQUENCE_TOO_LARGE' will be returned + * @param handle Entry GUID + * @param coordinates Image coordinates + * @param numCoordinates Coordinate count + * @param meta Metadata buffer [out] + * @param bufSize Buffer size + * @return Status code + */ +int G2SBigTiffStorage::GetImageMeta(const char* handle, int coordinates[], int numCoordinates, char* meta, int bufSize) +{ + if(handle == nullptr || coordinates == nullptr || numCoordinates == 0 || meta == nullptr || bufSize <= 0) + return DEVICE_INVALID_INPUT_PARAM; + + // Obtain dataset descriptor from cache + auto it = cache.find(handle); + if(it == cache.end()) + return ERR_TIFF_HANDLE_INVALID; + + auto fs = reinterpret_cast(it->second.FileHandle); + if(!validateCoordinates(fs, coordinates, numCoordinates)) + return ERR_TIFF_INVALID_COORDINATE; + + // Obtain metadata from the file stream + if(!it->second.isOpen()) + return ERR_TIFF_DATASET_CLOSED; + + // Copy coordinates without including the width and height + std::vector coords(fs->getDimension() - 2); + for(int i = 0; i < coords.size(); i++) + { + if(i >= numCoordinates) + break; + coords[i] = coordinates[i]; + } + + auto fmeta = fs->getImageMetadata(coords); + if(!fmeta.empty()) + strncpy(meta, fmeta.c_str(), bufSize); + return DEVICE_OK; +} + +/** + * Get image / pixel data + * Image buffer will be created inside this method, so + * object (buffer) destruction becomes callers responsibility + * @param handle Entry GUID + * @param coordinates Image coordinates + * @param numCoordinates Coordinate count + * @return Pixel buffer pointer + */ +const unsigned char* G2SBigTiffStorage::GetImage(const char* handle, int coordinates[], int numCoordinates) +{ + try { + if (handle == nullptr || numCoordinates <= 0) + return nullptr; + + // Obtain dataset descriptor from cache + auto it = cache.find(handle); + if (it == cache.end()) + return nullptr; + + auto fs = reinterpret_cast(it->second.FileHandle); + if (!validateCoordinates(fs, coordinates, numCoordinates)) + return nullptr; + + if (!it->second.isOpen()) + return nullptr; + + // Copy coordinates without including the width and height + std::vector coords(fs->getDimension() - 2); + for (int i = 0; i < coords.size(); i++) + { + if (i >= numCoordinates) + break; + coords[i] = coordinates[i]; + } + + it->second.ImageData = fs->getImage(coords); + return &it->second.ImageData[0]; + } + catch (std::runtime_error& e) + { + LogMessage("GetImage error: " +std::string(e.what())); + return nullptr; + } +} + +/** + * Configure metadata for a given dimension + * @param handle Entry GUID + * @param dimension Dimension index + * @param name Name of the dimension + * @param meaning Z,T,C, etc. (physical meaning) + * @return Status code + */ +int G2SBigTiffStorage::ConfigureDimension(const char* handle, int dimension, const char* name, const char* meaning) +{ + if(handle == nullptr || dimension < 0) + return DEVICE_INVALID_INPUT_PARAM; + auto it = cache.find(handle); + if(it == cache.end()) + return ERR_TIFF_HANDLE_INVALID; + if(!it->second.isOpen()) + return ERR_TIFF_DATASET_CLOSED; + auto fs = reinterpret_cast(it->second.FileHandle); + if(fs->isInReadMode()) + return ERR_TIFF_DATASET_READONLY; + + if((std::size_t)dimension >= fs->getDimension()) + return ERR_TIFF_INVALID_DIMENSIONS; + fs->configureAxis(dimension, std::string(name), std::string(meaning)); + return DEVICE_OK; +} + +/** + * Configure a particular coordinate name. e.g. channel name / position name ... + * @param handle Entry GUID + * @param dimension Dimension index + * @param coordinate Coordinate index + * @param name Coordinate name + * @return Status code + */ +int G2SBigTiffStorage::ConfigureCoordinate(const char* handle, int dimension, int coordinate, const char* name) +{ + if(handle == nullptr || dimension < 0 || coordinate < 0) + return DEVICE_INVALID_INPUT_PARAM; + auto it = cache.find(handle); + if(it == cache.end()) + return ERR_TIFF_HANDLE_INVALID; + if(!it->second.isOpen()) + return ERR_TIFF_DATASET_CLOSED; + auto fs = reinterpret_cast(it->second.FileHandle); + if(fs->isInReadMode()) + return ERR_TIFF_DATASET_READONLY; + + if(dimension < 0 || (std::size_t)dimension >= fs->getDimension()) + return ERR_TIFF_INVALID_DIMENSIONS; + if(coordinate < 0 || (std::size_t)coordinate >= fs->getShape()[dimension]) + return ERR_TIFF_INVALID_COORDINATE; + fs->configureCoordinate(dimension, coordinate, std::string(name)); + return DEVICE_OK; +} + +/** + * Get number of dimensions + * @param handle Entry GUID + * @param numDimensions Number of dimensions [out] + * @return Status code + */ +int G2SBigTiffStorage::GetNumberOfDimensions(const char* handle, int& numDimensions) +{ + if(handle == nullptr) + return DEVICE_INVALID_INPUT_PARAM; + auto it = cache.find(handle); + if(it == cache.end()) + return ERR_TIFF_HANDLE_INVALID; + if(!it->second.isOpen()) + return ERR_TIFF_DATASET_CLOSED; + + auto fs = reinterpret_cast(it->second.FileHandle); + numDimensions = (int)fs->getDimension(); + return DEVICE_OK; +} + +/** + * Get number of dimensions + * @param handle Entry GUID + * @return Status code + */ +int G2SBigTiffStorage::GetDimension(const char* handle, int dimension, char* name, int nameLength, char* meaning, int meaningLength) +{ + if(handle == nullptr || dimension < 0 || meaningLength <= 0) + return DEVICE_INVALID_INPUT_PARAM; + auto it = cache.find(handle); + if(it == cache.end()) + return ERR_TIFF_HANDLE_INVALID; + if(!it->second.isOpen()) + return ERR_TIFF_DATASET_CLOSED; + auto fs = reinterpret_cast(it->second.FileHandle); + + if(dimension < 0 || (std::size_t)dimension >= fs->getDimension()) + return ERR_TIFF_INVALID_DIMENSIONS; + + const auto& axinf = fs->getAxisInfo((std::uint32_t)dimension); + if(axinf.Name.size() > (std::size_t)nameLength) + return ERR_TIFF_STRING_TOO_LONG; + if(axinf.Description.size() > (std::size_t)meaningLength) + return ERR_TIFF_STRING_TOO_LONG; + strncpy(name, axinf.Name.c_str(), nameLength); + strncpy(meaning, axinf.Description.c_str(), meaningLength); + return DEVICE_OK; +} + +/** + * Get number of dimensions + * @param handle Entry GUID + * @return Status code + */ +int G2SBigTiffStorage::GetCoordinate(const char* handle, int dimension, int coordinate, char* name, int nameLength) +{ + if(handle == nullptr || dimension < 0 || coordinate < 0 || nameLength <= 0) + return DEVICE_INVALID_INPUT_PARAM; + auto it = cache.find(handle); + if(it == cache.end()) + return ERR_TIFF_HANDLE_INVALID; + if(!it->second.isOpen()) + return ERR_TIFF_DATASET_CLOSED; + auto fs = reinterpret_cast(it->second.FileHandle); + + if(dimension < 0 || (std::size_t)dimension >= fs->getDimension()) + return ERR_TIFF_INVALID_DIMENSIONS; + if(coordinate < 0 || (std::size_t)coordinate >= fs->getShape()[dimension]) + return ERR_TIFF_INVALID_COORDINATE; + + const auto& axinf = fs->getAxisInfo((std::uint32_t)dimension); + if((std::size_t)coordinate >= axinf.Coordinates.size()) + return ERR_TIFF_INVALID_COORDINATE; + if(axinf.Coordinates[coordinate].size() > (std::size_t)nameLength) + return ERR_TIFF_STRING_TOO_LONG; + strncpy(name, axinf.Coordinates[coordinate].c_str(), nameLength); + return DEVICE_OK; +} + +/** + * Get number of available images + * @param handle Entry GUID + * @param imgcount Image count [out] + * @return Status code + */ +int G2SBigTiffStorage::GetImageCount(const char* handle, int& imgcount) +{ + if(handle == nullptr) + return DEVICE_INVALID_INPUT_PARAM; + auto it = cache.find(handle); + if(it == cache.end()) + return ERR_TIFF_HANDLE_INVALID; + if(!it->second.isOpen()) + return ERR_TIFF_DATASET_CLOSED; + auto fs = reinterpret_cast(it->second.FileHandle); + imgcount = (int)fs->getImageCount(); + return DEVICE_OK; +} + +/** + * Check if dataset is open + * If the dataset doesn't exist, or the GUID is invalid this method will return false + * @param handle Entry GUID + * @return true if dataset is open + */ +bool G2SBigTiffStorage::IsOpen(const char* handle) +{ + if(handle == nullptr) + return false; + auto it = cache.find(handle); + if(it == cache.end()) + return false; + return it->second.isOpen(); +} + +/** + * Check if dataset is read-only + * If the dataset doesn't exist, or the GUID is invalid this method will return true + * @param handle Entry GUID + * @return true if images can't be added to the dataset + */ +bool G2SBigTiffStorage::IsReadOnly(const char* handle) +{ + if(handle == nullptr) + return true; + auto it = cache.find(handle); + if(it == cache.end()) + return true; + if(!it->second.isOpen()) + return true; + auto fs = reinterpret_cast(it->second.FileHandle); + return fs->isInReadMode(); +} + +/** + * Get dataset path + * @param handle Entry GUID + * @param path Dataset path [out] + * @param maxPathLength Max path length + * @return Status code + */ +int G2SBigTiffStorage::GetPath(const char* handle, char* path, int maxPathLength) +{ + if(handle == nullptr || maxPathLength <= 0) + return DEVICE_INVALID_INPUT_PARAM; + auto it = cache.find(handle); + if(it == cache.end()) + return ERR_TIFF_HANDLE_INVALID; + if(it->second.Path.size() > (std::size_t)maxPathLength) + return ERR_TIFF_STRING_TOO_LONG; + strncpy(path, it->second.Path.c_str(), it->second.Path.size()); + return DEVICE_OK; +} + +/** + * Check if there is a valid dataset on the selected path + * @param path Dataset path + * @return Path is a valid dataset + */ +bool G2SBigTiffStorage::CanLoad(const char* path) +{ + if(path == nullptr) + return false; + std::filesystem::path xpath = std::filesystem::u8path(path); + if(!std::filesystem::exists(xpath)) + return false; + + if(std::filesystem::is_directory(xpath)) + { + // If directory is selected check if it's not empty and if the name ends with .g2s + auto dname = xpath.filename().u8string(); + if(dname.find(".g2s") != dname.size() - 4) + return false; + + // Check for valid files + int validfiles = 0; + for(const auto& entry : std::filesystem::directory_iterator(xpath)) + { + // Skip auto folder paths + auto fname = entry.path().filename().u8string(); + if(fname == "." || fname == "..") + continue; + + // Skip folders + if(std::filesystem::is_directory(entry)) + continue; + + // Skip unsupported file formats + auto fext = entry.path().extension().u8string(); + if(fext.size() == 0) + continue; + if(fext[0] == '.') + fext = fext.substr(1); + std::transform(fext.begin(), fext.end(), fext.begin(), [](char c) { return (char)tolower(c); }); + if(fext != "tiff" && fext != "tif" && fext != "g2s.tiff" && fext != "g2s.tif") + continue; + + // We found a supported file type -> Increment the counter + validfiles++; + } + return validfiles > 0; + } + else + { + // If file is selected check file extension + auto fext = xpath.extension().u8string(); + std::transform(fext.begin(), fext.end(), fext.begin(), [](char c) { return (char)tolower(c); }); + return fext == "tiff" || fext == "tif" || fext == "g2s.tiff" || fext == "g2s.tif"; + } +} + +/** + * Discard closed dataset storage descriptors from cache + * By default storage descriptors are preserved even after the dataset is closed + * To reclaim memory all closed descritors are evicted from cache + */ +void G2SBigTiffStorage::cacheReduce() noexcept +{ + for(auto it = cache.begin(); it != cache.end(); ) + { + if(!it->second.isOpen()) + it = cache.erase(it); + else + it++; + } +} + +/** + * Scan folder subtree for supported files + * @paramm path Folder path + * @param listOfDatasets Dataset path list [out] + * @param maxItems Max dataset count + * @param maxItemLength Max dataset path length + * @param cpos Current position in the list + * @return Was provided buffer large enough to store all dataset paths + */ +bool G2SBigTiffStorage::scanDir(const std::string& path, char** listOfDatasets, int maxItems, int maxItemLength, int cpos) noexcept +{ + try + { + auto dp = std::filesystem::u8path(path); + if(!std::filesystem::exists(dp)) + return true; + auto dit = std::filesystem::directory_iterator(dp); + if(!std::filesystem::is_directory(dp)) + return false; + for(const auto& entry : dit) + { + // Skip auto folder paths + auto fname = entry.path().filename().u8string(); + if(fname == "." || fname == "..") + continue; + + // Skip regular files + if(!std::filesystem::is_directory(entry)) + continue; + + // If the folder extension is invalid -> scan the subtree + auto abspath = std::filesystem::absolute(entry).u8string(); + auto fext = entry.path().extension().u8string(); + if(fext.size() == 0) + return scanDir(abspath, listOfDatasets, maxItems, maxItemLength, cpos); + if(fext[0] == '.') + fext = fext.substr(1); + std::transform(fext.begin(), fext.end(), fext.begin(), [](char c) { return (char)tolower(c); }); + if(std::find(supportedFormats.begin(), supportedFormats.end(), fext) == supportedFormats.end()) + return scanDir(abspath, listOfDatasets, maxItems, maxItemLength, cpos); + + // We found a supported dataset folder + // Check result buffer limit + if(cpos >= maxItems) + return false; + + // Add to results list + strncpy(listOfDatasets[cpos], abspath.c_str(), maxItemLength); + cpos++; + } + return true; + } + catch(std::filesystem::filesystem_error&) + { + return false; + } +} + +/** + * Validate image coordinates + * @param fs Dataset handle + * @param coordinates Image coordinates + * @param numCoordinates Coordinate count + * @return Are coordinates valid + */ +bool G2SBigTiffStorage::validateCoordinates(const G2SBigTiffDataset* fs, int coordinates[], int numCoordinates) noexcept +{ + if((std::size_t)numCoordinates != fs->getDimension() && (std::size_t)numCoordinates != fs->getDimension() - 2) + return false; + for(int i = 0; i < (int)fs->getDimension() - 2; i++) + { + if(coordinates[i] < 0 || coordinates[i] >= (int)fs->getShape()[i]) + return false; + } + return true; +} + +/** + * Get direct I/O property + * @return Is direct I/O enabled + */ +bool G2SBigTiffStorage::getDirectIO() const noexcept +{ + char buf[MM::MaxStrLength]; + int ret = GetProperty(PROP_DIRECTIO, buf); + if(ret != DEVICE_OK) + return false; + try + { + return std::atoi(buf) != 0; + } + catch(...) { return false; } +} + +/** + * Get flush cycle property + * @return Flush cycle count + */ +int G2SBigTiffStorage::getFlushCycle() const noexcept +{ + char buf[MM::MaxStrLength]; + int ret = GetProperty(PROP_FLUSHCYCLE, buf); + if(ret != DEVICE_OK) + return 0; + try + { + return std::atoi(buf); + } + catch(...) { return 0; } +} + +/** + * Get chunk size property + * @return Chunk size - number of slowest changing dimension coordinates in a single file + */ +int G2SBigTiffStorage::getChunkSize() const noexcept +{ + char buf[MM::MaxStrLength]; + int ret = GetProperty(PROP_CHUNKSIZE, buf); + if(ret != DEVICE_OK) + return 0; + try + { + return std::atoi(buf); + } + catch(...) { return 0; } +} diff --git a/DeviceAdapters/go2scope/G2SBigTiffStorage.h b/DeviceAdapters/go2scope/G2SBigTiffStorage.h new file mode 100644 index 000000000..ff5dc5311 --- /dev/null +++ b/DeviceAdapters/go2scope/G2SBigTiffStorage.h @@ -0,0 +1,99 @@ +/////////////////////////////////////////////////////////////////////////////// +// FILE: G2SBigTiffStorage.h +// PROJECT: Micro-Manager +// SUBSYSTEM: DeviceAdapters +//----------------------------------------------------------------------------- +// DESCRIPTION: Go2Scope devices. Includes the experimental StorageDevice +// +// AUTHOR: Milos Jovanovic +// +// COPYRIGHT: Nenad Amodaj, Chan Zuckerberg Initiative, 2024 +// +// LICENSE: This file is distributed under the BSD license. +// License text is included with the source distribution. +// +// This file is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty +// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +// +// IN NO EVENT SHALL THE COPYRIGHT OWNER OR +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES. +// +// NOTE: Storage Device development is supported in part by +// Chan Zuckerberg Initiative (CZI) +// +/////////////////////////////////////////////////////////////////////////////// +#pragma once +#include "G2SStorage.h" +#include "G2SBigTiffDataset.h" + +/** + * Storage writer driver for Go2Scope BigTIFF format + * @author Miloš Jovanović + * @version 1.0 + */ +class G2SBigTiffStorage : public CStorageBase +{ +public: + //========================================================================================================================= + // Constructors & destructors + //========================================================================================================================= + G2SBigTiffStorage(); + virtual ~G2SBigTiffStorage() noexcept { Shutdown(); } + +public: + //========================================================================================================================= + // Public interface - Device API + //========================================================================================================================= + int Initialize(); + int Shutdown(); + void GetName(char* pszName) const; + bool Busy() { return false; } + +public: + //========================================================================================================================= + // Public interface - Storage API + //========================================================================================================================= + int Create(const char* path, const char* name, int numberOfDimensions, const int shape[], MM::StorageDataType pixType, const char* meta, char* handle); + int ConfigureDimension(const char* handle, int dimension, const char* name, const char* meaning); + int ConfigureCoordinate(const char* handle, int dimension, int coordinate, const char* name); + int Close(const char* handle); + int Load(const char* path, char* handle); + int GetShape(const char* handle, int shape[]); + int GetDataType(const char* handle, MM::StorageDataType& pixelDataType); + int Delete(char* handle); + int List(const char* path, char** listOfDatasets, int maxItems, int maxItemLength); + int AddImage(const char* handle, int sizeInBytes, unsigned char* pixels, int coordinates[], int numCoordinates, const char* imageMeta); + int AppendImage(const char* handle, int sizeInBytes, unsigned char* pixels, const char* imageMeta); + int GetSummaryMeta(const char* handle, char* meta, int bufSize); + int GetImageMeta(const char* handle, int coordinates[], int numCoordinates, char* meta, int bufSize); + const unsigned char* GetImage(const char* handle, int coordinates[], int numCoordinates); + int GetNumberOfDimensions(const char* handle, int& numDimensions); + int GetDimension(const char* handle, int dimension, char* name, int nameLength, char* meaning, int meaningLength); + int GetCoordinate(const char* handle, int dimension, int coordinate, char* name, int nameLength); + int GetImageCount(const char* handle, int& imgcnt); + bool IsOpen(const char* handle); + bool IsReadOnly(const char* handle); + int GetPath(const char* handle, char* path, int maxPathLength); + bool CanLoad(const char* path); + +protected: + //========================================================================================================================= + // Internal methods + //========================================================================================================================= + void cacheReduce() noexcept; + bool scanDir(const std::string& path, char** listOfDatasets, int maxItems, int maxItemLength, int cpos) noexcept; + bool validateCoordinates(const G2SBigTiffDataset* fs, int coordinates[], int numCoordinates) noexcept; + bool getDirectIO() const noexcept; + int getFlushCycle() const noexcept; + int getChunkSize() const noexcept; + +private: + //========================================================================================================================= + // Data members + //========================================================================================================================= + std::map cache; ///< Storage entries cache + std::vector supportedFormats; ///< Supported file formats + bool initialized; ///< Is driver initialized +}; diff --git a/DeviceAdapters/go2scope/G2SBigTiffStream.cpp b/DeviceAdapters/go2scope/G2SBigTiffStream.cpp new file mode 100644 index 000000000..33c9776d5 --- /dev/null +++ b/DeviceAdapters/go2scope/G2SBigTiffStream.cpp @@ -0,0 +1,1209 @@ +/////////////////////////////////////////////////////////////////////////////// +// FILE: G2SBigTiffStream.cpp +// PROJECT: Micro-Manager +// SUBSYSTEM: DeviceAdapters +//----------------------------------------------------------------------------- +// DESCRIPTION: Go2Scope devices. Includes the experimental StorageDevice +// +// AUTHOR: Milos Jovanovic +// +// COPYRIGHT: Nenad Amodaj, Chan Zuckerberg Initiative, 2024 +// +// LICENSE: This file is distributed under the BSD license. +// License text is included with the source distribution. +// +// This file is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty +// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +// +// IN NO EVENT SHALL THE COPYRIGHT OWNER OR +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES. +// +// NOTE: Storage Device development is supported in part by +// Chan Zuckerberg Initiative (CZI) +// +/////////////////////////////////////////////////////////////////////////////// +#define _LARGEFILE64_SOURCE +#include +#include +#include +#include "G2SBigTiffStream.h" +#ifdef _WIN32 +#include +#else +#include +#include +#include +#include +#endif + +/** + * Class constructor + * Constructor doesn't open the file, just creates an object set sets the configuration + * @param path File path + * @param dio Use direct I/O + * @param fbig Use BigTIFF format + * @param chunk Chunk index + */ +G2SBigTiffStream::G2SBigTiffStream(const std::string& path, bool dio, bool fbig, std::uint32_t chunk) noexcept +{ + currpos = 0; + writepos = 0; + readpos = 0; + lastifdpos = 0; + lastifdsize = 0; + currentifdpos = 0; + currentifdsize = 0; + nextifdpos = 0; + readbuffoff = 0; + imgcounter = 0; + currentimage = 0; + chunkindex = chunk; +#ifdef _WIN32 + fhandle = nullptr; +#else + fhandle = 0; +#endif + fpath = path; + directIo = dio; + bigTiff = fbig; + ssize = 0; +} + +/** + * Open / create a file + * File path is optional (if it's already been set) + * If the file doesn't exist it will be created (write mode) + * If the file exists and 'trunc' is set to true existing file will be discared and new one will be created (write mode) + * If the file exists and 'trunc' is set to false dataset shape, pixel format and metadata will be parsed (read / append mode) + * @param trunc Trucate existing file + * @param index Index IFDs + * @throws std::runtime_error + */ +void G2SBigTiffStream::open(bool trunc) +{ + if(isOpen()) + throw std::runtime_error("Invalid operation. File stream is already open"); + if(fpath.empty()) + throw std::runtime_error("Unable to open a file stream. File path is undefined"); + auto fexists = std::filesystem::exists(std::filesystem::u8path(fpath)); + auto xpath = std::filesystem::u8path(fpath); + + // Obtain a file handle +#ifdef _WIN32 + // Convert file path + int slength = (int)fpath.length() + 1; + int len = MultiByteToWideChar(CP_UTF8, 0, fpath.c_str(), slength, nullptr, 0); + wchar_t* buf = new wchar_t[len]; + MultiByteToWideChar(CP_UTF8, 0, fpath.c_str(), slength, buf, len); + + // Open a file + DWORD cattr = trunc ? CREATE_ALWAYS : OPEN_ALWAYS; + DWORD fattr = directIo ? FILE_FLAG_WRITE_THROUGH | FILE_FLAG_NO_BUFFERING : 0; + fhandle = CreateFile(buf, GENERIC_WRITE | GENERIC_READ, 0, NULL, cattr, FILE_ATTRIBUTE_NORMAL | fattr, NULL); + if(fhandle == INVALID_HANDLE_VALUE) + { + delete[] buf; + fhandle = nullptr; + throw std::runtime_error("File '" + fpath + "' open failed, error code " + std::to_string(GetLastError())); + } + delete[] buf; +#else + int flags = O_LARGEFILE | O_RDWR | O_SYNC | (trunc ? O_CREAT | O_TRUNC : 0) | (directIo ? O_DIRECT : 0); + fhandle = ::open(fpath.c_str(), flags); + if(fhandle < 0) + { + fhandle = 0; + throw std::runtime_error("File '" + fpath + "' open failed, error code " + std::to_string(errno)); + } +#endif + + // Obtain a block size + if(ssize == 0) + { +#ifdef _WIN32 + auto apath = std::filesystem::absolute(xpath); + auto dsepind = apath.u8string().find_first_of('\\'); + auto drivepath = dsepind == std::string::npos ? apath.u8string() : apath.u8string().substr(0, dsepind + 1); + slength = (int)drivepath.length() + 1; + len = MultiByteToWideChar(CP_UTF8, 0, drivepath.c_str(), slength, nullptr, 0); + wchar_t* dbuf = new wchar_t[len]; + MultiByteToWideChar(CP_UTF8, 0, drivepath.c_str(), slength, dbuf, len); + + GetDiskFreeSpace(dbuf, NULL, (LPDWORD)&ssize, NULL, NULL); + delete[] dbuf; +#elif __linux__ + size_t blockSize = 0; + ioctl(fhandle, BLKSSZGET, &blockSize); + ssize = (std::uint32_t)blockSize; +#elif __APPLE__ + size_t blockSize = 0; + ioctl(fhandle, DKIOCGETPHYSICALBLOCKSIZE, &blockSize); + ssize = (std::uint32_t)blockSize; +#endif + } + if(directIo) + writebuff.reserve(ssize); + + currpos = 0; + writepos = 0; + readpos = 0; + lastifdpos = 0; + lastifdsize = 0; + currentifdpos = 0; + currentifdsize = 0; + nextifdpos = 0; + currentimage = 0; + readbuffoff = 0; + header.clear(); + ifdcache.clear(); + + // If a new file is created or existing file was truncated -> Create file header + bool freshfile = !fexists || trunc; + if(freshfile) + formHeader(); + else + { + // We are in read mode -> Parse file header + header.resize(G2STIFF_HEADER_SIZE); + auto nb = fetch(&header[0], header.size()); + if(nb == 0) + // Empty file detected -> Create file header + formHeader(); + // To extract paramters from the header call parse() + } +} + +/** + * Close / commit a file stream + * If a file hasn't been open this method will have no effect + * File handle will be released / closed + * In the write / append mode during closing final section (dataset metadat) is commited to file + * File header is also updated with the offset of the final section + * File opened for writing, but without any images should be empty after closing + */ +void G2SBigTiffStream::close() noexcept +{ + if(!isOpen()) + return; + + if(writepos > 0 && lastifdsize > 0 && !lastifd.empty()) + { + // This section is skipped if file is empty, or no write operation has been peformed + std::uint64_t fsize = writepos; + try + { + // Reposition file cursor if last operation was a file read + if(writepos != currpos) + seek(writepos); + + // Commit last sector + if(directIo && !writebuff.empty()) + { + auto padsize = ssize - writebuff.size(); + std::vector pbuff(padsize); + commit(&pbuff[0], pbuff.size()); + } + fsize = writepos; + + // Clear last IFD chain offset + if(bigTiff) + writeInt(&lastifd[lastifdsize - 8], 8, 0); + else + writeInt(&lastifd[lastifdsize - 4], 4, 0); + seek(lastifdpos); + commit(&lastifd[0], lastifd.size()); + + // Update file header + // Set image count + writeInt(&header[bigTiff ? 48 : 36], 4, imgcounter); + seek(0); + commit(&header[0], header.size()); + + // Move cursor at the end of the file stream + seek(0, false); + } + catch(...) { } + + // Set actual file size limit for direct I/O + if(directIo) + { +#ifdef _WIN32 + FILE_END_OF_FILE_INFO inf = {}; + inf.EndOfFile.QuadPart = (LONGLONG)fsize; + SetFileInformationByHandle((HANDLE)fhandle, FileEndOfFileInfo, &inf, sizeof(inf)); +#else + // TODO +#endif + } + } + + // Close the file +#ifdef _WIN32 + CloseHandle((HANDLE)fhandle); + fhandle = nullptr; +#else + ::close(fhandle); + fhandle = 0; +#endif + imgcounter = 0; + currentimage = 0; + chunkindex = 0; + currpos = 0; + writepos = 0; + readpos = 0; + lastifdpos = 0; + lastifdsize = 0; + currentifdpos = 0; + currentifdsize = 0; + nextifdpos = 0; + readbuffoff = 0; + + writebuff.clear(); + readbuff.clear(); + lastifd.clear(); + currentifd.clear(); + header.clear(); + ifdcache.clear(); +} + +/** + * Parse & Validate file header + * This method will also index all IFDs + * Next IFD cursor will be set + * The following parameters will be obtained: + * - TIFF format (BigTIFF or plain TIFF) + * - Chunk index + * - Chunk size + * - Image count + * - First IFD offset + * - Dataset UID + * - Dataset shape + * - Dataset metadata + * - Image bit depth + * - Write cursor position + * @param datasetuid Dataset UID [out] + * @param shape Dataset shape [out] + * @param chunksize Chunk size [out] + * @param metadata Metadata buffer [out] + * @param bitdepth Image bit depth [out] + * @param index Index IFDs + * @throws std::runtime_error + */ +void G2SBigTiffStream::parse(std::string& datasetuid, std::vector& shape, std::uint32_t& chunksize, std::vector& metadata, std::uint8_t& bitdepth, bool index) +{ + // Check header size + if(header.size() != G2STIFF_HEADER_SIZE) + throw std::runtime_error("File '" + fpath + "' open failed. File header is missing"); + + // Check TIFF format header + if(header[0] != 0x49 || header[1] != 0x49 || (header[2] != 0x2a && header[2] != 0x2b)) + throw std::runtime_error("File '" + fpath + "' open failed. Unsupported file format"); + if(header[2] == 0x2a) + { + // Regular TIFF format detected + if(header[3] != 0) + throw std::runtime_error("File '" + fpath + "' open failed. Unsupported file format"); + // Check G2S Format header + if(header[8] != 0x3c || header[9] != 0x1d || header[10] != 0x59 || header[11] != 0x69) + throw std::runtime_error("File '" + fpath + "' open failed. Unsupported file format"); + bigTiff = false; + } + else + { + // BigTIFF format detected + if(header[4] != 0x08 || header[5] != 0x00 || header[6] != 0x00 || header[7] != 0x00) + throw std::runtime_error("File '" + fpath + "' open failed. Unsupported file format"); + // Check G2S Format header + if(header[16] != 0x3c || header[17] != 0x1d || header[18] != 0x59 || header[19] != 0x69) + throw std::runtime_error("File '" + fpath + "' open failed. Unsupported file format"); + bigTiff = true; + } + currentifdpos = readInt(&header[bigTiff ? 8 : 4], bigTiff ? 8 : 4); + chunkindex = (std::uint32_t)readInt(&header[bigTiff ? 20 : 12], 4); + imgcounter = (std::uint32_t)readInt(&header[bigTiff ? 48 : 36], 4); + + // Parse dataset UID + auto sind = bigTiff ? 24 : 16; + for(std::size_t i = 0; i < 16; i++) + { + if(i == 4 || i == 6 || i == 8 || i == 10) + datasetuid += "-"; + char dig1 = (header[sind + i] & 0xf0) >> 4; + char dig2 = (header[sind + i] & 0x0f); + if(0 <= dig1 && dig1 <= 9) + dig1 += 48; + if(10 <= dig1 && dig1 <= 15) + dig1 += 97 - 10; + if(0 <= dig2 && dig2 <= 9) + dig2 += 48; + if(10 <= dig2 && dig2 <= 15) + dig2 += 97 - 10; + datasetuid.append(&dig1, 1); + datasetuid.append(&dig2, 1); + } + if(datasetuid == "00000000-0000-0000-0000-000000000000") + datasetuid = ""; + + // Parse shape data + auto shapedim = (std::uint32_t)readInt(&header[bigTiff ? 52 : 40], 4); + shape.clear(); + for(std::uint32_t i = 0; i < shapedim; i++) + shape.push_back((std::uint32_t)readInt(&header[(std::size_t)(bigTiff ? 56 : 44) + (std::size_t)i * 4], 4)); + + // Parse chunk size + chunksize = (std::uint32_t)readInt(&header[(std::size_t)(bigTiff ? 56 : 44) + (std::size_t)shapedim * 4], 4); + + // Get file size + auto fsize = std::filesystem::file_size(std::filesystem::u8path(fpath)); + + // Parse metadata + auto metaoffset = readInt(&header[bigTiff ? 40 : 32], bigTiff ? 8 : 4); + if(metaoffset > 0) + { + metadata.resize(fsize - metaoffset); + seek(metaoffset); + fetch(&metadata[0], metadata.size()); + } + + // Set write position at the metadata section start or at the end of the file stream + writepos = metaoffset == 0 ? fsize : metaoffset; + + // Index IFDs + bool pixformatset = false; + if(index && currentifdpos > 0) + { + seek(currentifdpos); + ifdcache.push_back(currentifdpos); + + int i = 0; + std::vector lbuff; + lbuff.reserve(G2STIFF_HEADER_SIZE); + while(true) + { + lbuff.clear(); + lbuff.resize(8); + auto nb = fetch(&lbuff[0], lbuff.size()); + if(nb == 0) + throw std::runtime_error("File '" + fpath + "' open failed. IFD " + std::to_string(i) + " is corrupted"); + std::uint32_t tagcount = (std::uint32_t)readInt(&lbuff[0], bigTiff ? 8 : 2); + + std::uint32_t ifdsz = 0, basesz = 0; + calcDescSize(0, tagcount, &ifdsz, &basesz, nullptr); + lbuff.resize(basesz); + nb = fetch(&lbuff[8], lbuff.size() - 8); + + // Obtain pixel format from the first IFD) + if(!pixformatset) + { + bitdepth = (uint8_t)readInt(&lbuff[bigTiff ? 60 : 34], 2); + pixformatset = true; + } + + auto nextoffset = readInt(&lbuff[(std::size_t)ifdsz - (std::size_t)(bigTiff ? 8 : 4)], bigTiff ? 8 : 4); + if(nextoffset >= fsize) + throw std::runtime_error("File '" + fpath + "' open failed. IFD " + std::to_string(i) + " link is corrupted"); + if(nextoffset == 0) + break; + lastifdpos = nextoffset; + lastifdsize = ifdsz; + ifdcache.push_back(lastifdpos); + seek(lastifdpos); + i++; + } + } + + // Rewind read cursor + seek(currentifdpos); + moveReadCursor(currentifdpos); + nextifdpos = currentifdpos; +} + +/** + * Construct header cache (write mode only) + * Next IFD cursor will be set + */ +void G2SBigTiffStream::formHeader() noexcept +{ + header.clear(); + header.resize(G2STIFF_HEADER_SIZE); + if(bigTiff) + { + // BigTIFF file header + writeInt(&header[0], 4, 0x002b4949); + writeInt(&header[4], 4, 0x08); + + // Set first IFD to 0x00 00 02 00 (512) + writeInt(&header[8], 8, G2STIFF_HEADER_SIZE); + + // Write G2STIFF format signature + writeInt(&header[16], 4, 0x69591d3c); + + // Write chunk index + writeInt(&header[20], 4, chunkindex); + } + else + { + // TIFF file header + writeInt(&header[0], 4, 0x002a4949); + + // Set first IFD to 0x00 00 02 00 (512) + writeInt(&header[4], 4, G2STIFF_HEADER_SIZE); + + // Write G2STIFF format signature + writeInt(&header[8], 4, 0x69591d3c); + + // Write chunk index + writeInt(&header[12], 4, chunkindex); + } + + currentifdpos = G2STIFF_HEADER_SIZE; + lastifdpos = G2STIFF_HEADER_SIZE; + nextifdpos = currentifdpos; +} + +/** + * Add image / write image to the file + * Images are added sequentially + * Image data is stored uncompressed + * Metadata is stored in plain text, after the pixel data + * Image IFD is stored before pixel data + * @param buff Image buffer + * @param len Image buffer length + * @param imgw Image width + * @param imgh Image height + * @param imgdepth Image bit depth + * @param meta Image metadata (optional) + * @throws std::runtime_error + */ +void G2SBigTiffStream::addImage(const unsigned char* buff, std::size_t len, std::uint32_t imgw, std::uint32_t imgh, std::uint32_t imgdepth, const std::string& meta) +{ + // Check file size limits + std::uint32_t tot = 0; + calcDescSize(meta.empty() ? 0 : meta.size() + 1, getTagCount(meta), nullptr, nullptr, &tot); + if(meta.size() + len + currpos + tot > getMaxFileSize()) + throw std::runtime_error("Invalid operation. File size limit exceeded"); + + // Commit header if empty file + if(writepos == 0) + { + commit(&header[0], header.size()); + lastifdpos = readInt(&header[bigTiff ? 8 : 4], bigTiff ? 8 : 4); + } + // Update last IFD for images in read mode + else if(lastifd.empty() && lastifdpos > 0) + { + // Move read cursor to the last IFD + auto lreadpos = readpos; + auto lwritepos = writepos; + seek(lastifdpos); + moveReadCursor(currpos); + + // Load last IFD and change the next IFD offset + auto nextoff = parseIFD(lastifd, lastifdsize); + if(nextoff == 0) + writeInt(&lastifd[(std::size_t)lastifdsize - (std::size_t)(bigTiff ? 8 : 4)], bigTiff ? 8 : 4, writepos); + + // Update last IFD + seek(lastifdpos); + commit(&lastifd[0], lastifd.size()); + + // Reset cursors + moveReadCursor(lreadpos); + moveWriteCursor(lwritepos); + } + + // Reposition file cursor if last operation was a file read + if(writepos != currpos) + seek(writepos); + + // Compose next IFD and write image metadata + appendIFD(imgw, imgh, imgdepth, len, meta); + + // Write pixel data + commit(buff, len); + + // Add padding bytes + auto alignsz = directIo ? ssize : 2; + if(len % alignsz != 0) + { + auto padsize = len - (len / alignsz) * alignsz; + std::vector pbuff(padsize); + commit(&pbuff[0], pbuff.size()); + } + + // Flush pending data + ifdcache.push_back(lastifdpos); + imgcounter++; +} + +/** + * Get image data (pixel buffer) (for the current IFD) + * @return Image data + * @throws std::runtime_error + */ +std::vector G2SBigTiffStream::getImage() +{ + // Obtain pixel data strip locations + auto offind = (bigTiff ? 8 : 2) + 5 * (bigTiff ? 20 : 12); + auto lenind = (bigTiff ? 8 : 2) + 7 * (bigTiff ? 20 : 12); + auto dataoffset = readInt(¤tifd[(std::size_t)offind + (std::size_t)(bigTiff ? 12 : 8)], bigTiff ? 8 : 4); + auto datalen = readInt(¤tifd[(std::size_t)lenind + (std::size_t)(bigTiff ? 12 : 8)], bigTiff ? 8 : 4); + if(dataoffset == 0 || datalen == 0) + return {}; + + std::vector ret(datalen); + moveReadCursor(seek(dataoffset)); + fetch(&ret[0], ret.size()); + return ret; +} + +/** + * Get image metadata (for the current IFD) + * If no metadata is defined this method will return an empty string + * @return Image metadata + * @throws std::runtime_error + */ +std::string G2SBigTiffStream::getImageMetadata() const +{ + // Check IFD tag count + auto tagcount = readInt(¤tifd[0], bigTiff ? 8 : 2); + if(tagcount == G2STIFF_TAG_COUNT_NOMETA) + return ""; + + // Obtain metadata OFFSET and length + std::size_t metatagind = (std::size_t)(bigTiff ? 8 : 2) + (std::size_t)G2STIFF_TAG_COUNT_NOMETA * (bigTiff ? 20 : 12); + auto metalen = readInt(¤tifd[metatagind + 4], bigTiff ? 8 : 4); + auto metaoffset = readInt(¤tifd[metatagind + (bigTiff ? 12 : 8)], bigTiff ? 8 : 4); + if(metalen == 0 || metaoffset == 0) + return ""; + if(metaoffset < currentifdpos) + throw std::runtime_error("Unable to obtain image metadata. File is corrupted"); + + // Copy metadata from the IFD + auto roff = metaoffset - currentifdpos; + auto strlen = roff + metalen > currentifd.size() ? currentifd.size() - roff - metalen : metalen - 1; + std::string str(¤tifd[roff], ¤tifd[roff + strlen]); + return str; +} + +/** + * Write shape info to the header cache + * @param shape Dataset shape + * @param chunksz Chunk size + */ +void G2SBigTiffStream::writeShapeInfo(const std::vector& shape, std::uint32_t chunksz) noexcept +{ + if(header.size() < G2STIFF_HEADER_SIZE || shape.empty()) + return; + + auto startind = bigTiff ? 52 : 40; + writeInt(&header[startind], 4, shape.size()); + for(std::size_t i = 0; i < shape.size(); i++) + writeInt(&header[startind + (i + 1) * 4], 4, shape[i]); + writeInt(&header[startind + (shape.size() + 1) * 4], 4, chunksz); +} + +/** + * Write dataset UID to the header cache + * @param datasetuid Dataset UID + */ +void G2SBigTiffStream::writeDatasetUid(const std::string& datasetuid) noexcept +{ + if(header.size() < G2STIFF_HEADER_SIZE) + return; + + // Write UID to the header cache + auto startind = bigTiff ? 24 : 16; + auto cind = 0; + for(int i = 0; i < 16; i++) + { + if(i == 4 || i == 6 || i == 8 || i == 10) + cind++; + char cv1 = datasetuid[cind++]; + char cv2 = datasetuid[cind++]; + std::uint8_t vx1 = cv1 >= 48 && cv1 <= 57 ? cv1 - 48 : (cv1 >= 65 && cv1 <= 70 ? cv1 - 55 : cv1 - 87); + std::uint8_t vx2 = cv2 >= 48 && cv2 <= 57 ? cv2 - 48 : (cv2 >= 65 && cv2 <= 70 ? cv2 - 55 : cv2 - 87); + auto xval = (std::uint8_t)(((vx1 & 0x0f) << 4) | (vx2 & 0x0f)); + header[startind + i] = xval; + } +} + +/** + * Set chunk index + * @param val Chunk index (zero based) + */ +void G2SBigTiffStream::setChunkIndex(std::uint32_t val) noexcept +{ + chunkindex = val; + if(header.size() == G2STIFF_HEADER_SIZE) + writeInt(&header[bigTiff ? 20 : 12], 4, chunkindex); +} + +/** +* Append metadata at the end of the file +* @param meta Metadata buffer +* @throws std::runtime_error +*/ +void G2SBigTiffStream::appendMetadata(const std::vector& meta) +{ + if(!isOpen() || meta.empty()) + return; + + // Reposition file cursor if last operation was a file read + if(writepos != currpos) + seek(writepos); + + // Write metadata + writeInt(&header[bigTiff ? 40 : 32], bigTiff ? 8 : 4, writepos); + commit(&meta[0], meta.size()); +} + +/** + * Send data to be written to the file stream + * if direct I/O is used for small data sizes data will be stored in the temporary buffer + * For cached I/O and large buffer sizes for direct I/O data is written to the file stream + * @param buff Source buffer + * @param len Source buffer length + * @return Number of bytes written + * @throws std::runtime_error + */ +std::size_t G2SBigTiffStream::commit(const unsigned char* buff, std::size_t len) +{ + if(!isOpen()) + throw std::runtime_error("File write failed. No valid file stream available"); + if(directIo) + { + // Clear write cache if file cursor has been moved + if(currpos != writepos) + writebuff.clear(); + + // Direct I/O - Buffer size must be a multiple of a disk sector size (usually 512 B) + std::size_t ret = 0; + + // Fill pending data with the first sector / write pending data + std::size_t boffset = 0; + if(!writebuff.empty()) + { + auto curr = writebuff.size(); + auto cnt = curr + len > ssize ? ssize - curr : len; + writebuff.resize(writebuff.size() + cnt); + std::memcpy(&writebuff[curr], buff, cnt); + boffset += cnt; + if(writebuff.size() == ssize) + { + ret += write(&writebuff[0], ssize); + writebuff.clear(); + } + else + return ret; + } + if(len - boffset == 0) + return ret; + + // Write middle sectors directly + if(len - boffset >= ssize) + { + auto wcnt = ((len - boffset) / ssize) * ssize; + ret += write(buff + boffset, wcnt); + boffset += wcnt; + } + + // Write remaining data (last sector) to the pending data buffer + // Pending data buffer should be empty at this point + if(len - boffset > 0) + { + auto cpos = writebuff.size(); + writebuff.resize(len - boffset); + std::memcpy(&writebuff[cpos], &buff[boffset], len - boffset); + } + return ret; + } + else + // Standard - Cached I/O + return write(buff, len); +} + +/** + * Write data to the file stream + * @param buff Source buffer + * @param len Source buffer length + * @return Number of bytes written + * @throws std::runtime_error + */ +std::size_t G2SBigTiffStream::write(const unsigned char* buff, std::size_t len) +{ + std::size_t pos = 0; + std::size_t ret = 0; + while(pos < len) + { + std::uint32_t trans = len - pos < std::numeric_limits::max() ? (std::uint32_t)(len - pos) : std::numeric_limits::max(); +#ifdef _WIN32 + DWORD nb = 0; + auto sc = WriteFile((HANDLE)fhandle, (LPCVOID)&buff[pos], (DWORD)trans, &nb, NULL); + if(sc == FALSE) + throw std::runtime_error("File write failed. Error code: " + std::to_string(GetLastError())); + currpos += nb; +#else + auto nb = ::write(fhandle, &buff[pos], trans); + if(nb < 0) + throw std::runtime_error("File write failed. Error code: " + std::to_string(errno)); + currpos += (std::uint64_t)nb; +#endif + ret += nb; + pos += trans; + } + writepos = currpos; + return ret; +} + +/** + * Fetch data from the file stream + * if direct I/O is used for small data sizes entire block is read from file and stored in the temporary buffer + * For cached I/O and large buffer sizes for direct I/O data is read from the file stream + * @param buff Destination buffer + * @param len Destination buffer length + * @return Number of bytes read + * @throws std::runtime_error + */ +std::size_t G2SBigTiffStream::fetch(unsigned char* buff, std::size_t len) +{ + if(!isOpen()) + throw std::runtime_error("File read failed. No valid file stream available"); + if(directIo) + { + // Clear write cache if file cursor has been moved + if(currpos != readpos) + { + readbuff.clear(); + readbuffoff = 0; + } + + // Direct I/O - Buffer size must be a multiple of a disk sector size (usually 512 B) + std::size_t ret = 0; + + // Fetch pending data before requesting another read operation + std::size_t boffset = 0; + if(!readbuff.empty()) + { + std::size_t cnt = (readbuff.size() - readbuffoff) >= len ? len : (readbuff.size() - readbuffoff); + std::memcpy(buff, &readbuff[readbuffoff], cnt); + readbuffoff += cnt; + if(readbuffoff == readbuff.size()) + { + readbuff.clear(); + readbuffoff = 0; + } + boffset += cnt; + } + + // Check if all data has been fetched and if not + if(len - boffset == 0) + return ret; + + // Read middle sectors directly and prefetch last sector + if(len - boffset >= ssize) + { + auto rcnt = ((len - boffset) / ssize) * ssize; + ret += read(&buff[boffset], rcnt); + boffset += rcnt; + } + + // Prefetch last sector + if(len - boffset > 0) + { + readbuff.resize(ssize); + readbuffoff = 0; + ret += read(&readbuff[0], ssize); + std::size_t cnt = len - boffset; + std::memcpy(&buff[boffset], &readbuff[0], cnt); + readbuffoff += cnt; + } + return ret; + } + else + return read(buff, len); +} + +/** + * Read data from the file stream + * @param buff Destination buffer + * @param len Destination buffer length + * @return Number of bytes read + * @throws std::runtime_error + */ +std::size_t G2SBigTiffStream::read(unsigned char* buff, std::size_t len) +{ + if(!isOpen()) + return 0; + std::size_t pos = 0; + std::size_t ret = 0; + while(pos < len) + { + std::uint32_t trans = len - pos < std::numeric_limits::max() ? (std::uint32_t)(len - pos) : std::numeric_limits::max(); +#ifdef _WIN32 + DWORD nb = 0; + auto sc = ReadFile((HANDLE)fhandle, (LPVOID)&buff[pos], trans, &nb, NULL); + if(sc == FALSE) + throw std::runtime_error("File read failed. Error code: " + std::to_string(GetLastError())); + currpos += nb; +#else + auto nb = ::read(fhandle, &buff[pos], trans); + if(nb < 0) + throw std::runtime_error("File read failed. Error code: " + std::to_string(errno)); + currpos += (std::uint64_t)nb; +#endif + ret += nb; + pos += trans; + } + readpos = currpos; + return ret; +} + +/** + * Set cursor position (position in the file stream) + * Moving the cursor will clear temporary buffer (for direct I/O) + * @param pos Position / Offset + * @param beg Use stream begining as a base point (or stream end) + * @return Current position + * @throws std::runtime_error + */ +std::uint64_t G2SBigTiffStream::seek(std::int64_t pos, bool beg) +{ + if(!isOpen()) + throw std::runtime_error("File seek failed. No valid file stream available"); + if(beg && pos < 0) + throw std::runtime_error("File seek failed. Invalid file position"); + if(beg && (std::uint64_t)pos == currpos) + return currpos; +#ifdef _WIN32 + LARGE_INTEGER li = {}; + li.QuadPart = pos; + auto ret = SetFilePointer((HANDLE)fhandle, li.LowPart, &li.HighPart, beg ? FILE_BEGIN : FILE_END); + if(ret == INVALID_SET_FILE_POINTER) + throw std::runtime_error("File seek failed. Error code: " + std::to_string(GetLastError())); + ULARGE_INTEGER ri = {}; + ri.LowPart = ret; + ri.HighPart = (DWORD)li.HighPart; + currpos = ri.QuadPart; +#else + auto ret = lseek64(fhandle, (off64_t)pos, beg ? SEEK_SET : SEEK_END); + if(ret < 0) + throw std::runtime_error("File seek failed. Error code: " + std::to_string(errno)); + currpos = (std::uint64_t)ret; +#endif + return currpos; +} + +/** + * Advance cursor position in the relation to the current cursor position + * Moving the cursor will clear temporary buffer (for direct I/O) + * @param pos Offset + * @return Current position + * @throws std::runtime_error + */ +std::uint64_t G2SBigTiffStream::offset(std::int64_t off) +{ + if(!isOpen()) + throw std::runtime_error("File seek failed. No valid file stream available"); + if(off == 0) + return currpos; +#ifdef _WIN32 + LARGE_INTEGER li = {}; + li.QuadPart = off; + auto ret = SetFilePointer((HANDLE)fhandle, li.LowPart, &li.HighPart, FILE_CURRENT); + if(ret == INVALID_SET_FILE_POINTER) + throw std::runtime_error("File seek failed. Error code: " + std::to_string(GetLastError())); + ULARGE_INTEGER ri = {}; + ri.LowPart = ret; + ri.HighPart = (DWORD)li.HighPart; + currpos = ri.QuadPart; +#else + auto ret = lseek64(fhandle, (off64_t)off, SEEK_CUR); + if(ret < 0) + throw std::runtime_error("File seek failed. Error code: " + std::to_string(errno)); + currpos = (std::uint64_t)ret; +#endif + return currpos; +} + +/** + * Flush I/O write opertions to disk + */ +void G2SBigTiffStream::flush() const +{ +#ifdef _WIN32 + auto sc = FlushFileBuffers((HANDLE)fhandle); + if(sc == FALSE) + throw std::runtime_error("File write flush failed. Error code: " + std::to_string(GetLastError())); +#else + auto sc = ::fsync(fhandle); + if(sc != 0) + throw std::runtime_error("File write flush failed. Error code: " + std::to_string(GetLastError())); +#endif +} + +/** + * Get file size + * @return File size in bytes + */ +std::uint64_t G2SBigTiffStream::getFileSize() const noexcept +{ + if(isOpen()) + { +#ifdef _WIN32 + LARGE_INTEGER fsize = {}; + auto sc = GetFileSizeEx((HANDLE)fhandle, &fsize); + if(sc == 0) + return 0; + return (std::uint64_t)fsize.QuadPart; +#else + auto sz = lseek(fhandle, 0L, SEEK_END); + lseek(fhandle, (off_t)currpos, SEEK_SET); + return (std::uint64_t)sz; +#endif + } + if(fpath.empty()) + return 0; + return std::filesystem::file_size(std::filesystem::u8path(fpath)); +} + +/** + * Form IFD and write it to file stream at the current position + * Metadata is placed immediately after pixel data + * Image / Matadata offsets calculated automatically + * Image sections are block aligned + * @param imgw Image width + * @param imgh Image height + * @param imgdepth Image bit depth + * @param imagelen Pixel data length + * @param meta Image metadata + * @throws std::runtime_error + */ +void G2SBigTiffStream::appendIFD(std::uint32_t imgw, std::uint32_t imgh, std::uint32_t imgdepth, std::size_t imagelen, const std::string& meta) +{ + std::uint32_t descsz = 0, totsz = 0, tagcnt = getTagCount(meta); + auto actimglen = imagelen + (imagelen % ssize == 0 ? 0 : (ssize - (imagelen % ssize))); + calcDescSize(meta.empty() ? 0 : meta.size() + 1, tagcnt, &lastifdsize, &descsz, &totsz); + lastifdpos = currpos; + lastifd.clear(); + lastifd.resize(totsz); + + // Set TAG count + writeInt(&lastifd[0], bigTiff ? 8 : 2, tagcnt); + + // Add TAGS + std::size_t ind = bigTiff ? 8 : 2; + ind += setIFDTag(&lastifd[ind], 0x0100, 4, imgw); + ind += setIFDTag(&lastifd[ind], 0x0101, 4, imgh); + ind += setIFDTag(&lastifd[ind], 0x0102, 3, imgdepth); + ind += setIFDTag(&lastifd[ind], 0x0103, 3, 1); + ind += setIFDTag(&lastifd[ind], 0x0106, 3, 1); + ind += setIFDTag(&lastifd[ind], 0x0111, bigTiff ? 16 : 4, currpos + totsz); + ind += setIFDTag(&lastifd[ind], 0x0116, 4, imgh); + ind += setIFDTag(&lastifd[ind], 0x0117, bigTiff ? 16 : 4, imagelen); + if(bigTiff) + { + ind += setIFDTag(&lastifd[ind], 0x011a, 5, 0x0100000000); + ind += setIFDTag(&lastifd[ind], 0x011b, 5, 0x0100000000); + } + else + { + ind += setIFDTag(&lastifd[ind], 0x011a, 5, currpos + lastifdsize); + ind += setIFDTag(&lastifd[ind], 0x011b, 5, currpos + lastifdsize + 8); + } + ind += setIFDTag(&lastifd[ind], 0x0128, 3, 1); + if(!meta.empty()) + ind += setIFDTag(&lastifd[ind], 0x010e, 2, currpos + descsz, meta.size() + 1); + + // Write next IFD offset + std::uint64_t nextifd = currpos + totsz + actimglen; + writeInt(&lastifd[ind], bigTiff ? 8 : 4, nextifd); + + // Write image resolution values + if(!bigTiff) + { + writeInt(&lastifd[lastifdsize + 0], 8, 0x0100000000); + writeInt(&lastifd[lastifdsize + 8], 8, 0x0100000000); + } + + // Write metadata + if(!meta.empty()) + std::copy(meta.begin(), meta.end(), lastifd.begin() + descsz); + + // Write IFD + metadata + commit(&lastifd[0], lastifd.size()); +} + +/** + * Set IFD field + * Field data will be appended to the IFD buffer + * @param ifd IFD buffer + * @param tag Field tag + * @param dtype Data type + * @param val Field value / offset + * @param cnt Value count + * @return Number of bytes written + */ +std::size_t G2SBigTiffStream::setIFDTag(unsigned char* ifd, std::uint16_t tag, std::uint16_t dtype, std::uint64_t val, std::uint64_t cnt) const noexcept +{ + // Write tag + writeInt(&ifd[0], 2, tag); + + // Write data type + writeInt(&ifd[2], 2, dtype); + + // Write value count + writeInt(&ifd[4], bigTiff ? 8 : 4, cnt); + + // Write value / offset + writeInt(&ifd[bigTiff ? 12 : 8], bigTiff ? 8 : 4, val); + + return bigTiff ? 20 : 12; +} + +/** + * Parse IFD at the current read cursor + * @param ifd IFD buffer [out] + * @param ifdsz IFD size [out] + * @return Next IFD offset + * @throws std::runtime_error + */ +std::uint64_t G2SBigTiffStream::parseIFD(std::vector& ifd, std::uint32_t& ifdsz) +{ + if(readpos != currpos) + seek(readpos); + + ifd.clear(); + ifd.resize(8); + auto nb = fetch(&ifd[0], ifd.size()); + if(nb == 0) + throw std::runtime_error("IFD loading failed. File is corrupted"); + + // Obtain tag count + std::uint32_t tagcount = (std::uint32_t)readInt(&ifd[0], bigTiff ? 8 : 2); + std::uint32_t ifdsize = 0, basesz = 0, totsz = 0; + calcDescSize(0, tagcount, nullptr, &basesz, nullptr); + if(basesz <= 8) + throw std::runtime_error("IFD loading failed. File is corrupted"); + + // Load base IFD + ifd.resize(basesz); + fetch(&ifd[8], ifd.size() - 8); + + // Obtain image metadata length + auto metatagind = (bigTiff ? 8 : 2) + G2STIFF_TAG_COUNT_NOMETA * (bigTiff ? 20 : 12); + auto metalen = (std::size_t)readInt(&ifd[(std::size_t)metatagind + 4], bigTiff ? 8 : 4); + calcDescSize(metalen, tagcount, &ifdsize, &basesz, &totsz); + + // Load entire image descriptor (with metadata) + ifd.resize(totsz); + fetch(&ifd[basesz], ifd.size() - basesz); + + // Set current IFD offset to next IFD offset + auto nextifd = readInt(&ifd[(std::size_t)ifdsize - (bigTiff ? 8 : 4)], bigTiff ? 8 : 4); + ifdsz = ifdsize; + return nextifd; +} + +/** + * Load IFD for reading + * Selected IFD will become the current IFD + * Next IFD offset will be updated + * If the last (written) IFD offset is the same as the selected IFD offset + * no file operation will be performed (IFD will be copied from cache) + * @throws std::runtime_error + */ +void G2SBigTiffStream::loadIFD(std::uint64_t off) +{ + if(!currentifd.empty() && off == currentifdpos) + return; + if(off == 0) + { + // Reset current IFD + currentifd.clear(); + currentifdpos = 0; + currentifdsize = 0; + nextifdpos = 0; + } + else if(!lastifd.empty() && lastifdpos == off) + { + // Copy IFD from cache + currentifd = lastifd; + currentifdpos = off; + currentifdsize = lastifdsize; + nextifdpos = readInt(¤tifd[currentifdsize - (bigTiff ? 8 : 4)], bigTiff ? 8 : 4); + } + else + { + // Load IFD from the file stream + moveReadCursor(seek(off)); + currentifdpos = off; + nextifdpos = parseIFD(currentifd, currentifdsize); + } +} + +/** + * Calculate image descriptor / IFD size + * Image descriptor contains IFD, additional heap for large values (X/Y resolution), image metadata and padding bytes + * Image descriptors are block aligned + * @param metalen Image metadata length + * @param tags Number of IFD tags + * @param ifd IFD size [out] + * @param desc Base descriptor (IFD + additional heap) size [out] + * @parma tot Total image descriptor size [out] + */ +void G2SBigTiffStream::calcDescSize(std::size_t metalen, std::uint32_t tags, std::uint32_t* ifd, std::uint32_t* desc, std::uint32_t* tot) noexcept +{ + // Calculate IFD size + std::uint32_t lifd = bigTiff ? 8 + tags * 20 + 8 : 2 + tags * 12 + 4; + + // Calculate base descriptor size (IFD + additional heap) + auto heapsz = bigTiff ? 0 : 16; + std::uint32_t ldesc = lifd + heapsz; + + // Calculate total size (IFD + additional heap + metadata + padding) + auto basesz = ldesc + (std::uint32_t)metalen; + auto padsz = basesz % ssize == 0 ? 0 : ssize - (basesz % ssize); + std::uint32_t ltot = basesz + padsz; + + // Assign values + if(ifd != nullptr) + *ifd = lifd; + if(desc != nullptr) + *desc = ldesc; + if(tot != nullptr) + *tot = ltot; +} + +/** + * Move file read cursor + * This wont affect current file position (cursor) + * @param pos New position + */ +void G2SBigTiffStream::moveReadCursor(std::uint64_t pos) noexcept +{ + if(pos == readpos) + return; + readpos = pos; + if(directIo && !readbuff.empty()) + { + readbuff.clear(); + readbuffoff = 0; + } +} + +/** + * Move file write cursor + * This wont affect current file position (cursor) + * @param pos New position + */ +void G2SBigTiffStream::moveWriteCursor(std::uint64_t pos) noexcept +{ + if(pos == writepos) + return; + writepos = pos; + if(directIo) + writebuff.clear(); +} diff --git a/DeviceAdapters/go2scope/G2SBigTiffStream.h b/DeviceAdapters/go2scope/G2SBigTiffStream.h new file mode 100644 index 000000000..75c44b305 --- /dev/null +++ b/DeviceAdapters/go2scope/G2SBigTiffStream.h @@ -0,0 +1,149 @@ +/////////////////////////////////////////////////////////////////////////////// +// FILE: G2SBigTiffStream.h +// PROJECT: Micro-Manager +// SUBSYSTEM: DeviceAdapters +//----------------------------------------------------------------------------- +// DESCRIPTION: Go2Scope devices. Includes the experimental StorageDevice +// +// AUTHOR: Milos Jovanovic +// +// COPYRIGHT: Nenad Amodaj, Chan Zuckerberg Initiative, 2024 +// +// LICENSE: This file is distributed under the BSD license. +// License text is included with the source distribution. +// +// This file is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty +// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +// +// IN NO EVENT SHALL THE COPYRIGHT OWNER OR +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES. +// +// NOTE: Storage Device development is supported in part by +// Chan Zuckerberg Initiative (CZI) +// +/////////////////////////////////////////////////////////////////////////////// +#pragma once +#include +#include +#include +#include "G2SFileUtil.h" + +/** + * BigTIFF file stream descriptor / state cache + * @author Miloš Jovanović + * @version 1.0 + */ +class G2SBigTiffStream +{ +public: + //============================================================================================================================ + // Constructors & Destructors + //============================================================================================================================ + G2SBigTiffStream(const std::string& path, bool dio, bool fbig = DEFAULT_BIGTIFF, std::uint32_t chunk = 0) noexcept; + G2SBigTiffStream(const G2SBigTiffStream& src) noexcept = default; + ~G2SBigTiffStream() noexcept { close(); } + +public: + //============================================================================================================================ + // Public interface - Common methods + //============================================================================================================================ + void open(bool trunc); + void close() noexcept; + void parse(std::string& datasetuid, std::vector& shape, std::uint32_t& chunksize, std::vector& metadata, std::uint8_t& bitdepth, bool index = true); + void formHeader() noexcept; + void addImage(const unsigned char* buff, std::size_t len, std::uint32_t imgw, std::uint32_t imgh, std::uint32_t imgdepth, const std::string& meta = ""); + std::vector getImage(); + std::string getImageMetadata() const; + void writeShapeInfo(const std::vector& shape, std::uint32_t chunksz) noexcept; + void writeDatasetUid(const std::string& datasetuid) noexcept; + void advanceIFD() noexcept { currentifd.clear(); currentifdpos = nextifdpos; } + void setChunkIndex(std::uint32_t val) noexcept; + std::uint32_t getChunkIndex() const noexcept { return chunkindex; } + void setCurrentImage(std::uint32_t val) noexcept { currentimage = val; } + std::uint32_t getCurrentImage() const noexcept { return currentimage; } + void appendMetadata(const std::vector& meta); + const std::vector& getHeader() const noexcept { return header; } + std::vector& getHeader() noexcept { return header; } + const std::vector& getCurrentIFD() const noexcept { return currentifd; } + const std::vector& getLastIFD() const noexcept { return lastifd; } + const std::vector& getIFDOffsets() const noexcept { return ifdcache; } + std::uint64_t getCurrentIFDOffset() const noexcept { return currentifdpos; } + std::uint64_t getNextIFDOffset() const noexcept { return nextifdpos; } + std::string getFilePath() const noexcept { return fpath; } + std::uint64_t getFileSize() const noexcept; + std::uint64_t getMaxFileSize() const noexcept { return bigTiff ? std::numeric_limits::max() : std::numeric_limits::max(); } + std::uint32_t getImageCount() const noexcept { return imgcounter; } + bool isBigTiff() const noexcept { return bigTiff; } +#ifdef _WIN32 + bool isOpen() const noexcept { return fhandle != nullptr; } +#else + bool isOpen() const noexcept { return fhandle > 0; } +#endif + +public: + //============================================================================================================================ + // Public interface - File stream manipulation + //============================================================================================================================ + std::size_t commit(const unsigned char* buff, std::size_t len); + std::size_t write(const unsigned char* buff, std::size_t len); + std::size_t fetch(unsigned char* buff, std::size_t len); + std::size_t read(unsigned char* buff, std::size_t len); + std::uint64_t seek(std::int64_t pos, bool beg = true); + std::uint64_t offset(std::int64_t off); + void flush() const; + +public: + //============================================================================================================================ + // Public interface - Helper methods + //============================================================================================================================ + void appendIFD(std::uint32_t imgw, std::uint32_t imgh, std::uint32_t imgdepth, std::size_t imagelen, const std::string& meta); + std::size_t setIFDTag(unsigned char* ifd, std::uint16_t tag, std::uint16_t dtype, std::uint64_t val, std::uint64_t cnt = 1) const noexcept; + std::uint32_t getTagCount(const std::string& meta) const noexcept { return meta.empty() ? G2STIFF_TAG_COUNT_NOMETA : G2STIFF_TAG_COUNT; } + std::uint64_t parseIFD(std::vector& ifd, std::uint32_t& ifdsz); + void loadNextIFD() { loadIFD(currentifdpos); } + void loadIFD(std::uint64_t off); + void calcDescSize(std::size_t metalen, std::uint32_t tags, std::uint32_t* ifd, std::uint32_t* desc, std::uint32_t* tot) noexcept; + void moveReadCursor(std::uint64_t pos) noexcept; + void moveWriteCursor(std::uint64_t pos) noexcept; + +private: + //============================================================================================================================ + // Data members - Stream state / cache + //============================================================================================================================ + std::vector header; ///< Header (cache) + std::vector lastifd; ///< Last IFD (cache) + std::vector currentifd; ///< Current IFD (cache) + std::vector writebuff; ///< Write buffer for direct I/O + std::vector readbuff; ///< Read buffer for direct I/O + std::size_t readbuffoff; ///< Read buffer offset + std::uint64_t currpos; ///< Current file stream offset + std::uint64_t writepos; ///< Write stream offset + std::uint64_t readpos; ///< Read stream offset + std::uint64_t lastifdpos; ///< Offset of the last image descriptor + std::uint32_t lastifdsize; ///< Last IFD size + std::uint64_t currentifdpos; ///< Offset of the current image descriptor + std::uint32_t currentifdsize; ///< Current IFD size + std::uint64_t nextifdpos; ///< Offset of the next image descriptor + std::uint32_t currentimage; ///< Current image index (used for reading only) + std::uint32_t imgcounter; ///< Image counter + std::uint32_t chunkindex; ///< Chunk index + std::vector ifdcache; ///< IFD offset cache +#ifdef _WIN32 + void* fhandle; ///< File handle +#else + int fhandle; ///< File descriptor +#endif + +private: + //============================================================================================================================ + // Data members - Configuration + //============================================================================================================================ + std::string fpath; ///< File path + std::uint32_t ssize; ///< Sector size (for direct I/O) + bool directIo; ///< Use direct I/O for file operations + bool bigTiff; ///< Use big TIFF format +}; + +typedef std::shared_ptr G2SFileStreamHandle; \ No newline at end of file diff --git a/DeviceAdapters/go2scope/G2SFileUtil.h b/DeviceAdapters/go2scope/G2SFileUtil.h new file mode 100644 index 000000000..b17c4b7ac --- /dev/null +++ b/DeviceAdapters/go2scope/G2SFileUtil.h @@ -0,0 +1,52 @@ +/////////////////////////////////////////////////////////////////////////////// +// FILE: G2SFileUtil.h +// PROJECT: Micro-Manager +// SUBSYSTEM: DeviceAdapters +//----------------------------------------------------------------------------- +// DESCRIPTION: Go2Scope devices. Includes the experimental StorageDevice +// +// AUTHOR: Milos Jovanovic +// +// COPYRIGHT: Nenad Amodaj, Chan Zuckerberg Initiative, 2024 +// +// LICENSE: This file is distributed under the BSD license. +// License text is included with the source distribution. +// +// This file is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty +// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +// +// IN NO EVENT SHALL THE COPYRIGHT OWNER OR +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES. +// +// NOTE: Storage Device development is supported in part by +// Chan Zuckerberg Initiative (CZI) +// +/////////////////////////////////////////////////////////////////////////////// +#pragma once +#include +#include +#include + +//=============================================================================================================================== +// Driver version +//=============================================================================================================================== +#define G2STIFF_VERSION "1.0.2" + +//=============================================================================================================================== +// Literals +//=============================================================================================================================== +#define DEFAULT_BIGTIFF true +#define DEFAULT_DIRECT_IO false +#define TIFF_MAX_BUFFER_SIZE 2147483648U +#define G2STIFF_HEADER_SIZE 512 +#define G2STIFF_TAG_COUNT 12 +#define G2STIFF_TAG_COUNT_NOMETA 11 + +//=============================================================================================================================== +// Utility functions +//=============================================================================================================================== +void writeInt(unsigned char* buff, std::uint8_t len, std::uint64_t val) noexcept; +std::uint64_t readInt(const unsigned char* buff, std::uint8_t len) noexcept; +std::vector splitLineCSV(const std::string& line) noexcept; diff --git a/DeviceAdapters/go2scope/G2SStorage.cpp b/DeviceAdapters/go2scope/G2SStorage.cpp new file mode 100644 index 000000000..81e4b86cb --- /dev/null +++ b/DeviceAdapters/go2scope/G2SStorage.cpp @@ -0,0 +1,59 @@ +/////////////////////////////////////////////////////////////////////////////// +// FILE: G2SStorage.cpp +// PROJECT: Micro-Manager +// SUBSYSTEM: DeviceAdapters +//----------------------------------------------------------------------------- +// DESCRIPTION: Go2Scope devices. Includes the experimental StorageDevice +// +// AUTHOR: Nenad Amodaj +// Milos Jovanovic +// +// COPYRIGHT: Nenad Amodaj, Chan Zuckerberg Initiative, 2024 +// +// LICENSE: This file is distributed under the BSD license. +// License text is included with the source distribution. +// +// This file is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty +// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +// +// IN NO EVENT SHALL THE COPYRIGHT OWNER OR +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES. +// +// NOTE: Storage Device development is supported in part by +// Chan Zuckerberg Initiative (CZI) +// +/////////////////////////////////////////////////////////////////////////////// +#include "G2SStorage.h" +#include "ModuleInterface.h" +#include "G2SBigTiffStorage.h" +#include "AcqZarrStorage.h" + + +/////////////////////////////////////////////////////////////////////////////// +// Exported MMDevice API +/////////////////////////////////////////////////////////////////////////////// +MODULE_API void InitializeModuleData() +{ + RegisterDevice(g_AcqZarrStorage, MM::StorageDevice, "Zarr storage based on Acquire"); + RegisterDevice(g_BigTiffStorage, MM::StorageDevice, "BigTIFF storage based on Go2Scope"); +} + +MODULE_API MM::Device* CreateDevice(const char* deviceName) +{ + if(deviceName == 0) + return 0; + + if(strcmp(deviceName, g_AcqZarrStorage) == 0) + return new AcqZarrStorage(); + if(strcmp(deviceName, g_BigTiffStorage) == 0) + return new G2SBigTiffStorage(); + + return 0; +} + +MODULE_API void DeleteDevice(MM::Device* pDevice) +{ + delete pDevice; +} diff --git a/DeviceAdapters/go2scope/G2SStorage.h b/DeviceAdapters/go2scope/G2SStorage.h new file mode 100644 index 000000000..b76a360c2 --- /dev/null +++ b/DeviceAdapters/go2scope/G2SStorage.h @@ -0,0 +1,103 @@ +/////////////////////////////////////////////////////////////////////////////// +// FILE: G2SStorage.h +// PROJECT: Micro-Manager +// SUBSYSTEM: DeviceAdapters +//----------------------------------------------------------------------------- +// DESCRIPTION: Go2Scope devices. Includes the experimental StorageDevice +// +// AUTHORS: Milos Jovanovic +// Nenad Amodaj +// +// COPYRIGHT: Nenad Amodaj, Chan Zuckerberg Initiative, 2024 +// +// LICENSE: This file is distributed under the BSD license. +// License text is included with the source distribution. +// +// This file is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty +// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +// +// IN NO EVENT SHALL THE COPYRIGHT OWNER OR +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES. +// +// NOTE: Storage Device development is supported in part by +// Chan Zuckerberg Initiative (CZI) +// +/////////////////////////////////////////////////////////////////////////////// +#pragma once +#include "MMDevice.h" +#include "DeviceBase.h" + +////////////////////////////////////////////////////////////////////////////// +// Error codes +// +////////////////////////////////////////////////////////////////////////////// +#define ERR_PARAMETER_ERROR 144001 +#define ERR_INTERNAL 144002 +#define ERR_FAILED_CREATING_FILE 144003 +#define ERR_ZARR 140100 +#define ERR_ZARR_SETTINGS 140101 +#define ERR_ZARR_NUMDIMS 140102 +#define ERR_ZARR_STREAM_CREATE 140103 +#define ERR_ZARR_STREAM_CLOSE 140104 +#define ERR_ZARR_STREAM_LOAD 140105 +#define ERR_ZARR_STREAM_APPEND 140106 +#define ERR_ZARR_STREAM_ACCESS 140107 + +#define ERR_TIFF 140500 +#define ERR_TIFF_STREAM_UNAVAILABLE 140501 +#define ERR_TIFF_INVALID_PATH 140502 +#define ERR_TIFF_INVALID_DIMENSIONS 140503 +#define ERR_TIFF_INVALID_PIXEL_TYPE 140504 +#define ERR_TIFF_CACHE_OVERFLOW 140505 +#define ERR_TIFF_OPEN_FAILED 140506 +#define ERR_TIFF_CACHE_INSERT 140507 +#define ERR_TIFF_HANDLE_INVALID 140508 +#define ERR_TIFF_STRING_TOO_LONG 140509 +#define ERR_TIFF_INVALID_COORDINATE 140510 +#define ERR_TIFF_DATASET_CLOSED 140511 +#define ERR_TIFF_DATASET_READONLY 140512 +#define ERR_TIFF_DELETE_FAILED 140513 +#define ERR_TIFF_ALLOCATION_FAILED 140514 + +////////////////////////////////////////////////////////////////////////////// +// Cache configuration +// +////////////////////////////////////////////////////////////////////////////// +#define MAX_CACHE_SIZE 1024 +#define CACHE_HARD_LIMIT 0 + +static const char* g_Go2Scope = "Go2Scope"; +static const char* g_AcqZarrStorage = "AcquireZarrStorage"; +static const char* g_BigTiffStorage = "G2SBigTiffStorage"; + +/** + * Storage entry descriptor + * @author Miloš Jovanović + * @version 1.0 + */ +struct G2SStorageEntry +{ + /** + * Default initializer + * @param vpath Absoulute path on disk + * @param ndim Number of dimensions + * @param shape Axis sizes + */ + G2SStorageEntry(const std::string& vpath, int ndim) noexcept : Path(vpath), FileHandle(nullptr) { } + + /** + * Close the descriptor + */ + void close() noexcept { FileHandle = nullptr; ImageData.clear(); } + /** + * Check if file handle is open + * @return Is file handle open + */ + bool isOpen() noexcept { return FileHandle != nullptr; } + + std::string Path; ///< Absoulute path on disk + std::vector ImageData; ///< Current image data + void* FileHandle; ///< File handle +}; diff --git a/DeviceAdapters/go2scope/go2scope.vcxproj b/DeviceAdapters/go2scope/go2scope.vcxproj new file mode 100644 index 000000000..e30bbbd80 --- /dev/null +++ b/DeviceAdapters/go2scope/go2scope.vcxproj @@ -0,0 +1,124 @@ + + + + + Debug + x64 + + + Release + x64 + + + + Go2Scope + {2916e620-1157-4154-8223-887d383e9de6} + Go2Scope + Win32Proj + 10.0 + + + + DynamicLibrary + Unicode + v142 + false + + + DynamicLibrary + Unicode + v142 + true + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.40219.1 + true + false + + + + X64 + + + Disabled + NOMINMAX;WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + EnableFastChecks + true + + + 4290;%(DisableSpecificWarnings) + $(MM_3RDPARTYPRIVATE)\czi\acquire-zarr\include;%(AdditionalIncludeDirectories) + MultiThreadedDebug + stdcpp17 + + + Windows + + + $(MM_3RDPARTYPRIVATE)\CZI\acquire-zarr\lib;%(AdditionalLibraryDirectories) + acquire-zarr.lib;%(AdditionalDependencies) + + + + + X64 + + + NOMINMAX;WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + + + 4290;%(DisableSpecificWarnings) + $(MM_3RDPARTYPRIVATE)\czi\acquire-zarr\include;%(AdditionalIncludeDirectories) + MultiThreaded + stdcpp17 + + + Windows + true + true + + + $(MM_3RDPARTYPRIVATE)\CZI\acquire-zarr\lib;%(AdditionalLibraryDirectories) + acquire-zarr.lib;%(AdditionalDependencies) + + + + + + + + + + + + + + + + + + + + + {af3143a4-5529-4c78-a01a-9f2a8977ed64} + + + + + + \ No newline at end of file diff --git a/DeviceAdapters/go2scope/go2scope.vcxproj.filters b/DeviceAdapters/go2scope/go2scope.vcxproj.filters new file mode 100644 index 000000000..08a26d734 --- /dev/null +++ b/DeviceAdapters/go2scope/go2scope.vcxproj.filters @@ -0,0 +1,51 @@ + + + + + {52a0a423-e1bc-49cf-9983-c785611e671f} + + + {891fcdc1-6279-4733-a91f-9e785177f914} + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + \ No newline at end of file diff --git a/DeviceAdapters/go2scope/nlohmann/json.hpp b/DeviceAdapters/go2scope/nlohmann/json.hpp new file mode 100644 index 000000000..8b72ea653 --- /dev/null +++ b/DeviceAdapters/go2scope/nlohmann/json.hpp @@ -0,0 +1,24765 @@ +// __ _____ _____ _____ +// __| | __| | | | JSON for Modern C++ +// | | |__ | | | | | | version 3.11.3 +// |_____|_____|_____|_|___| https://github.com/nlohmann/json +// +// SPDX-FileCopyrightText: 2013-2023 Niels Lohmann +// SPDX-License-Identifier: MIT + +/****************************************************************************\ + * Note on documentation: The source files contain links to the online * + * documentation of the public API at https://json.nlohmann.me. This URL * + * contains the most recent documentation and should also be applicable to * + * previous versions; documentation for deprecated functions is not * + * removed, but marked deprecated. See "Generate documentation" section in * + * file docs/README.md. * +\****************************************************************************/ + +#ifndef INCLUDE_NLOHMANN_JSON_HPP_ +#define INCLUDE_NLOHMANN_JSON_HPP_ + +#include // all_of, find, for_each +#include // nullptr_t, ptrdiff_t, size_t +#include // hash, less +#include // initializer_list +#ifndef JSON_NO_IO + #include // istream, ostream +#endif // JSON_NO_IO +#include // random_access_iterator_tag +#include // unique_ptr +#include // string, stoi, to_string +#include // declval, forward, move, pair, swap +#include // vector + +// #include +// __ _____ _____ _____ +// __| | __| | | | JSON for Modern C++ +// | | |__ | | | | | | version 3.11.3 +// |_____|_____|_____|_|___| https://github.com/nlohmann/json +// +// SPDX-FileCopyrightText: 2013-2023 Niels Lohmann +// SPDX-License-Identifier: MIT + + + +#include + +// #include +// __ _____ _____ _____ +// __| | __| | | | JSON for Modern C++ +// | | |__ | | | | | | version 3.11.3 +// |_____|_____|_____|_|___| https://github.com/nlohmann/json +// +// SPDX-FileCopyrightText: 2013-2023 Niels Lohmann +// SPDX-License-Identifier: MIT + + + +// This file contains all macro definitions affecting or depending on the ABI + +#ifndef JSON_SKIP_LIBRARY_VERSION_CHECK + #if defined(NLOHMANN_JSON_VERSION_MAJOR) && defined(NLOHMANN_JSON_VERSION_MINOR) && defined(NLOHMANN_JSON_VERSION_PATCH) + #if NLOHMANN_JSON_VERSION_MAJOR != 3 || NLOHMANN_JSON_VERSION_MINOR != 11 || NLOHMANN_JSON_VERSION_PATCH != 3 + #warning "Already included a different version of the library!" + #endif + #endif +#endif + +#define NLOHMANN_JSON_VERSION_MAJOR 3 // NOLINT(modernize-macro-to-enum) +#define NLOHMANN_JSON_VERSION_MINOR 11 // NOLINT(modernize-macro-to-enum) +#define NLOHMANN_JSON_VERSION_PATCH 3 // NOLINT(modernize-macro-to-enum) + +#ifndef JSON_DIAGNOSTICS + #define JSON_DIAGNOSTICS 0 +#endif + +#ifndef JSON_USE_LEGACY_DISCARDED_VALUE_COMPARISON + #define JSON_USE_LEGACY_DISCARDED_VALUE_COMPARISON 0 +#endif + +#if JSON_DIAGNOSTICS + #define NLOHMANN_JSON_ABI_TAG_DIAGNOSTICS _diag +#else + #define NLOHMANN_JSON_ABI_TAG_DIAGNOSTICS +#endif + +#if JSON_USE_LEGACY_DISCARDED_VALUE_COMPARISON + #define NLOHMANN_JSON_ABI_TAG_LEGACY_DISCARDED_VALUE_COMPARISON _ldvcmp +#else + #define NLOHMANN_JSON_ABI_TAG_LEGACY_DISCARDED_VALUE_COMPARISON +#endif + +#ifndef NLOHMANN_JSON_NAMESPACE_NO_VERSION + #define NLOHMANN_JSON_NAMESPACE_NO_VERSION 0 +#endif + +// Construct the namespace ABI tags component +#define NLOHMANN_JSON_ABI_TAGS_CONCAT_EX(a, b) json_abi ## a ## b +#define NLOHMANN_JSON_ABI_TAGS_CONCAT(a, b) \ + NLOHMANN_JSON_ABI_TAGS_CONCAT_EX(a, b) + +#define NLOHMANN_JSON_ABI_TAGS \ + NLOHMANN_JSON_ABI_TAGS_CONCAT( \ + NLOHMANN_JSON_ABI_TAG_DIAGNOSTICS, \ + NLOHMANN_JSON_ABI_TAG_LEGACY_DISCARDED_VALUE_COMPARISON) + +// Construct the namespace version component +#define NLOHMANN_JSON_NAMESPACE_VERSION_CONCAT_EX(major, minor, patch) \ + _v ## major ## _ ## minor ## _ ## patch +#define NLOHMANN_JSON_NAMESPACE_VERSION_CONCAT(major, minor, patch) \ + NLOHMANN_JSON_NAMESPACE_VERSION_CONCAT_EX(major, minor, patch) + +#if NLOHMANN_JSON_NAMESPACE_NO_VERSION +#define NLOHMANN_JSON_NAMESPACE_VERSION +#else +#define NLOHMANN_JSON_NAMESPACE_VERSION \ + NLOHMANN_JSON_NAMESPACE_VERSION_CONCAT(NLOHMANN_JSON_VERSION_MAJOR, \ + NLOHMANN_JSON_VERSION_MINOR, \ + NLOHMANN_JSON_VERSION_PATCH) +#endif + +// Combine namespace components +#define NLOHMANN_JSON_NAMESPACE_CONCAT_EX(a, b) a ## b +#define NLOHMANN_JSON_NAMESPACE_CONCAT(a, b) \ + NLOHMANN_JSON_NAMESPACE_CONCAT_EX(a, b) + +#ifndef NLOHMANN_JSON_NAMESPACE +#define NLOHMANN_JSON_NAMESPACE \ + nlohmann::NLOHMANN_JSON_NAMESPACE_CONCAT( \ + NLOHMANN_JSON_ABI_TAGS, \ + NLOHMANN_JSON_NAMESPACE_VERSION) +#endif + +#ifndef NLOHMANN_JSON_NAMESPACE_BEGIN +#define NLOHMANN_JSON_NAMESPACE_BEGIN \ + namespace nlohmann \ + { \ + inline namespace NLOHMANN_JSON_NAMESPACE_CONCAT( \ + NLOHMANN_JSON_ABI_TAGS, \ + NLOHMANN_JSON_NAMESPACE_VERSION) \ + { +#endif + +#ifndef NLOHMANN_JSON_NAMESPACE_END +#define NLOHMANN_JSON_NAMESPACE_END \ + } /* namespace (inline namespace) NOLINT(readability/namespace) */ \ + } // namespace nlohmann +#endif + +// #include +// __ _____ _____ _____ +// __| | __| | | | JSON for Modern C++ +// | | |__ | | | | | | version 3.11.3 +// |_____|_____|_____|_|___| https://github.com/nlohmann/json +// +// SPDX-FileCopyrightText: 2013-2023 Niels Lohmann +// SPDX-License-Identifier: MIT + + + +#include // transform +#include // array +#include // forward_list +#include // inserter, front_inserter, end +#include // map +#include // string +#include // tuple, make_tuple +#include // is_arithmetic, is_same, is_enum, underlying_type, is_convertible +#include // unordered_map +#include // pair, declval +#include // valarray + +// #include +// __ _____ _____ _____ +// __| | __| | | | JSON for Modern C++ +// | | |__ | | | | | | version 3.11.3 +// |_____|_____|_____|_|___| https://github.com/nlohmann/json +// +// SPDX-FileCopyrightText: 2013-2023 Niels Lohmann +// SPDX-License-Identifier: MIT + + + +#include // nullptr_t +#include // exception +#if JSON_DIAGNOSTICS + #include // accumulate +#endif +#include // runtime_error +#include // to_string +#include // vector + +// #include +// __ _____ _____ _____ +// __| | __| | | | JSON for Modern C++ +// | | |__ | | | | | | version 3.11.3 +// |_____|_____|_____|_|___| https://github.com/nlohmann/json +// +// SPDX-FileCopyrightText: 2013-2023 Niels Lohmann +// SPDX-License-Identifier: MIT + + + +#include // array +#include // size_t +#include // uint8_t +#include // string + +// #include +// __ _____ _____ _____ +// __| | __| | | | JSON for Modern C++ +// | | |__ | | | | | | version 3.11.3 +// |_____|_____|_____|_|___| https://github.com/nlohmann/json +// +// SPDX-FileCopyrightText: 2013-2023 Niels Lohmann +// SPDX-License-Identifier: MIT + + + +#include // declval, pair +// #include +// __ _____ _____ _____ +// __| | __| | | | JSON for Modern C++ +// | | |__ | | | | | | version 3.11.3 +// |_____|_____|_____|_|___| https://github.com/nlohmann/json +// +// SPDX-FileCopyrightText: 2013-2023 Niels Lohmann +// SPDX-License-Identifier: MIT + + + +#include + +// #include +// __ _____ _____ _____ +// __| | __| | | | JSON for Modern C++ +// | | |__ | | | | | | version 3.11.3 +// |_____|_____|_____|_|___| https://github.com/nlohmann/json +// +// SPDX-FileCopyrightText: 2013-2023 Niels Lohmann +// SPDX-License-Identifier: MIT + + + +// #include + + +NLOHMANN_JSON_NAMESPACE_BEGIN +namespace detail +{ + +template struct make_void +{ + using type = void; +}; +template using void_t = typename make_void::type; + +} // namespace detail +NLOHMANN_JSON_NAMESPACE_END + + +NLOHMANN_JSON_NAMESPACE_BEGIN +namespace detail +{ + +// https://en.cppreference.com/w/cpp/experimental/is_detected +struct nonesuch +{ + nonesuch() = delete; + ~nonesuch() = delete; + nonesuch(nonesuch const&) = delete; + nonesuch(nonesuch const&&) = delete; + void operator=(nonesuch const&) = delete; + void operator=(nonesuch&&) = delete; +}; + +template class Op, + class... Args> +struct detector +{ + using value_t = std::false_type; + using type = Default; +}; + +template class Op, class... Args> +struct detector>, Op, Args...> +{ + using value_t = std::true_type; + using type = Op; +}; + +template class Op, class... Args> +using is_detected = typename detector::value_t; + +template class Op, class... Args> +struct is_detected_lazy : is_detected { }; + +template class Op, class... Args> +using detected_t = typename detector::type; + +template class Op, class... Args> +using detected_or = detector; + +template class Op, class... Args> +using detected_or_t = typename detected_or::type; + +template class Op, class... Args> +using is_detected_exact = std::is_same>; + +template class Op, class... Args> +using is_detected_convertible = + std::is_convertible, To>; + +} // namespace detail +NLOHMANN_JSON_NAMESPACE_END + +// #include + + +// __ _____ _____ _____ +// __| | __| | | | JSON for Modern C++ +// | | |__ | | | | | | version 3.11.3 +// |_____|_____|_____|_|___| https://github.com/nlohmann/json +// +// SPDX-FileCopyrightText: 2013-2023 Niels Lohmann +// SPDX-FileCopyrightText: 2016-2021 Evan Nemerson +// SPDX-License-Identifier: MIT + +/* Hedley - https://nemequ.github.io/hedley + * Created by Evan Nemerson + */ + +#if !defined(JSON_HEDLEY_VERSION) || (JSON_HEDLEY_VERSION < 15) +#if defined(JSON_HEDLEY_VERSION) + #undef JSON_HEDLEY_VERSION +#endif +#define JSON_HEDLEY_VERSION 15 + +#if defined(JSON_HEDLEY_STRINGIFY_EX) + #undef JSON_HEDLEY_STRINGIFY_EX +#endif +#define JSON_HEDLEY_STRINGIFY_EX(x) #x + +#if defined(JSON_HEDLEY_STRINGIFY) + #undef JSON_HEDLEY_STRINGIFY +#endif +#define JSON_HEDLEY_STRINGIFY(x) JSON_HEDLEY_STRINGIFY_EX(x) + +#if defined(JSON_HEDLEY_CONCAT_EX) + #undef JSON_HEDLEY_CONCAT_EX +#endif +#define JSON_HEDLEY_CONCAT_EX(a,b) a##b + +#if defined(JSON_HEDLEY_CONCAT) + #undef JSON_HEDLEY_CONCAT +#endif +#define JSON_HEDLEY_CONCAT(a,b) JSON_HEDLEY_CONCAT_EX(a,b) + +#if defined(JSON_HEDLEY_CONCAT3_EX) + #undef JSON_HEDLEY_CONCAT3_EX +#endif +#define JSON_HEDLEY_CONCAT3_EX(a,b,c) a##b##c + +#if defined(JSON_HEDLEY_CONCAT3) + #undef JSON_HEDLEY_CONCAT3 +#endif +#define JSON_HEDLEY_CONCAT3(a,b,c) JSON_HEDLEY_CONCAT3_EX(a,b,c) + +#if defined(JSON_HEDLEY_VERSION_ENCODE) + #undef JSON_HEDLEY_VERSION_ENCODE +#endif +#define JSON_HEDLEY_VERSION_ENCODE(major,minor,revision) (((major) * 1000000) + ((minor) * 1000) + (revision)) + +#if defined(JSON_HEDLEY_VERSION_DECODE_MAJOR) + #undef JSON_HEDLEY_VERSION_DECODE_MAJOR +#endif +#define JSON_HEDLEY_VERSION_DECODE_MAJOR(version) ((version) / 1000000) + +#if defined(JSON_HEDLEY_VERSION_DECODE_MINOR) + #undef JSON_HEDLEY_VERSION_DECODE_MINOR +#endif +#define JSON_HEDLEY_VERSION_DECODE_MINOR(version) (((version) % 1000000) / 1000) + +#if defined(JSON_HEDLEY_VERSION_DECODE_REVISION) + #undef JSON_HEDLEY_VERSION_DECODE_REVISION +#endif +#define JSON_HEDLEY_VERSION_DECODE_REVISION(version) ((version) % 1000) + +#if defined(JSON_HEDLEY_GNUC_VERSION) + #undef JSON_HEDLEY_GNUC_VERSION +#endif +#if defined(__GNUC__) && defined(__GNUC_PATCHLEVEL__) + #define JSON_HEDLEY_GNUC_VERSION JSON_HEDLEY_VERSION_ENCODE(__GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__) +#elif defined(__GNUC__) + #define JSON_HEDLEY_GNUC_VERSION JSON_HEDLEY_VERSION_ENCODE(__GNUC__, __GNUC_MINOR__, 0) +#endif + +#if defined(JSON_HEDLEY_GNUC_VERSION_CHECK) + #undef JSON_HEDLEY_GNUC_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_GNUC_VERSION) + #define JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_GNUC_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_MSVC_VERSION) + #undef JSON_HEDLEY_MSVC_VERSION +#endif +#if defined(_MSC_FULL_VER) && (_MSC_FULL_VER >= 140000000) && !defined(__ICL) + #define JSON_HEDLEY_MSVC_VERSION JSON_HEDLEY_VERSION_ENCODE(_MSC_FULL_VER / 10000000, (_MSC_FULL_VER % 10000000) / 100000, (_MSC_FULL_VER % 100000) / 100) +#elif defined(_MSC_FULL_VER) && !defined(__ICL) + #define JSON_HEDLEY_MSVC_VERSION JSON_HEDLEY_VERSION_ENCODE(_MSC_FULL_VER / 1000000, (_MSC_FULL_VER % 1000000) / 10000, (_MSC_FULL_VER % 10000) / 10) +#elif defined(_MSC_VER) && !defined(__ICL) + #define JSON_HEDLEY_MSVC_VERSION JSON_HEDLEY_VERSION_ENCODE(_MSC_VER / 100, _MSC_VER % 100, 0) +#endif + +#if defined(JSON_HEDLEY_MSVC_VERSION_CHECK) + #undef JSON_HEDLEY_MSVC_VERSION_CHECK +#endif +#if !defined(JSON_HEDLEY_MSVC_VERSION) + #define JSON_HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (0) +#elif defined(_MSC_VER) && (_MSC_VER >= 1400) + #define JSON_HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (_MSC_FULL_VER >= ((major * 10000000) + (minor * 100000) + (patch))) +#elif defined(_MSC_VER) && (_MSC_VER >= 1200) + #define JSON_HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (_MSC_FULL_VER >= ((major * 1000000) + (minor * 10000) + (patch))) +#else + #define JSON_HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (_MSC_VER >= ((major * 100) + (minor))) +#endif + +#if defined(JSON_HEDLEY_INTEL_VERSION) + #undef JSON_HEDLEY_INTEL_VERSION +#endif +#if defined(__INTEL_COMPILER) && defined(__INTEL_COMPILER_UPDATE) && !defined(__ICL) + #define JSON_HEDLEY_INTEL_VERSION JSON_HEDLEY_VERSION_ENCODE(__INTEL_COMPILER / 100, __INTEL_COMPILER % 100, __INTEL_COMPILER_UPDATE) +#elif defined(__INTEL_COMPILER) && !defined(__ICL) + #define JSON_HEDLEY_INTEL_VERSION JSON_HEDLEY_VERSION_ENCODE(__INTEL_COMPILER / 100, __INTEL_COMPILER % 100, 0) +#endif + +#if defined(JSON_HEDLEY_INTEL_VERSION_CHECK) + #undef JSON_HEDLEY_INTEL_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_INTEL_VERSION) + #define JSON_HEDLEY_INTEL_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_INTEL_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_INTEL_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_INTEL_CL_VERSION) + #undef JSON_HEDLEY_INTEL_CL_VERSION +#endif +#if defined(__INTEL_COMPILER) && defined(__INTEL_COMPILER_UPDATE) && defined(__ICL) + #define JSON_HEDLEY_INTEL_CL_VERSION JSON_HEDLEY_VERSION_ENCODE(__INTEL_COMPILER, __INTEL_COMPILER_UPDATE, 0) +#endif + +#if defined(JSON_HEDLEY_INTEL_CL_VERSION_CHECK) + #undef JSON_HEDLEY_INTEL_CL_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_INTEL_CL_VERSION) + #define JSON_HEDLEY_INTEL_CL_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_INTEL_CL_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_INTEL_CL_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_PGI_VERSION) + #undef JSON_HEDLEY_PGI_VERSION +#endif +#if defined(__PGI) && defined(__PGIC__) && defined(__PGIC_MINOR__) && defined(__PGIC_PATCHLEVEL__) + #define JSON_HEDLEY_PGI_VERSION JSON_HEDLEY_VERSION_ENCODE(__PGIC__, __PGIC_MINOR__, __PGIC_PATCHLEVEL__) +#endif + +#if defined(JSON_HEDLEY_PGI_VERSION_CHECK) + #undef JSON_HEDLEY_PGI_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_PGI_VERSION) + #define JSON_HEDLEY_PGI_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_PGI_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_PGI_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_SUNPRO_VERSION) + #undef JSON_HEDLEY_SUNPRO_VERSION +#endif +#if defined(__SUNPRO_C) && (__SUNPRO_C > 0x1000) + #define JSON_HEDLEY_SUNPRO_VERSION JSON_HEDLEY_VERSION_ENCODE((((__SUNPRO_C >> 16) & 0xf) * 10) + ((__SUNPRO_C >> 12) & 0xf), (((__SUNPRO_C >> 8) & 0xf) * 10) + ((__SUNPRO_C >> 4) & 0xf), (__SUNPRO_C & 0xf) * 10) +#elif defined(__SUNPRO_C) + #define JSON_HEDLEY_SUNPRO_VERSION JSON_HEDLEY_VERSION_ENCODE((__SUNPRO_C >> 8) & 0xf, (__SUNPRO_C >> 4) & 0xf, (__SUNPRO_C) & 0xf) +#elif defined(__SUNPRO_CC) && (__SUNPRO_CC > 0x1000) + #define JSON_HEDLEY_SUNPRO_VERSION JSON_HEDLEY_VERSION_ENCODE((((__SUNPRO_CC >> 16) & 0xf) * 10) + ((__SUNPRO_CC >> 12) & 0xf), (((__SUNPRO_CC >> 8) & 0xf) * 10) + ((__SUNPRO_CC >> 4) & 0xf), (__SUNPRO_CC & 0xf) * 10) +#elif defined(__SUNPRO_CC) + #define JSON_HEDLEY_SUNPRO_VERSION JSON_HEDLEY_VERSION_ENCODE((__SUNPRO_CC >> 8) & 0xf, (__SUNPRO_CC >> 4) & 0xf, (__SUNPRO_CC) & 0xf) +#endif + +#if defined(JSON_HEDLEY_SUNPRO_VERSION_CHECK) + #undef JSON_HEDLEY_SUNPRO_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_SUNPRO_VERSION) + #define JSON_HEDLEY_SUNPRO_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_SUNPRO_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_SUNPRO_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_EMSCRIPTEN_VERSION) + #undef JSON_HEDLEY_EMSCRIPTEN_VERSION +#endif +#if defined(__EMSCRIPTEN__) + #define JSON_HEDLEY_EMSCRIPTEN_VERSION JSON_HEDLEY_VERSION_ENCODE(__EMSCRIPTEN_major__, __EMSCRIPTEN_minor__, __EMSCRIPTEN_tiny__) +#endif + +#if defined(JSON_HEDLEY_EMSCRIPTEN_VERSION_CHECK) + #undef JSON_HEDLEY_EMSCRIPTEN_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_EMSCRIPTEN_VERSION) + #define JSON_HEDLEY_EMSCRIPTEN_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_EMSCRIPTEN_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_EMSCRIPTEN_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_ARM_VERSION) + #undef JSON_HEDLEY_ARM_VERSION +#endif +#if defined(__CC_ARM) && defined(__ARMCOMPILER_VERSION) + #define JSON_HEDLEY_ARM_VERSION JSON_HEDLEY_VERSION_ENCODE(__ARMCOMPILER_VERSION / 1000000, (__ARMCOMPILER_VERSION % 1000000) / 10000, (__ARMCOMPILER_VERSION % 10000) / 100) +#elif defined(__CC_ARM) && defined(__ARMCC_VERSION) + #define JSON_HEDLEY_ARM_VERSION JSON_HEDLEY_VERSION_ENCODE(__ARMCC_VERSION / 1000000, (__ARMCC_VERSION % 1000000) / 10000, (__ARMCC_VERSION % 10000) / 100) +#endif + +#if defined(JSON_HEDLEY_ARM_VERSION_CHECK) + #undef JSON_HEDLEY_ARM_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_ARM_VERSION) + #define JSON_HEDLEY_ARM_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_ARM_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_ARM_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_IBM_VERSION) + #undef JSON_HEDLEY_IBM_VERSION +#endif +#if defined(__ibmxl__) + #define JSON_HEDLEY_IBM_VERSION JSON_HEDLEY_VERSION_ENCODE(__ibmxl_version__, __ibmxl_release__, __ibmxl_modification__) +#elif defined(__xlC__) && defined(__xlC_ver__) + #define JSON_HEDLEY_IBM_VERSION JSON_HEDLEY_VERSION_ENCODE(__xlC__ >> 8, __xlC__ & 0xff, (__xlC_ver__ >> 8) & 0xff) +#elif defined(__xlC__) + #define JSON_HEDLEY_IBM_VERSION JSON_HEDLEY_VERSION_ENCODE(__xlC__ >> 8, __xlC__ & 0xff, 0) +#endif + +#if defined(JSON_HEDLEY_IBM_VERSION_CHECK) + #undef JSON_HEDLEY_IBM_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_IBM_VERSION) + #define JSON_HEDLEY_IBM_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_IBM_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_IBM_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_TI_VERSION) + #undef JSON_HEDLEY_TI_VERSION +#endif +#if \ + defined(__TI_COMPILER_VERSION__) && \ + ( \ + defined(__TMS470__) || defined(__TI_ARM__) || \ + defined(__MSP430__) || \ + defined(__TMS320C2000__) \ + ) +#if (__TI_COMPILER_VERSION__ >= 16000000) + #define JSON_HEDLEY_TI_VERSION JSON_HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000)) +#endif +#endif + +#if defined(JSON_HEDLEY_TI_VERSION_CHECK) + #undef JSON_HEDLEY_TI_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_TI_VERSION) + #define JSON_HEDLEY_TI_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_TI_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_TI_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_TI_CL2000_VERSION) + #undef JSON_HEDLEY_TI_CL2000_VERSION +#endif +#if defined(__TI_COMPILER_VERSION__) && defined(__TMS320C2000__) + #define JSON_HEDLEY_TI_CL2000_VERSION JSON_HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000)) +#endif + +#if defined(JSON_HEDLEY_TI_CL2000_VERSION_CHECK) + #undef JSON_HEDLEY_TI_CL2000_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_TI_CL2000_VERSION) + #define JSON_HEDLEY_TI_CL2000_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_TI_CL2000_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_TI_CL2000_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_TI_CL430_VERSION) + #undef JSON_HEDLEY_TI_CL430_VERSION +#endif +#if defined(__TI_COMPILER_VERSION__) && defined(__MSP430__) + #define JSON_HEDLEY_TI_CL430_VERSION JSON_HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000)) +#endif + +#if defined(JSON_HEDLEY_TI_CL430_VERSION_CHECK) + #undef JSON_HEDLEY_TI_CL430_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_TI_CL430_VERSION) + #define JSON_HEDLEY_TI_CL430_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_TI_CL430_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_TI_CL430_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_TI_ARMCL_VERSION) + #undef JSON_HEDLEY_TI_ARMCL_VERSION +#endif +#if defined(__TI_COMPILER_VERSION__) && (defined(__TMS470__) || defined(__TI_ARM__)) + #define JSON_HEDLEY_TI_ARMCL_VERSION JSON_HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000)) +#endif + +#if defined(JSON_HEDLEY_TI_ARMCL_VERSION_CHECK) + #undef JSON_HEDLEY_TI_ARMCL_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_TI_ARMCL_VERSION) + #define JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_TI_ARMCL_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_TI_CL6X_VERSION) + #undef JSON_HEDLEY_TI_CL6X_VERSION +#endif +#if defined(__TI_COMPILER_VERSION__) && defined(__TMS320C6X__) + #define JSON_HEDLEY_TI_CL6X_VERSION JSON_HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000)) +#endif + +#if defined(JSON_HEDLEY_TI_CL6X_VERSION_CHECK) + #undef JSON_HEDLEY_TI_CL6X_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_TI_CL6X_VERSION) + #define JSON_HEDLEY_TI_CL6X_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_TI_CL6X_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_TI_CL6X_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_TI_CL7X_VERSION) + #undef JSON_HEDLEY_TI_CL7X_VERSION +#endif +#if defined(__TI_COMPILER_VERSION__) && defined(__C7000__) + #define JSON_HEDLEY_TI_CL7X_VERSION JSON_HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000)) +#endif + +#if defined(JSON_HEDLEY_TI_CL7X_VERSION_CHECK) + #undef JSON_HEDLEY_TI_CL7X_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_TI_CL7X_VERSION) + #define JSON_HEDLEY_TI_CL7X_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_TI_CL7X_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_TI_CL7X_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_TI_CLPRU_VERSION) + #undef JSON_HEDLEY_TI_CLPRU_VERSION +#endif +#if defined(__TI_COMPILER_VERSION__) && defined(__PRU__) + #define JSON_HEDLEY_TI_CLPRU_VERSION JSON_HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000)) +#endif + +#if defined(JSON_HEDLEY_TI_CLPRU_VERSION_CHECK) + #undef JSON_HEDLEY_TI_CLPRU_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_TI_CLPRU_VERSION) + #define JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_TI_CLPRU_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_CRAY_VERSION) + #undef JSON_HEDLEY_CRAY_VERSION +#endif +#if defined(_CRAYC) + #if defined(_RELEASE_PATCHLEVEL) + #define JSON_HEDLEY_CRAY_VERSION JSON_HEDLEY_VERSION_ENCODE(_RELEASE_MAJOR, _RELEASE_MINOR, _RELEASE_PATCHLEVEL) + #else + #define JSON_HEDLEY_CRAY_VERSION JSON_HEDLEY_VERSION_ENCODE(_RELEASE_MAJOR, _RELEASE_MINOR, 0) + #endif +#endif + +#if defined(JSON_HEDLEY_CRAY_VERSION_CHECK) + #undef JSON_HEDLEY_CRAY_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_CRAY_VERSION) + #define JSON_HEDLEY_CRAY_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_CRAY_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_CRAY_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_IAR_VERSION) + #undef JSON_HEDLEY_IAR_VERSION +#endif +#if defined(__IAR_SYSTEMS_ICC__) + #if __VER__ > 1000 + #define JSON_HEDLEY_IAR_VERSION JSON_HEDLEY_VERSION_ENCODE((__VER__ / 1000000), ((__VER__ / 1000) % 1000), (__VER__ % 1000)) + #else + #define JSON_HEDLEY_IAR_VERSION JSON_HEDLEY_VERSION_ENCODE(__VER__ / 100, __VER__ % 100, 0) + #endif +#endif + +#if defined(JSON_HEDLEY_IAR_VERSION_CHECK) + #undef JSON_HEDLEY_IAR_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_IAR_VERSION) + #define JSON_HEDLEY_IAR_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_IAR_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_IAR_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_TINYC_VERSION) + #undef JSON_HEDLEY_TINYC_VERSION +#endif +#if defined(__TINYC__) + #define JSON_HEDLEY_TINYC_VERSION JSON_HEDLEY_VERSION_ENCODE(__TINYC__ / 1000, (__TINYC__ / 100) % 10, __TINYC__ % 100) +#endif + +#if defined(JSON_HEDLEY_TINYC_VERSION_CHECK) + #undef JSON_HEDLEY_TINYC_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_TINYC_VERSION) + #define JSON_HEDLEY_TINYC_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_TINYC_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_TINYC_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_DMC_VERSION) + #undef JSON_HEDLEY_DMC_VERSION +#endif +#if defined(__DMC__) + #define JSON_HEDLEY_DMC_VERSION JSON_HEDLEY_VERSION_ENCODE(__DMC__ >> 8, (__DMC__ >> 4) & 0xf, __DMC__ & 0xf) +#endif + +#if defined(JSON_HEDLEY_DMC_VERSION_CHECK) + #undef JSON_HEDLEY_DMC_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_DMC_VERSION) + #define JSON_HEDLEY_DMC_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_DMC_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_DMC_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_COMPCERT_VERSION) + #undef JSON_HEDLEY_COMPCERT_VERSION +#endif +#if defined(__COMPCERT_VERSION__) + #define JSON_HEDLEY_COMPCERT_VERSION JSON_HEDLEY_VERSION_ENCODE(__COMPCERT_VERSION__ / 10000, (__COMPCERT_VERSION__ / 100) % 100, __COMPCERT_VERSION__ % 100) +#endif + +#if defined(JSON_HEDLEY_COMPCERT_VERSION_CHECK) + #undef JSON_HEDLEY_COMPCERT_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_COMPCERT_VERSION) + #define JSON_HEDLEY_COMPCERT_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_COMPCERT_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_COMPCERT_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_PELLES_VERSION) + #undef JSON_HEDLEY_PELLES_VERSION +#endif +#if defined(__POCC__) + #define JSON_HEDLEY_PELLES_VERSION JSON_HEDLEY_VERSION_ENCODE(__POCC__ / 100, __POCC__ % 100, 0) +#endif + +#if defined(JSON_HEDLEY_PELLES_VERSION_CHECK) + #undef JSON_HEDLEY_PELLES_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_PELLES_VERSION) + #define JSON_HEDLEY_PELLES_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_PELLES_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_PELLES_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_MCST_LCC_VERSION) + #undef JSON_HEDLEY_MCST_LCC_VERSION +#endif +#if defined(__LCC__) && defined(__LCC_MINOR__) + #define JSON_HEDLEY_MCST_LCC_VERSION JSON_HEDLEY_VERSION_ENCODE(__LCC__ / 100, __LCC__ % 100, __LCC_MINOR__) +#endif + +#if defined(JSON_HEDLEY_MCST_LCC_VERSION_CHECK) + #undef JSON_HEDLEY_MCST_LCC_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_MCST_LCC_VERSION) + #define JSON_HEDLEY_MCST_LCC_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_MCST_LCC_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_MCST_LCC_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_GCC_VERSION) + #undef JSON_HEDLEY_GCC_VERSION +#endif +#if \ + defined(JSON_HEDLEY_GNUC_VERSION) && \ + !defined(__clang__) && \ + !defined(JSON_HEDLEY_INTEL_VERSION) && \ + !defined(JSON_HEDLEY_PGI_VERSION) && \ + !defined(JSON_HEDLEY_ARM_VERSION) && \ + !defined(JSON_HEDLEY_CRAY_VERSION) && \ + !defined(JSON_HEDLEY_TI_VERSION) && \ + !defined(JSON_HEDLEY_TI_ARMCL_VERSION) && \ + !defined(JSON_HEDLEY_TI_CL430_VERSION) && \ + !defined(JSON_HEDLEY_TI_CL2000_VERSION) && \ + !defined(JSON_HEDLEY_TI_CL6X_VERSION) && \ + !defined(JSON_HEDLEY_TI_CL7X_VERSION) && \ + !defined(JSON_HEDLEY_TI_CLPRU_VERSION) && \ + !defined(__COMPCERT__) && \ + !defined(JSON_HEDLEY_MCST_LCC_VERSION) + #define JSON_HEDLEY_GCC_VERSION JSON_HEDLEY_GNUC_VERSION +#endif + +#if defined(JSON_HEDLEY_GCC_VERSION_CHECK) + #undef JSON_HEDLEY_GCC_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_GCC_VERSION) + #define JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_GCC_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_HAS_ATTRIBUTE) + #undef JSON_HEDLEY_HAS_ATTRIBUTE +#endif +#if \ + defined(__has_attribute) && \ + ( \ + (!defined(JSON_HEDLEY_IAR_VERSION) || JSON_HEDLEY_IAR_VERSION_CHECK(8,5,9)) \ + ) +# define JSON_HEDLEY_HAS_ATTRIBUTE(attribute) __has_attribute(attribute) +#else +# define JSON_HEDLEY_HAS_ATTRIBUTE(attribute) (0) +#endif + +#if defined(JSON_HEDLEY_GNUC_HAS_ATTRIBUTE) + #undef JSON_HEDLEY_GNUC_HAS_ATTRIBUTE +#endif +#if defined(__has_attribute) + #define JSON_HEDLEY_GNUC_HAS_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_HAS_ATTRIBUTE(attribute) +#else + #define JSON_HEDLEY_GNUC_HAS_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_GCC_HAS_ATTRIBUTE) + #undef JSON_HEDLEY_GCC_HAS_ATTRIBUTE +#endif +#if defined(__has_attribute) + #define JSON_HEDLEY_GCC_HAS_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_HAS_ATTRIBUTE(attribute) +#else + #define JSON_HEDLEY_GCC_HAS_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_HAS_CPP_ATTRIBUTE) + #undef JSON_HEDLEY_HAS_CPP_ATTRIBUTE +#endif +#if \ + defined(__has_cpp_attribute) && \ + defined(__cplusplus) && \ + (!defined(JSON_HEDLEY_SUNPRO_VERSION) || JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,15,0)) + #define JSON_HEDLEY_HAS_CPP_ATTRIBUTE(attribute) __has_cpp_attribute(attribute) +#else + #define JSON_HEDLEY_HAS_CPP_ATTRIBUTE(attribute) (0) +#endif + +#if defined(JSON_HEDLEY_HAS_CPP_ATTRIBUTE_NS) + #undef JSON_HEDLEY_HAS_CPP_ATTRIBUTE_NS +#endif +#if !defined(__cplusplus) || !defined(__has_cpp_attribute) + #define JSON_HEDLEY_HAS_CPP_ATTRIBUTE_NS(ns,attribute) (0) +#elif \ + !defined(JSON_HEDLEY_PGI_VERSION) && \ + !defined(JSON_HEDLEY_IAR_VERSION) && \ + (!defined(JSON_HEDLEY_SUNPRO_VERSION) || JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,15,0)) && \ + (!defined(JSON_HEDLEY_MSVC_VERSION) || JSON_HEDLEY_MSVC_VERSION_CHECK(19,20,0)) + #define JSON_HEDLEY_HAS_CPP_ATTRIBUTE_NS(ns,attribute) JSON_HEDLEY_HAS_CPP_ATTRIBUTE(ns::attribute) +#else + #define JSON_HEDLEY_HAS_CPP_ATTRIBUTE_NS(ns,attribute) (0) +#endif + +#if defined(JSON_HEDLEY_GNUC_HAS_CPP_ATTRIBUTE) + #undef JSON_HEDLEY_GNUC_HAS_CPP_ATTRIBUTE +#endif +#if defined(__has_cpp_attribute) && defined(__cplusplus) + #define JSON_HEDLEY_GNUC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) __has_cpp_attribute(attribute) +#else + #define JSON_HEDLEY_GNUC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_GCC_HAS_CPP_ATTRIBUTE) + #undef JSON_HEDLEY_GCC_HAS_CPP_ATTRIBUTE +#endif +#if defined(__has_cpp_attribute) && defined(__cplusplus) + #define JSON_HEDLEY_GCC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) __has_cpp_attribute(attribute) +#else + #define JSON_HEDLEY_GCC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_HAS_BUILTIN) + #undef JSON_HEDLEY_HAS_BUILTIN +#endif +#if defined(__has_builtin) + #define JSON_HEDLEY_HAS_BUILTIN(builtin) __has_builtin(builtin) +#else + #define JSON_HEDLEY_HAS_BUILTIN(builtin) (0) +#endif + +#if defined(JSON_HEDLEY_GNUC_HAS_BUILTIN) + #undef JSON_HEDLEY_GNUC_HAS_BUILTIN +#endif +#if defined(__has_builtin) + #define JSON_HEDLEY_GNUC_HAS_BUILTIN(builtin,major,minor,patch) __has_builtin(builtin) +#else + #define JSON_HEDLEY_GNUC_HAS_BUILTIN(builtin,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_GCC_HAS_BUILTIN) + #undef JSON_HEDLEY_GCC_HAS_BUILTIN +#endif +#if defined(__has_builtin) + #define JSON_HEDLEY_GCC_HAS_BUILTIN(builtin,major,minor,patch) __has_builtin(builtin) +#else + #define JSON_HEDLEY_GCC_HAS_BUILTIN(builtin,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_HAS_FEATURE) + #undef JSON_HEDLEY_HAS_FEATURE +#endif +#if defined(__has_feature) + #define JSON_HEDLEY_HAS_FEATURE(feature) __has_feature(feature) +#else + #define JSON_HEDLEY_HAS_FEATURE(feature) (0) +#endif + +#if defined(JSON_HEDLEY_GNUC_HAS_FEATURE) + #undef JSON_HEDLEY_GNUC_HAS_FEATURE +#endif +#if defined(__has_feature) + #define JSON_HEDLEY_GNUC_HAS_FEATURE(feature,major,minor,patch) __has_feature(feature) +#else + #define JSON_HEDLEY_GNUC_HAS_FEATURE(feature,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_GCC_HAS_FEATURE) + #undef JSON_HEDLEY_GCC_HAS_FEATURE +#endif +#if defined(__has_feature) + #define JSON_HEDLEY_GCC_HAS_FEATURE(feature,major,minor,patch) __has_feature(feature) +#else + #define JSON_HEDLEY_GCC_HAS_FEATURE(feature,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_HAS_EXTENSION) + #undef JSON_HEDLEY_HAS_EXTENSION +#endif +#if defined(__has_extension) + #define JSON_HEDLEY_HAS_EXTENSION(extension) __has_extension(extension) +#else + #define JSON_HEDLEY_HAS_EXTENSION(extension) (0) +#endif + +#if defined(JSON_HEDLEY_GNUC_HAS_EXTENSION) + #undef JSON_HEDLEY_GNUC_HAS_EXTENSION +#endif +#if defined(__has_extension) + #define JSON_HEDLEY_GNUC_HAS_EXTENSION(extension,major,minor,patch) __has_extension(extension) +#else + #define JSON_HEDLEY_GNUC_HAS_EXTENSION(extension,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_GCC_HAS_EXTENSION) + #undef JSON_HEDLEY_GCC_HAS_EXTENSION +#endif +#if defined(__has_extension) + #define JSON_HEDLEY_GCC_HAS_EXTENSION(extension,major,minor,patch) __has_extension(extension) +#else + #define JSON_HEDLEY_GCC_HAS_EXTENSION(extension,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE) + #undef JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE +#endif +#if defined(__has_declspec_attribute) + #define JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE(attribute) __has_declspec_attribute(attribute) +#else + #define JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE(attribute) (0) +#endif + +#if defined(JSON_HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE) + #undef JSON_HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE +#endif +#if defined(__has_declspec_attribute) + #define JSON_HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) __has_declspec_attribute(attribute) +#else + #define JSON_HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE) + #undef JSON_HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE +#endif +#if defined(__has_declspec_attribute) + #define JSON_HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) __has_declspec_attribute(attribute) +#else + #define JSON_HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_HAS_WARNING) + #undef JSON_HEDLEY_HAS_WARNING +#endif +#if defined(__has_warning) + #define JSON_HEDLEY_HAS_WARNING(warning) __has_warning(warning) +#else + #define JSON_HEDLEY_HAS_WARNING(warning) (0) +#endif + +#if defined(JSON_HEDLEY_GNUC_HAS_WARNING) + #undef JSON_HEDLEY_GNUC_HAS_WARNING +#endif +#if defined(__has_warning) + #define JSON_HEDLEY_GNUC_HAS_WARNING(warning,major,minor,patch) __has_warning(warning) +#else + #define JSON_HEDLEY_GNUC_HAS_WARNING(warning,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_GCC_HAS_WARNING) + #undef JSON_HEDLEY_GCC_HAS_WARNING +#endif +#if defined(__has_warning) + #define JSON_HEDLEY_GCC_HAS_WARNING(warning,major,minor,patch) __has_warning(warning) +#else + #define JSON_HEDLEY_GCC_HAS_WARNING(warning,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) +#endif + +#if \ + (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) || \ + defined(__clang__) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,0,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) || \ + JSON_HEDLEY_PGI_VERSION_CHECK(18,4,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,7,0) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(2,0,1) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,1,0) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,0,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \ + JSON_HEDLEY_CRAY_VERSION_CHECK(5,0,0) || \ + JSON_HEDLEY_TINYC_VERSION_CHECK(0,9,17) || \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(8,0,0) || \ + (JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) && defined(__C99_PRAGMA_OPERATOR)) + #define JSON_HEDLEY_PRAGMA(value) _Pragma(#value) +#elif JSON_HEDLEY_MSVC_VERSION_CHECK(15,0,0) + #define JSON_HEDLEY_PRAGMA(value) __pragma(value) +#else + #define JSON_HEDLEY_PRAGMA(value) +#endif + +#if defined(JSON_HEDLEY_DIAGNOSTIC_PUSH) + #undef JSON_HEDLEY_DIAGNOSTIC_PUSH +#endif +#if defined(JSON_HEDLEY_DIAGNOSTIC_POP) + #undef JSON_HEDLEY_DIAGNOSTIC_POP +#endif +#if defined(__clang__) + #define JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("clang diagnostic push") + #define JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("clang diagnostic pop") +#elif JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("warning(push)") + #define JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("warning(pop)") +#elif JSON_HEDLEY_GCC_VERSION_CHECK(4,6,0) + #define JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("GCC diagnostic push") + #define JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("GCC diagnostic pop") +#elif \ + JSON_HEDLEY_MSVC_VERSION_CHECK(15,0,0) || \ + JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) + #define JSON_HEDLEY_DIAGNOSTIC_PUSH __pragma(warning(push)) + #define JSON_HEDLEY_DIAGNOSTIC_POP __pragma(warning(pop)) +#elif JSON_HEDLEY_ARM_VERSION_CHECK(5,6,0) + #define JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("push") + #define JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("pop") +#elif \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,4,0) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(8,1,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) + #define JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("diag_push") + #define JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("diag_pop") +#elif JSON_HEDLEY_PELLES_VERSION_CHECK(2,90,0) + #define JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("warning(push)") + #define JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("warning(pop)") +#else + #define JSON_HEDLEY_DIAGNOSTIC_PUSH + #define JSON_HEDLEY_DIAGNOSTIC_POP +#endif + +/* JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_ is for + HEDLEY INTERNAL USE ONLY. API subject to change without notice. */ +#if defined(JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_) + #undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_ +#endif +#if defined(__cplusplus) +# if JSON_HEDLEY_HAS_WARNING("-Wc++98-compat") +# if JSON_HEDLEY_HAS_WARNING("-Wc++17-extensions") +# if JSON_HEDLEY_HAS_WARNING("-Wc++1z-extensions") +# define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(xpr) \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ + _Pragma("clang diagnostic ignored \"-Wc++98-compat\"") \ + _Pragma("clang diagnostic ignored \"-Wc++17-extensions\"") \ + _Pragma("clang diagnostic ignored \"-Wc++1z-extensions\"") \ + xpr \ + JSON_HEDLEY_DIAGNOSTIC_POP +# else +# define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(xpr) \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ + _Pragma("clang diagnostic ignored \"-Wc++98-compat\"") \ + _Pragma("clang diagnostic ignored \"-Wc++17-extensions\"") \ + xpr \ + JSON_HEDLEY_DIAGNOSTIC_POP +# endif +# else +# define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(xpr) \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ + _Pragma("clang diagnostic ignored \"-Wc++98-compat\"") \ + xpr \ + JSON_HEDLEY_DIAGNOSTIC_POP +# endif +# endif +#endif +#if !defined(JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(x) x +#endif + +#if defined(JSON_HEDLEY_CONST_CAST) + #undef JSON_HEDLEY_CONST_CAST +#endif +#if defined(__cplusplus) +# define JSON_HEDLEY_CONST_CAST(T, expr) (const_cast(expr)) +#elif \ + JSON_HEDLEY_HAS_WARNING("-Wcast-qual") || \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,6,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) +# define JSON_HEDLEY_CONST_CAST(T, expr) (__extension__ ({ \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ + JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL \ + ((T) (expr)); \ + JSON_HEDLEY_DIAGNOSTIC_POP \ + })) +#else +# define JSON_HEDLEY_CONST_CAST(T, expr) ((T) (expr)) +#endif + +#if defined(JSON_HEDLEY_REINTERPRET_CAST) + #undef JSON_HEDLEY_REINTERPRET_CAST +#endif +#if defined(__cplusplus) + #define JSON_HEDLEY_REINTERPRET_CAST(T, expr) (reinterpret_cast(expr)) +#else + #define JSON_HEDLEY_REINTERPRET_CAST(T, expr) ((T) (expr)) +#endif + +#if defined(JSON_HEDLEY_STATIC_CAST) + #undef JSON_HEDLEY_STATIC_CAST +#endif +#if defined(__cplusplus) + #define JSON_HEDLEY_STATIC_CAST(T, expr) (static_cast(expr)) +#else + #define JSON_HEDLEY_STATIC_CAST(T, expr) ((T) (expr)) +#endif + +#if defined(JSON_HEDLEY_CPP_CAST) + #undef JSON_HEDLEY_CPP_CAST +#endif +#if defined(__cplusplus) +# if JSON_HEDLEY_HAS_WARNING("-Wold-style-cast") +# define JSON_HEDLEY_CPP_CAST(T, expr) \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ + _Pragma("clang diagnostic ignored \"-Wold-style-cast\"") \ + ((T) (expr)) \ + JSON_HEDLEY_DIAGNOSTIC_POP +# elif JSON_HEDLEY_IAR_VERSION_CHECK(8,3,0) +# define JSON_HEDLEY_CPP_CAST(T, expr) \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ + _Pragma("diag_suppress=Pe137") \ + JSON_HEDLEY_DIAGNOSTIC_POP +# else +# define JSON_HEDLEY_CPP_CAST(T, expr) ((T) (expr)) +# endif +#else +# define JSON_HEDLEY_CPP_CAST(T, expr) (expr) +#endif + +#if defined(JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED) + #undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED +#endif +#if JSON_HEDLEY_HAS_WARNING("-Wdeprecated-declarations") + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("clang diagnostic ignored \"-Wdeprecated-declarations\"") +#elif JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("warning(disable:1478 1786)") +#elif JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED __pragma(warning(disable:1478 1786)) +#elif JSON_HEDLEY_PGI_VERSION_CHECK(20,7,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("diag_suppress 1215,1216,1444,1445") +#elif JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("diag_suppress 1215,1444") +#elif JSON_HEDLEY_GCC_VERSION_CHECK(4,3,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") +#elif JSON_HEDLEY_MSVC_VERSION_CHECK(15,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED __pragma(warning(disable:4996)) +#elif JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("diag_suppress 1215,1444") +#elif \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ + (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("diag_suppress 1291,1718") +#elif JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,13,0) && !defined(__cplusplus) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("error_messages(off,E_DEPRECATED_ATT,E_DEPRECATED_ATT_MESS)") +#elif JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,13,0) && defined(__cplusplus) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("error_messages(off,symdeprecated,symdeprecated2)") +#elif JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("diag_suppress=Pe1444,Pe1215") +#elif JSON_HEDLEY_PELLES_VERSION_CHECK(2,90,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("warn(disable:2241)") +#else + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED +#endif + +#if defined(JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS) + #undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS +#endif +#if JSON_HEDLEY_HAS_WARNING("-Wunknown-pragmas") + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("clang diagnostic ignored \"-Wunknown-pragmas\"") +#elif JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("warning(disable:161)") +#elif JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS __pragma(warning(disable:161)) +#elif JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress 1675") +#elif JSON_HEDLEY_GCC_VERSION_CHECK(4,3,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("GCC diagnostic ignored \"-Wunknown-pragmas\"") +#elif JSON_HEDLEY_MSVC_VERSION_CHECK(15,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS __pragma(warning(disable:4068)) +#elif \ + JSON_HEDLEY_TI_VERSION_CHECK(16,9,0) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(8,0,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,3,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress 163") +#elif JSON_HEDLEY_TI_CL6X_VERSION_CHECK(8,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress 163") +#elif JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress=Pe161") +#elif JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress 161") +#else + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS +#endif + +#if defined(JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES) + #undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES +#endif +#if JSON_HEDLEY_HAS_WARNING("-Wunknown-attributes") + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("clang diagnostic ignored \"-Wunknown-attributes\"") +#elif JSON_HEDLEY_GCC_VERSION_CHECK(4,6,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") +#elif JSON_HEDLEY_INTEL_VERSION_CHECK(17,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("warning(disable:1292)") +#elif JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES __pragma(warning(disable:1292)) +#elif JSON_HEDLEY_MSVC_VERSION_CHECK(19,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES __pragma(warning(disable:5030)) +#elif JSON_HEDLEY_PGI_VERSION_CHECK(20,7,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("diag_suppress 1097,1098") +#elif JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("diag_suppress 1097") +#elif JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,14,0) && defined(__cplusplus) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("error_messages(off,attrskipunsup)") +#elif \ + JSON_HEDLEY_TI_VERSION_CHECK(18,1,0) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(8,3,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("diag_suppress 1173") +#elif JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("diag_suppress=Pe1097") +#elif JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("diag_suppress 1097") +#else + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES +#endif + +#if defined(JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL) + #undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL +#endif +#if JSON_HEDLEY_HAS_WARNING("-Wcast-qual") + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL _Pragma("clang diagnostic ignored \"-Wcast-qual\"") +#elif JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL _Pragma("warning(disable:2203 2331)") +#elif JSON_HEDLEY_GCC_VERSION_CHECK(3,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL _Pragma("GCC diagnostic ignored \"-Wcast-qual\"") +#else + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL +#endif + +#if defined(JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNUSED_FUNCTION) + #undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNUSED_FUNCTION +#endif +#if JSON_HEDLEY_HAS_WARNING("-Wunused-function") + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNUSED_FUNCTION _Pragma("clang diagnostic ignored \"-Wunused-function\"") +#elif JSON_HEDLEY_GCC_VERSION_CHECK(3,4,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNUSED_FUNCTION _Pragma("GCC diagnostic ignored \"-Wunused-function\"") +#elif JSON_HEDLEY_MSVC_VERSION_CHECK(1,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNUSED_FUNCTION __pragma(warning(disable:4505)) +#elif JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNUSED_FUNCTION _Pragma("diag_suppress 3142") +#else + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNUSED_FUNCTION +#endif + +#if defined(JSON_HEDLEY_DEPRECATED) + #undef JSON_HEDLEY_DEPRECATED +#endif +#if defined(JSON_HEDLEY_DEPRECATED_FOR) + #undef JSON_HEDLEY_DEPRECATED_FOR +#endif +#if \ + JSON_HEDLEY_MSVC_VERSION_CHECK(14,0,0) || \ + JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) + #define JSON_HEDLEY_DEPRECATED(since) __declspec(deprecated("Since " # since)) + #define JSON_HEDLEY_DEPRECATED_FOR(since, replacement) __declspec(deprecated("Since " #since "; use " #replacement)) +#elif \ + (JSON_HEDLEY_HAS_EXTENSION(attribute_deprecated_with_message) && !defined(JSON_HEDLEY_IAR_VERSION)) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,5,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(5,6,0) || \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,13,0) || \ + JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(18,1,0) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(18,1,0) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(8,3,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,3,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_DEPRECATED(since) __attribute__((__deprecated__("Since " #since))) + #define JSON_HEDLEY_DEPRECATED_FOR(since, replacement) __attribute__((__deprecated__("Since " #since "; use " #replacement))) +#elif defined(__cplusplus) && (__cplusplus >= 201402L) + #define JSON_HEDLEY_DEPRECATED(since) JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[deprecated("Since " #since)]]) + #define JSON_HEDLEY_DEPRECATED_FOR(since, replacement) JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[deprecated("Since " #since "; use " #replacement)]]) +#elif \ + JSON_HEDLEY_HAS_ATTRIBUTE(deprecated) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,1,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ + (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) || \ + JSON_HEDLEY_IAR_VERSION_CHECK(8,10,0) + #define JSON_HEDLEY_DEPRECATED(since) __attribute__((__deprecated__)) + #define JSON_HEDLEY_DEPRECATED_FOR(since, replacement) __attribute__((__deprecated__)) +#elif \ + JSON_HEDLEY_MSVC_VERSION_CHECK(13,10,0) || \ + JSON_HEDLEY_PELLES_VERSION_CHECK(6,50,0) || \ + JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) + #define JSON_HEDLEY_DEPRECATED(since) __declspec(deprecated) + #define JSON_HEDLEY_DEPRECATED_FOR(since, replacement) __declspec(deprecated) +#elif JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) + #define JSON_HEDLEY_DEPRECATED(since) _Pragma("deprecated") + #define JSON_HEDLEY_DEPRECATED_FOR(since, replacement) _Pragma("deprecated") +#else + #define JSON_HEDLEY_DEPRECATED(since) + #define JSON_HEDLEY_DEPRECATED_FOR(since, replacement) +#endif + +#if defined(JSON_HEDLEY_UNAVAILABLE) + #undef JSON_HEDLEY_UNAVAILABLE +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(warning) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,3,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_UNAVAILABLE(available_since) __attribute__((__warning__("Not available until " #available_since))) +#else + #define JSON_HEDLEY_UNAVAILABLE(available_since) +#endif + +#if defined(JSON_HEDLEY_WARN_UNUSED_RESULT) + #undef JSON_HEDLEY_WARN_UNUSED_RESULT +#endif +#if defined(JSON_HEDLEY_WARN_UNUSED_RESULT_MSG) + #undef JSON_HEDLEY_WARN_UNUSED_RESULT_MSG +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(warn_unused_result) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,4,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ + (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \ + (JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,15,0) && defined(__cplusplus)) || \ + JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_WARN_UNUSED_RESULT __attribute__((__warn_unused_result__)) + #define JSON_HEDLEY_WARN_UNUSED_RESULT_MSG(msg) __attribute__((__warn_unused_result__)) +#elif (JSON_HEDLEY_HAS_CPP_ATTRIBUTE(nodiscard) >= 201907L) + #define JSON_HEDLEY_WARN_UNUSED_RESULT JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[nodiscard]]) + #define JSON_HEDLEY_WARN_UNUSED_RESULT_MSG(msg) JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[nodiscard(msg)]]) +#elif JSON_HEDLEY_HAS_CPP_ATTRIBUTE(nodiscard) + #define JSON_HEDLEY_WARN_UNUSED_RESULT JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[nodiscard]]) + #define JSON_HEDLEY_WARN_UNUSED_RESULT_MSG(msg) JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[nodiscard]]) +#elif defined(_Check_return_) /* SAL */ + #define JSON_HEDLEY_WARN_UNUSED_RESULT _Check_return_ + #define JSON_HEDLEY_WARN_UNUSED_RESULT_MSG(msg) _Check_return_ +#else + #define JSON_HEDLEY_WARN_UNUSED_RESULT + #define JSON_HEDLEY_WARN_UNUSED_RESULT_MSG(msg) +#endif + +#if defined(JSON_HEDLEY_SENTINEL) + #undef JSON_HEDLEY_SENTINEL +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(sentinel) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,0,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(5,4,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_SENTINEL(position) __attribute__((__sentinel__(position))) +#else + #define JSON_HEDLEY_SENTINEL(position) +#endif + +#if defined(JSON_HEDLEY_NO_RETURN) + #undef JSON_HEDLEY_NO_RETURN +#endif +#if JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) + #define JSON_HEDLEY_NO_RETURN __noreturn +#elif \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_NO_RETURN __attribute__((__noreturn__)) +#elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L + #define JSON_HEDLEY_NO_RETURN _Noreturn +#elif defined(__cplusplus) && (__cplusplus >= 201103L) + #define JSON_HEDLEY_NO_RETURN JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[noreturn]]) +#elif \ + JSON_HEDLEY_HAS_ATTRIBUTE(noreturn) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,2,0) || \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ + (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \ + JSON_HEDLEY_IAR_VERSION_CHECK(8,10,0) + #define JSON_HEDLEY_NO_RETURN __attribute__((__noreturn__)) +#elif JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,10,0) + #define JSON_HEDLEY_NO_RETURN _Pragma("does_not_return") +#elif \ + JSON_HEDLEY_MSVC_VERSION_CHECK(13,10,0) || \ + JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) + #define JSON_HEDLEY_NO_RETURN __declspec(noreturn) +#elif JSON_HEDLEY_TI_CL6X_VERSION_CHECK(6,0,0) && defined(__cplusplus) + #define JSON_HEDLEY_NO_RETURN _Pragma("FUNC_NEVER_RETURNS;") +#elif JSON_HEDLEY_COMPCERT_VERSION_CHECK(3,2,0) + #define JSON_HEDLEY_NO_RETURN __attribute((noreturn)) +#elif JSON_HEDLEY_PELLES_VERSION_CHECK(9,0,0) + #define JSON_HEDLEY_NO_RETURN __declspec(noreturn) +#else + #define JSON_HEDLEY_NO_RETURN +#endif + +#if defined(JSON_HEDLEY_NO_ESCAPE) + #undef JSON_HEDLEY_NO_ESCAPE +#endif +#if JSON_HEDLEY_HAS_ATTRIBUTE(noescape) + #define JSON_HEDLEY_NO_ESCAPE __attribute__((__noescape__)) +#else + #define JSON_HEDLEY_NO_ESCAPE +#endif + +#if defined(JSON_HEDLEY_UNREACHABLE) + #undef JSON_HEDLEY_UNREACHABLE +#endif +#if defined(JSON_HEDLEY_UNREACHABLE_RETURN) + #undef JSON_HEDLEY_UNREACHABLE_RETURN +#endif +#if defined(JSON_HEDLEY_ASSUME) + #undef JSON_HEDLEY_ASSUME +#endif +#if \ + JSON_HEDLEY_MSVC_VERSION_CHECK(13,10,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) + #define JSON_HEDLEY_ASSUME(expr) __assume(expr) +#elif JSON_HEDLEY_HAS_BUILTIN(__builtin_assume) + #define JSON_HEDLEY_ASSUME(expr) __builtin_assume(expr) +#elif \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,2,0) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(4,0,0) + #if defined(__cplusplus) + #define JSON_HEDLEY_ASSUME(expr) std::_nassert(expr) + #else + #define JSON_HEDLEY_ASSUME(expr) _nassert(expr) + #endif +#endif +#if \ + (JSON_HEDLEY_HAS_BUILTIN(__builtin_unreachable) && (!defined(JSON_HEDLEY_ARM_VERSION))) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,5,0) || \ + JSON_HEDLEY_PGI_VERSION_CHECK(18,10,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(13,1,5) || \ + JSON_HEDLEY_CRAY_VERSION_CHECK(10,0,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_UNREACHABLE() __builtin_unreachable() +#elif defined(JSON_HEDLEY_ASSUME) + #define JSON_HEDLEY_UNREACHABLE() JSON_HEDLEY_ASSUME(0) +#endif +#if !defined(JSON_HEDLEY_ASSUME) + #if defined(JSON_HEDLEY_UNREACHABLE) + #define JSON_HEDLEY_ASSUME(expr) JSON_HEDLEY_STATIC_CAST(void, ((expr) ? 1 : (JSON_HEDLEY_UNREACHABLE(), 1))) + #else + #define JSON_HEDLEY_ASSUME(expr) JSON_HEDLEY_STATIC_CAST(void, expr) + #endif +#endif +#if defined(JSON_HEDLEY_UNREACHABLE) + #if \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,2,0) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(4,0,0) + #define JSON_HEDLEY_UNREACHABLE_RETURN(value) return (JSON_HEDLEY_STATIC_CAST(void, JSON_HEDLEY_ASSUME(0)), (value)) + #else + #define JSON_HEDLEY_UNREACHABLE_RETURN(value) JSON_HEDLEY_UNREACHABLE() + #endif +#else + #define JSON_HEDLEY_UNREACHABLE_RETURN(value) return (value) +#endif +#if !defined(JSON_HEDLEY_UNREACHABLE) + #define JSON_HEDLEY_UNREACHABLE() JSON_HEDLEY_ASSUME(0) +#endif + +JSON_HEDLEY_DIAGNOSTIC_PUSH +#if JSON_HEDLEY_HAS_WARNING("-Wpedantic") + #pragma clang diagnostic ignored "-Wpedantic" +#endif +#if JSON_HEDLEY_HAS_WARNING("-Wc++98-compat-pedantic") && defined(__cplusplus) + #pragma clang diagnostic ignored "-Wc++98-compat-pedantic" +#endif +#if JSON_HEDLEY_GCC_HAS_WARNING("-Wvariadic-macros",4,0,0) + #if defined(__clang__) + #pragma clang diagnostic ignored "-Wvariadic-macros" + #elif defined(JSON_HEDLEY_GCC_VERSION) + #pragma GCC diagnostic ignored "-Wvariadic-macros" + #endif +#endif +#if defined(JSON_HEDLEY_NON_NULL) + #undef JSON_HEDLEY_NON_NULL +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(nonnull) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,3,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) + #define JSON_HEDLEY_NON_NULL(...) __attribute__((__nonnull__(__VA_ARGS__))) +#else + #define JSON_HEDLEY_NON_NULL(...) +#endif +JSON_HEDLEY_DIAGNOSTIC_POP + +#if defined(JSON_HEDLEY_PRINTF_FORMAT) + #undef JSON_HEDLEY_PRINTF_FORMAT +#endif +#if defined(__MINGW32__) && JSON_HEDLEY_GCC_HAS_ATTRIBUTE(format,4,4,0) && !defined(__USE_MINGW_ANSI_STDIO) + #define JSON_HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) __attribute__((__format__(ms_printf, string_idx, first_to_check))) +#elif defined(__MINGW32__) && JSON_HEDLEY_GCC_HAS_ATTRIBUTE(format,4,4,0) && defined(__USE_MINGW_ANSI_STDIO) + #define JSON_HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) __attribute__((__format__(gnu_printf, string_idx, first_to_check))) +#elif \ + JSON_HEDLEY_HAS_ATTRIBUTE(format) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,1,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(5,6,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ + (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) __attribute__((__format__(__printf__, string_idx, first_to_check))) +#elif JSON_HEDLEY_PELLES_VERSION_CHECK(6,0,0) + #define JSON_HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) __declspec(vaformat(printf,string_idx,first_to_check)) +#else + #define JSON_HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) +#endif + +#if defined(JSON_HEDLEY_CONSTEXPR) + #undef JSON_HEDLEY_CONSTEXPR +#endif +#if defined(__cplusplus) + #if __cplusplus >= 201103L + #define JSON_HEDLEY_CONSTEXPR JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(constexpr) + #endif +#endif +#if !defined(JSON_HEDLEY_CONSTEXPR) + #define JSON_HEDLEY_CONSTEXPR +#endif + +#if defined(JSON_HEDLEY_PREDICT) + #undef JSON_HEDLEY_PREDICT +#endif +#if defined(JSON_HEDLEY_LIKELY) + #undef JSON_HEDLEY_LIKELY +#endif +#if defined(JSON_HEDLEY_UNLIKELY) + #undef JSON_HEDLEY_UNLIKELY +#endif +#if defined(JSON_HEDLEY_UNPREDICTABLE) + #undef JSON_HEDLEY_UNPREDICTABLE +#endif +#if JSON_HEDLEY_HAS_BUILTIN(__builtin_unpredictable) + #define JSON_HEDLEY_UNPREDICTABLE(expr) __builtin_unpredictable((expr)) +#endif +#if \ + (JSON_HEDLEY_HAS_BUILTIN(__builtin_expect_with_probability) && !defined(JSON_HEDLEY_PGI_VERSION)) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(9,0,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) +# define JSON_HEDLEY_PREDICT(expr, value, probability) __builtin_expect_with_probability( (expr), (value), (probability)) +# define JSON_HEDLEY_PREDICT_TRUE(expr, probability) __builtin_expect_with_probability(!!(expr), 1 , (probability)) +# define JSON_HEDLEY_PREDICT_FALSE(expr, probability) __builtin_expect_with_probability(!!(expr), 0 , (probability)) +# define JSON_HEDLEY_LIKELY(expr) __builtin_expect (!!(expr), 1 ) +# define JSON_HEDLEY_UNLIKELY(expr) __builtin_expect (!!(expr), 0 ) +#elif \ + (JSON_HEDLEY_HAS_BUILTIN(__builtin_expect) && !defined(JSON_HEDLEY_INTEL_CL_VERSION)) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,0,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + (JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,15,0) && defined(__cplusplus)) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,7,0) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(3,1,0) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,1,0) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(6,1,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \ + JSON_HEDLEY_TINYC_VERSION_CHECK(0,9,27) || \ + JSON_HEDLEY_CRAY_VERSION_CHECK(8,1,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) +# define JSON_HEDLEY_PREDICT(expr, expected, probability) \ + (((probability) >= 0.9) ? __builtin_expect((expr), (expected)) : (JSON_HEDLEY_STATIC_CAST(void, expected), (expr))) +# define JSON_HEDLEY_PREDICT_TRUE(expr, probability) \ + (__extension__ ({ \ + double hedley_probability_ = (probability); \ + ((hedley_probability_ >= 0.9) ? __builtin_expect(!!(expr), 1) : ((hedley_probability_ <= 0.1) ? __builtin_expect(!!(expr), 0) : !!(expr))); \ + })) +# define JSON_HEDLEY_PREDICT_FALSE(expr, probability) \ + (__extension__ ({ \ + double hedley_probability_ = (probability); \ + ((hedley_probability_ >= 0.9) ? __builtin_expect(!!(expr), 0) : ((hedley_probability_ <= 0.1) ? __builtin_expect(!!(expr), 1) : !!(expr))); \ + })) +# define JSON_HEDLEY_LIKELY(expr) __builtin_expect(!!(expr), 1) +# define JSON_HEDLEY_UNLIKELY(expr) __builtin_expect(!!(expr), 0) +#else +# define JSON_HEDLEY_PREDICT(expr, expected, probability) (JSON_HEDLEY_STATIC_CAST(void, expected), (expr)) +# define JSON_HEDLEY_PREDICT_TRUE(expr, probability) (!!(expr)) +# define JSON_HEDLEY_PREDICT_FALSE(expr, probability) (!!(expr)) +# define JSON_HEDLEY_LIKELY(expr) (!!(expr)) +# define JSON_HEDLEY_UNLIKELY(expr) (!!(expr)) +#endif +#if !defined(JSON_HEDLEY_UNPREDICTABLE) + #define JSON_HEDLEY_UNPREDICTABLE(expr) JSON_HEDLEY_PREDICT(expr, 1, 0.5) +#endif + +#if defined(JSON_HEDLEY_MALLOC) + #undef JSON_HEDLEY_MALLOC +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(malloc) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,1,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(12,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ + (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_MALLOC __attribute__((__malloc__)) +#elif JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,10,0) + #define JSON_HEDLEY_MALLOC _Pragma("returns_new_memory") +#elif \ + JSON_HEDLEY_MSVC_VERSION_CHECK(14,0,0) || \ + JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) + #define JSON_HEDLEY_MALLOC __declspec(restrict) +#else + #define JSON_HEDLEY_MALLOC +#endif + +#if defined(JSON_HEDLEY_PURE) + #undef JSON_HEDLEY_PURE +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(pure) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(2,96,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ + (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \ + JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) +# define JSON_HEDLEY_PURE __attribute__((__pure__)) +#elif JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,10,0) +# define JSON_HEDLEY_PURE _Pragma("does_not_write_global_data") +#elif defined(__cplusplus) && \ + ( \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(2,0,1) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(4,0,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) \ + ) +# define JSON_HEDLEY_PURE _Pragma("FUNC_IS_PURE;") +#else +# define JSON_HEDLEY_PURE +#endif + +#if defined(JSON_HEDLEY_CONST) + #undef JSON_HEDLEY_CONST +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(const) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(2,5,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ + (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \ + JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_CONST __attribute__((__const__)) +#elif \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,10,0) + #define JSON_HEDLEY_CONST _Pragma("no_side_effect") +#else + #define JSON_HEDLEY_CONST JSON_HEDLEY_PURE +#endif + +#if defined(JSON_HEDLEY_RESTRICT) + #undef JSON_HEDLEY_RESTRICT +#endif +#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) && !defined(__cplusplus) + #define JSON_HEDLEY_RESTRICT restrict +#elif \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,1,0) || \ + JSON_HEDLEY_MSVC_VERSION_CHECK(14,0,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,2,4) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(8,1,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + (JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,14,0) && defined(__cplusplus)) || \ + JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) || \ + defined(__clang__) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_RESTRICT __restrict +#elif JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,3,0) && !defined(__cplusplus) + #define JSON_HEDLEY_RESTRICT _Restrict +#else + #define JSON_HEDLEY_RESTRICT +#endif + +#if defined(JSON_HEDLEY_INLINE) + #undef JSON_HEDLEY_INLINE +#endif +#if \ + (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) || \ + (defined(__cplusplus) && (__cplusplus >= 199711L)) + #define JSON_HEDLEY_INLINE inline +#elif \ + defined(JSON_HEDLEY_GCC_VERSION) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(6,2,0) + #define JSON_HEDLEY_INLINE __inline__ +#elif \ + JSON_HEDLEY_MSVC_VERSION_CHECK(12,0,0) || \ + JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,1,0) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(3,1,0) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,2,0) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(8,0,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_INLINE __inline +#else + #define JSON_HEDLEY_INLINE +#endif + +#if defined(JSON_HEDLEY_ALWAYS_INLINE) + #undef JSON_HEDLEY_ALWAYS_INLINE +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(always_inline) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,0,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ + (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) || \ + JSON_HEDLEY_IAR_VERSION_CHECK(8,10,0) +# define JSON_HEDLEY_ALWAYS_INLINE __attribute__((__always_inline__)) JSON_HEDLEY_INLINE +#elif \ + JSON_HEDLEY_MSVC_VERSION_CHECK(12,0,0) || \ + JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) +# define JSON_HEDLEY_ALWAYS_INLINE __forceinline +#elif defined(__cplusplus) && \ + ( \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(6,1,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) \ + ) +# define JSON_HEDLEY_ALWAYS_INLINE _Pragma("FUNC_ALWAYS_INLINE;") +#elif JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) +# define JSON_HEDLEY_ALWAYS_INLINE _Pragma("inline=forced") +#else +# define JSON_HEDLEY_ALWAYS_INLINE JSON_HEDLEY_INLINE +#endif + +#if defined(JSON_HEDLEY_NEVER_INLINE) + #undef JSON_HEDLEY_NEVER_INLINE +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(noinline) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,0,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ + (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) || \ + JSON_HEDLEY_IAR_VERSION_CHECK(8,10,0) + #define JSON_HEDLEY_NEVER_INLINE __attribute__((__noinline__)) +#elif \ + JSON_HEDLEY_MSVC_VERSION_CHECK(13,10,0) || \ + JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) + #define JSON_HEDLEY_NEVER_INLINE __declspec(noinline) +#elif JSON_HEDLEY_PGI_VERSION_CHECK(10,2,0) + #define JSON_HEDLEY_NEVER_INLINE _Pragma("noinline") +#elif JSON_HEDLEY_TI_CL6X_VERSION_CHECK(6,0,0) && defined(__cplusplus) + #define JSON_HEDLEY_NEVER_INLINE _Pragma("FUNC_CANNOT_INLINE;") +#elif JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) + #define JSON_HEDLEY_NEVER_INLINE _Pragma("inline=never") +#elif JSON_HEDLEY_COMPCERT_VERSION_CHECK(3,2,0) + #define JSON_HEDLEY_NEVER_INLINE __attribute((noinline)) +#elif JSON_HEDLEY_PELLES_VERSION_CHECK(9,0,0) + #define JSON_HEDLEY_NEVER_INLINE __declspec(noinline) +#else + #define JSON_HEDLEY_NEVER_INLINE +#endif + +#if defined(JSON_HEDLEY_PRIVATE) + #undef JSON_HEDLEY_PRIVATE +#endif +#if defined(JSON_HEDLEY_PUBLIC) + #undef JSON_HEDLEY_PUBLIC +#endif +#if defined(JSON_HEDLEY_IMPORT) + #undef JSON_HEDLEY_IMPORT +#endif +#if defined(_WIN32) || defined(__CYGWIN__) +# define JSON_HEDLEY_PRIVATE +# define JSON_HEDLEY_PUBLIC __declspec(dllexport) +# define JSON_HEDLEY_IMPORT __declspec(dllimport) +#else +# if \ + JSON_HEDLEY_HAS_ATTRIBUTE(visibility) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,3,0) || \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(13,1,0) || \ + ( \ + defined(__TI_EABI__) && \ + ( \ + (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) \ + ) \ + ) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) +# define JSON_HEDLEY_PRIVATE __attribute__((__visibility__("hidden"))) +# define JSON_HEDLEY_PUBLIC __attribute__((__visibility__("default"))) +# else +# define JSON_HEDLEY_PRIVATE +# define JSON_HEDLEY_PUBLIC +# endif +# define JSON_HEDLEY_IMPORT extern +#endif + +#if defined(JSON_HEDLEY_NO_THROW) + #undef JSON_HEDLEY_NO_THROW +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(nothrow) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,3,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_NO_THROW __attribute__((__nothrow__)) +#elif \ + JSON_HEDLEY_MSVC_VERSION_CHECK(13,1,0) || \ + JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) + #define JSON_HEDLEY_NO_THROW __declspec(nothrow) +#else + #define JSON_HEDLEY_NO_THROW +#endif + +#if defined(JSON_HEDLEY_FALL_THROUGH) + #undef JSON_HEDLEY_FALL_THROUGH +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(fallthrough) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(7,0,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_FALL_THROUGH __attribute__((__fallthrough__)) +#elif JSON_HEDLEY_HAS_CPP_ATTRIBUTE_NS(clang,fallthrough) + #define JSON_HEDLEY_FALL_THROUGH JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[clang::fallthrough]]) +#elif JSON_HEDLEY_HAS_CPP_ATTRIBUTE(fallthrough) + #define JSON_HEDLEY_FALL_THROUGH JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[fallthrough]]) +#elif defined(__fallthrough) /* SAL */ + #define JSON_HEDLEY_FALL_THROUGH __fallthrough +#else + #define JSON_HEDLEY_FALL_THROUGH +#endif + +#if defined(JSON_HEDLEY_RETURNS_NON_NULL) + #undef JSON_HEDLEY_RETURNS_NON_NULL +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(returns_nonnull) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,9,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_RETURNS_NON_NULL __attribute__((__returns_nonnull__)) +#elif defined(_Ret_notnull_) /* SAL */ + #define JSON_HEDLEY_RETURNS_NON_NULL _Ret_notnull_ +#else + #define JSON_HEDLEY_RETURNS_NON_NULL +#endif + +#if defined(JSON_HEDLEY_ARRAY_PARAM) + #undef JSON_HEDLEY_ARRAY_PARAM +#endif +#if \ + defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) && \ + !defined(__STDC_NO_VLA__) && \ + !defined(__cplusplus) && \ + !defined(JSON_HEDLEY_PGI_VERSION) && \ + !defined(JSON_HEDLEY_TINYC_VERSION) + #define JSON_HEDLEY_ARRAY_PARAM(name) (name) +#else + #define JSON_HEDLEY_ARRAY_PARAM(name) +#endif + +#if defined(JSON_HEDLEY_IS_CONSTANT) + #undef JSON_HEDLEY_IS_CONSTANT +#endif +#if defined(JSON_HEDLEY_REQUIRE_CONSTEXPR) + #undef JSON_HEDLEY_REQUIRE_CONSTEXPR +#endif +/* JSON_HEDLEY_IS_CONSTEXPR_ is for + HEDLEY INTERNAL USE ONLY. API subject to change without notice. */ +#if defined(JSON_HEDLEY_IS_CONSTEXPR_) + #undef JSON_HEDLEY_IS_CONSTEXPR_ +#endif +#if \ + JSON_HEDLEY_HAS_BUILTIN(__builtin_constant_p) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,4,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_TINYC_VERSION_CHECK(0,9,19) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(13,1,0) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(6,1,0) || \ + (JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,10,0) && !defined(__cplusplus)) || \ + JSON_HEDLEY_CRAY_VERSION_CHECK(8,1,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_IS_CONSTANT(expr) __builtin_constant_p(expr) +#endif +#if !defined(__cplusplus) +# if \ + JSON_HEDLEY_HAS_BUILTIN(__builtin_types_compatible_p) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,4,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(13,1,0) || \ + JSON_HEDLEY_CRAY_VERSION_CHECK(8,1,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(5,4,0) || \ + JSON_HEDLEY_TINYC_VERSION_CHECK(0,9,24) +#if defined(__INTPTR_TYPE__) + #define JSON_HEDLEY_IS_CONSTEXPR_(expr) __builtin_types_compatible_p(__typeof__((1 ? (void*) ((__INTPTR_TYPE__) ((expr) * 0)) : (int*) 0)), int*) +#else + #include + #define JSON_HEDLEY_IS_CONSTEXPR_(expr) __builtin_types_compatible_p(__typeof__((1 ? (void*) ((intptr_t) ((expr) * 0)) : (int*) 0)), int*) +#endif +# elif \ + ( \ + defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L) && \ + !defined(JSON_HEDLEY_SUNPRO_VERSION) && \ + !defined(JSON_HEDLEY_PGI_VERSION) && \ + !defined(JSON_HEDLEY_IAR_VERSION)) || \ + (JSON_HEDLEY_HAS_EXTENSION(c_generic_selections) && !defined(JSON_HEDLEY_IAR_VERSION)) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,9,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(17,0,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(12,1,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(5,3,0) +#if defined(__INTPTR_TYPE__) + #define JSON_HEDLEY_IS_CONSTEXPR_(expr) _Generic((1 ? (void*) ((__INTPTR_TYPE__) ((expr) * 0)) : (int*) 0), int*: 1, void*: 0) +#else + #include + #define JSON_HEDLEY_IS_CONSTEXPR_(expr) _Generic((1 ? (void*) ((intptr_t) * 0) : (int*) 0), int*: 1, void*: 0) +#endif +# elif \ + defined(JSON_HEDLEY_GCC_VERSION) || \ + defined(JSON_HEDLEY_INTEL_VERSION) || \ + defined(JSON_HEDLEY_TINYC_VERSION) || \ + defined(JSON_HEDLEY_TI_ARMCL_VERSION) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(18,12,0) || \ + defined(JSON_HEDLEY_TI_CL2000_VERSION) || \ + defined(JSON_HEDLEY_TI_CL6X_VERSION) || \ + defined(JSON_HEDLEY_TI_CL7X_VERSION) || \ + defined(JSON_HEDLEY_TI_CLPRU_VERSION) || \ + defined(__clang__) +# define JSON_HEDLEY_IS_CONSTEXPR_(expr) ( \ + sizeof(void) != \ + sizeof(*( \ + 1 ? \ + ((void*) ((expr) * 0L) ) : \ +((struct { char v[sizeof(void) * 2]; } *) 1) \ + ) \ + ) \ + ) +# endif +#endif +#if defined(JSON_HEDLEY_IS_CONSTEXPR_) + #if !defined(JSON_HEDLEY_IS_CONSTANT) + #define JSON_HEDLEY_IS_CONSTANT(expr) JSON_HEDLEY_IS_CONSTEXPR_(expr) + #endif + #define JSON_HEDLEY_REQUIRE_CONSTEXPR(expr) (JSON_HEDLEY_IS_CONSTEXPR_(expr) ? (expr) : (-1)) +#else + #if !defined(JSON_HEDLEY_IS_CONSTANT) + #define JSON_HEDLEY_IS_CONSTANT(expr) (0) + #endif + #define JSON_HEDLEY_REQUIRE_CONSTEXPR(expr) (expr) +#endif + +#if defined(JSON_HEDLEY_BEGIN_C_DECLS) + #undef JSON_HEDLEY_BEGIN_C_DECLS +#endif +#if defined(JSON_HEDLEY_END_C_DECLS) + #undef JSON_HEDLEY_END_C_DECLS +#endif +#if defined(JSON_HEDLEY_C_DECL) + #undef JSON_HEDLEY_C_DECL +#endif +#if defined(__cplusplus) + #define JSON_HEDLEY_BEGIN_C_DECLS extern "C" { + #define JSON_HEDLEY_END_C_DECLS } + #define JSON_HEDLEY_C_DECL extern "C" +#else + #define JSON_HEDLEY_BEGIN_C_DECLS + #define JSON_HEDLEY_END_C_DECLS + #define JSON_HEDLEY_C_DECL +#endif + +#if defined(JSON_HEDLEY_STATIC_ASSERT) + #undef JSON_HEDLEY_STATIC_ASSERT +#endif +#if \ + !defined(__cplusplus) && ( \ + (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L)) || \ + (JSON_HEDLEY_HAS_FEATURE(c_static_assert) && !defined(JSON_HEDLEY_INTEL_CL_VERSION)) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(6,0,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + defined(_Static_assert) \ + ) +# define JSON_HEDLEY_STATIC_ASSERT(expr, message) _Static_assert(expr, message) +#elif \ + (defined(__cplusplus) && (__cplusplus >= 201103L)) || \ + JSON_HEDLEY_MSVC_VERSION_CHECK(16,0,0) || \ + JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) +# define JSON_HEDLEY_STATIC_ASSERT(expr, message) JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(static_assert(expr, message)) +#else +# define JSON_HEDLEY_STATIC_ASSERT(expr, message) +#endif + +#if defined(JSON_HEDLEY_NULL) + #undef JSON_HEDLEY_NULL +#endif +#if defined(__cplusplus) + #if __cplusplus >= 201103L + #define JSON_HEDLEY_NULL JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(nullptr) + #elif defined(NULL) + #define JSON_HEDLEY_NULL NULL + #else + #define JSON_HEDLEY_NULL JSON_HEDLEY_STATIC_CAST(void*, 0) + #endif +#elif defined(NULL) + #define JSON_HEDLEY_NULL NULL +#else + #define JSON_HEDLEY_NULL ((void*) 0) +#endif + +#if defined(JSON_HEDLEY_MESSAGE) + #undef JSON_HEDLEY_MESSAGE +#endif +#if JSON_HEDLEY_HAS_WARNING("-Wunknown-pragmas") +# define JSON_HEDLEY_MESSAGE(msg) \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ + JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS \ + JSON_HEDLEY_PRAGMA(message msg) \ + JSON_HEDLEY_DIAGNOSTIC_POP +#elif \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,4,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) +# define JSON_HEDLEY_MESSAGE(msg) JSON_HEDLEY_PRAGMA(message msg) +#elif JSON_HEDLEY_CRAY_VERSION_CHECK(5,0,0) +# define JSON_HEDLEY_MESSAGE(msg) JSON_HEDLEY_PRAGMA(_CRI message msg) +#elif JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) +# define JSON_HEDLEY_MESSAGE(msg) JSON_HEDLEY_PRAGMA(message(msg)) +#elif JSON_HEDLEY_PELLES_VERSION_CHECK(2,0,0) +# define JSON_HEDLEY_MESSAGE(msg) JSON_HEDLEY_PRAGMA(message(msg)) +#else +# define JSON_HEDLEY_MESSAGE(msg) +#endif + +#if defined(JSON_HEDLEY_WARNING) + #undef JSON_HEDLEY_WARNING +#endif +#if JSON_HEDLEY_HAS_WARNING("-Wunknown-pragmas") +# define JSON_HEDLEY_WARNING(msg) \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ + JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS \ + JSON_HEDLEY_PRAGMA(clang warning msg) \ + JSON_HEDLEY_DIAGNOSTIC_POP +#elif \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,8,0) || \ + JSON_HEDLEY_PGI_VERSION_CHECK(18,4,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) +# define JSON_HEDLEY_WARNING(msg) JSON_HEDLEY_PRAGMA(GCC warning msg) +#elif \ + JSON_HEDLEY_MSVC_VERSION_CHECK(15,0,0) || \ + JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) +# define JSON_HEDLEY_WARNING(msg) JSON_HEDLEY_PRAGMA(message(msg)) +#else +# define JSON_HEDLEY_WARNING(msg) JSON_HEDLEY_MESSAGE(msg) +#endif + +#if defined(JSON_HEDLEY_REQUIRE) + #undef JSON_HEDLEY_REQUIRE +#endif +#if defined(JSON_HEDLEY_REQUIRE_MSG) + #undef JSON_HEDLEY_REQUIRE_MSG +#endif +#if JSON_HEDLEY_HAS_ATTRIBUTE(diagnose_if) +# if JSON_HEDLEY_HAS_WARNING("-Wgcc-compat") +# define JSON_HEDLEY_REQUIRE(expr) \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ + _Pragma("clang diagnostic ignored \"-Wgcc-compat\"") \ + __attribute__((diagnose_if(!(expr), #expr, "error"))) \ + JSON_HEDLEY_DIAGNOSTIC_POP +# define JSON_HEDLEY_REQUIRE_MSG(expr,msg) \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ + _Pragma("clang diagnostic ignored \"-Wgcc-compat\"") \ + __attribute__((diagnose_if(!(expr), msg, "error"))) \ + JSON_HEDLEY_DIAGNOSTIC_POP +# else +# define JSON_HEDLEY_REQUIRE(expr) __attribute__((diagnose_if(!(expr), #expr, "error"))) +# define JSON_HEDLEY_REQUIRE_MSG(expr,msg) __attribute__((diagnose_if(!(expr), msg, "error"))) +# endif +#else +# define JSON_HEDLEY_REQUIRE(expr) +# define JSON_HEDLEY_REQUIRE_MSG(expr,msg) +#endif + +#if defined(JSON_HEDLEY_FLAGS) + #undef JSON_HEDLEY_FLAGS +#endif +#if JSON_HEDLEY_HAS_ATTRIBUTE(flag_enum) && (!defined(__cplusplus) || JSON_HEDLEY_HAS_WARNING("-Wbitfield-enum-conversion")) + #define JSON_HEDLEY_FLAGS __attribute__((__flag_enum__)) +#else + #define JSON_HEDLEY_FLAGS +#endif + +#if defined(JSON_HEDLEY_FLAGS_CAST) + #undef JSON_HEDLEY_FLAGS_CAST +#endif +#if JSON_HEDLEY_INTEL_VERSION_CHECK(19,0,0) +# define JSON_HEDLEY_FLAGS_CAST(T, expr) (__extension__ ({ \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ + _Pragma("warning(disable:188)") \ + ((T) (expr)); \ + JSON_HEDLEY_DIAGNOSTIC_POP \ + })) +#else +# define JSON_HEDLEY_FLAGS_CAST(T, expr) JSON_HEDLEY_STATIC_CAST(T, expr) +#endif + +#if defined(JSON_HEDLEY_EMPTY_BASES) + #undef JSON_HEDLEY_EMPTY_BASES +#endif +#if \ + (JSON_HEDLEY_MSVC_VERSION_CHECK(19,0,23918) && !JSON_HEDLEY_MSVC_VERSION_CHECK(20,0,0)) || \ + JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) + #define JSON_HEDLEY_EMPTY_BASES __declspec(empty_bases) +#else + #define JSON_HEDLEY_EMPTY_BASES +#endif + +/* Remaining macros are deprecated. */ + +#if defined(JSON_HEDLEY_GCC_NOT_CLANG_VERSION_CHECK) + #undef JSON_HEDLEY_GCC_NOT_CLANG_VERSION_CHECK +#endif +#if defined(__clang__) + #define JSON_HEDLEY_GCC_NOT_CLANG_VERSION_CHECK(major,minor,patch) (0) +#else + #define JSON_HEDLEY_GCC_NOT_CLANG_VERSION_CHECK(major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_CLANG_HAS_ATTRIBUTE) + #undef JSON_HEDLEY_CLANG_HAS_ATTRIBUTE +#endif +#define JSON_HEDLEY_CLANG_HAS_ATTRIBUTE(attribute) JSON_HEDLEY_HAS_ATTRIBUTE(attribute) + +#if defined(JSON_HEDLEY_CLANG_HAS_CPP_ATTRIBUTE) + #undef JSON_HEDLEY_CLANG_HAS_CPP_ATTRIBUTE +#endif +#define JSON_HEDLEY_CLANG_HAS_CPP_ATTRIBUTE(attribute) JSON_HEDLEY_HAS_CPP_ATTRIBUTE(attribute) + +#if defined(JSON_HEDLEY_CLANG_HAS_BUILTIN) + #undef JSON_HEDLEY_CLANG_HAS_BUILTIN +#endif +#define JSON_HEDLEY_CLANG_HAS_BUILTIN(builtin) JSON_HEDLEY_HAS_BUILTIN(builtin) + +#if defined(JSON_HEDLEY_CLANG_HAS_FEATURE) + #undef JSON_HEDLEY_CLANG_HAS_FEATURE +#endif +#define JSON_HEDLEY_CLANG_HAS_FEATURE(feature) JSON_HEDLEY_HAS_FEATURE(feature) + +#if defined(JSON_HEDLEY_CLANG_HAS_EXTENSION) + #undef JSON_HEDLEY_CLANG_HAS_EXTENSION +#endif +#define JSON_HEDLEY_CLANG_HAS_EXTENSION(extension) JSON_HEDLEY_HAS_EXTENSION(extension) + +#if defined(JSON_HEDLEY_CLANG_HAS_DECLSPEC_DECLSPEC_ATTRIBUTE) + #undef JSON_HEDLEY_CLANG_HAS_DECLSPEC_DECLSPEC_ATTRIBUTE +#endif +#define JSON_HEDLEY_CLANG_HAS_DECLSPEC_ATTRIBUTE(attribute) JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE(attribute) + +#if defined(JSON_HEDLEY_CLANG_HAS_WARNING) + #undef JSON_HEDLEY_CLANG_HAS_WARNING +#endif +#define JSON_HEDLEY_CLANG_HAS_WARNING(warning) JSON_HEDLEY_HAS_WARNING(warning) + +#endif /* !defined(JSON_HEDLEY_VERSION) || (JSON_HEDLEY_VERSION < X) */ + + +// This file contains all internal macro definitions (except those affecting ABI) +// You MUST include macro_unscope.hpp at the end of json.hpp to undef all of them + +// #include + + +// exclude unsupported compilers +#if !defined(JSON_SKIP_UNSUPPORTED_COMPILER_CHECK) + #if defined(__clang__) + #if (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__) < 30400 + #error "unsupported Clang version - see https://github.com/nlohmann/json#supported-compilers" + #endif + #elif defined(__GNUC__) && !(defined(__ICC) || defined(__INTEL_COMPILER)) + #if (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) < 40800 + #error "unsupported GCC version - see https://github.com/nlohmann/json#supported-compilers" + #endif + #endif +#endif + +// C++ language standard detection +// if the user manually specified the used c++ version this is skipped +#if !defined(JSON_HAS_CPP_20) && !defined(JSON_HAS_CPP_17) && !defined(JSON_HAS_CPP_14) && !defined(JSON_HAS_CPP_11) + #if (defined(__cplusplus) && __cplusplus >= 202002L) || (defined(_MSVC_LANG) && _MSVC_LANG >= 202002L) + #define JSON_HAS_CPP_20 + #define JSON_HAS_CPP_17 + #define JSON_HAS_CPP_14 + #elif (defined(__cplusplus) && __cplusplus >= 201703L) || (defined(_HAS_CXX17) && _HAS_CXX17 == 1) // fix for issue #464 + #define JSON_HAS_CPP_17 + #define JSON_HAS_CPP_14 + #elif (defined(__cplusplus) && __cplusplus >= 201402L) || (defined(_HAS_CXX14) && _HAS_CXX14 == 1) + #define JSON_HAS_CPP_14 + #endif + // the cpp 11 flag is always specified because it is the minimal required version + #define JSON_HAS_CPP_11 +#endif + +#ifdef __has_include + #if __has_include() + #include + #endif +#endif + +#if !defined(JSON_HAS_FILESYSTEM) && !defined(JSON_HAS_EXPERIMENTAL_FILESYSTEM) + #ifdef JSON_HAS_CPP_17 + #if defined(__cpp_lib_filesystem) + #define JSON_HAS_FILESYSTEM 1 + #elif defined(__cpp_lib_experimental_filesystem) + #define JSON_HAS_EXPERIMENTAL_FILESYSTEM 1 + #elif !defined(__has_include) + #define JSON_HAS_EXPERIMENTAL_FILESYSTEM 1 + #elif __has_include() + #define JSON_HAS_FILESYSTEM 1 + #elif __has_include() + #define JSON_HAS_EXPERIMENTAL_FILESYSTEM 1 + #endif + + // std::filesystem does not work on MinGW GCC 8: https://sourceforge.net/p/mingw-w64/bugs/737/ + #if defined(__MINGW32__) && defined(__GNUC__) && __GNUC__ == 8 + #undef JSON_HAS_FILESYSTEM + #undef JSON_HAS_EXPERIMENTAL_FILESYSTEM + #endif + + // no filesystem support before GCC 8: https://en.cppreference.com/w/cpp/compiler_support + #if defined(__GNUC__) && !defined(__clang__) && __GNUC__ < 8 + #undef JSON_HAS_FILESYSTEM + #undef JSON_HAS_EXPERIMENTAL_FILESYSTEM + #endif + + // no filesystem support before Clang 7: https://en.cppreference.com/w/cpp/compiler_support + #if defined(__clang_major__) && __clang_major__ < 7 + #undef JSON_HAS_FILESYSTEM + #undef JSON_HAS_EXPERIMENTAL_FILESYSTEM + #endif + + // no filesystem support before MSVC 19.14: https://en.cppreference.com/w/cpp/compiler_support + #if defined(_MSC_VER) && _MSC_VER < 1914 + #undef JSON_HAS_FILESYSTEM + #undef JSON_HAS_EXPERIMENTAL_FILESYSTEM + #endif + + // no filesystem support before iOS 13 + #if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && __IPHONE_OS_VERSION_MIN_REQUIRED < 130000 + #undef JSON_HAS_FILESYSTEM + #undef JSON_HAS_EXPERIMENTAL_FILESYSTEM + #endif + + // no filesystem support before macOS Catalina + #if defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED < 101500 + #undef JSON_HAS_FILESYSTEM + #undef JSON_HAS_EXPERIMENTAL_FILESYSTEM + #endif + #endif +#endif + +#ifndef JSON_HAS_EXPERIMENTAL_FILESYSTEM + #define JSON_HAS_EXPERIMENTAL_FILESYSTEM 0 +#endif + +#ifndef JSON_HAS_FILESYSTEM + #define JSON_HAS_FILESYSTEM 0 +#endif + +#ifndef JSON_HAS_THREE_WAY_COMPARISON + #if defined(__cpp_impl_three_way_comparison) && __cpp_impl_three_way_comparison >= 201907L \ + && defined(__cpp_lib_three_way_comparison) && __cpp_lib_three_way_comparison >= 201907L + #define JSON_HAS_THREE_WAY_COMPARISON 1 + #else + #define JSON_HAS_THREE_WAY_COMPARISON 0 + #endif +#endif + +#ifndef JSON_HAS_RANGES + // ranges header shipping in GCC 11.1.0 (released 2021-04-27) has syntax error + #if defined(__GLIBCXX__) && __GLIBCXX__ == 20210427 + #define JSON_HAS_RANGES 0 + #elif defined(__cpp_lib_ranges) + #define JSON_HAS_RANGES 1 + #else + #define JSON_HAS_RANGES 0 + #endif +#endif + +#ifndef JSON_HAS_STATIC_RTTI + #if !defined(_HAS_STATIC_RTTI) || _HAS_STATIC_RTTI != 0 + #define JSON_HAS_STATIC_RTTI 1 + #else + #define JSON_HAS_STATIC_RTTI 0 + #endif +#endif + +#ifdef JSON_HAS_CPP_17 + #define JSON_INLINE_VARIABLE inline +#else + #define JSON_INLINE_VARIABLE +#endif + +#if JSON_HEDLEY_HAS_ATTRIBUTE(no_unique_address) + #define JSON_NO_UNIQUE_ADDRESS [[no_unique_address]] +#else + #define JSON_NO_UNIQUE_ADDRESS +#endif + +// disable documentation warnings on clang +#if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wdocumentation" + #pragma clang diagnostic ignored "-Wdocumentation-unknown-command" +#endif + +// allow disabling exceptions +#if (defined(__cpp_exceptions) || defined(__EXCEPTIONS) || defined(_CPPUNWIND)) && !defined(JSON_NOEXCEPTION) + #define JSON_THROW(exception) throw exception + #define JSON_TRY try + #define JSON_CATCH(exception) catch(exception) + #define JSON_INTERNAL_CATCH(exception) catch(exception) +#else + #include + #define JSON_THROW(exception) std::abort() + #define JSON_TRY if(true) + #define JSON_CATCH(exception) if(false) + #define JSON_INTERNAL_CATCH(exception) if(false) +#endif + +// override exception macros +#if defined(JSON_THROW_USER) + #undef JSON_THROW + #define JSON_THROW JSON_THROW_USER +#endif +#if defined(JSON_TRY_USER) + #undef JSON_TRY + #define JSON_TRY JSON_TRY_USER +#endif +#if defined(JSON_CATCH_USER) + #undef JSON_CATCH + #define JSON_CATCH JSON_CATCH_USER + #undef JSON_INTERNAL_CATCH + #define JSON_INTERNAL_CATCH JSON_CATCH_USER +#endif +#if defined(JSON_INTERNAL_CATCH_USER) + #undef JSON_INTERNAL_CATCH + #define JSON_INTERNAL_CATCH JSON_INTERNAL_CATCH_USER +#endif + +// allow overriding assert +#if !defined(JSON_ASSERT) + #include // assert + #define JSON_ASSERT(x) assert(x) +#endif + +// allow to access some private functions (needed by the test suite) +#if defined(JSON_TESTS_PRIVATE) + #define JSON_PRIVATE_UNLESS_TESTED public +#else + #define JSON_PRIVATE_UNLESS_TESTED private +#endif + +/*! +@brief macro to briefly define a mapping between an enum and JSON +@def NLOHMANN_JSON_SERIALIZE_ENUM +@since version 3.4.0 +*/ +#define NLOHMANN_JSON_SERIALIZE_ENUM(ENUM_TYPE, ...) \ + template \ + inline void to_json(BasicJsonType& j, const ENUM_TYPE& e) \ + { \ + static_assert(std::is_enum::value, #ENUM_TYPE " must be an enum!"); \ + static const std::pair m[] = __VA_ARGS__; \ + auto it = std::find_if(std::begin(m), std::end(m), \ + [e](const std::pair& ej_pair) -> bool \ + { \ + return ej_pair.first == e; \ + }); \ + j = ((it != std::end(m)) ? it : std::begin(m))->second; \ + } \ + template \ + inline void from_json(const BasicJsonType& j, ENUM_TYPE& e) \ + { \ + static_assert(std::is_enum::value, #ENUM_TYPE " must be an enum!"); \ + static const std::pair m[] = __VA_ARGS__; \ + auto it = std::find_if(std::begin(m), std::end(m), \ + [&j](const std::pair& ej_pair) -> bool \ + { \ + return ej_pair.second == j; \ + }); \ + e = ((it != std::end(m)) ? it : std::begin(m))->first; \ + } + +// Ugly macros to avoid uglier copy-paste when specializing basic_json. They +// may be removed in the future once the class is split. + +#define NLOHMANN_BASIC_JSON_TPL_DECLARATION \ + template class ObjectType, \ + template class ArrayType, \ + class StringType, class BooleanType, class NumberIntegerType, \ + class NumberUnsignedType, class NumberFloatType, \ + template class AllocatorType, \ + template class JSONSerializer, \ + class BinaryType, \ + class CustomBaseClass> + +#define NLOHMANN_BASIC_JSON_TPL \ + basic_json + +// Macros to simplify conversion from/to types + +#define NLOHMANN_JSON_EXPAND( x ) x +#define NLOHMANN_JSON_GET_MACRO(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53, _54, _55, _56, _57, _58, _59, _60, _61, _62, _63, _64, NAME,...) NAME +#define NLOHMANN_JSON_PASTE(...) NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_GET_MACRO(__VA_ARGS__, \ + NLOHMANN_JSON_PASTE64, \ + NLOHMANN_JSON_PASTE63, \ + NLOHMANN_JSON_PASTE62, \ + NLOHMANN_JSON_PASTE61, \ + NLOHMANN_JSON_PASTE60, \ + NLOHMANN_JSON_PASTE59, \ + NLOHMANN_JSON_PASTE58, \ + NLOHMANN_JSON_PASTE57, \ + NLOHMANN_JSON_PASTE56, \ + NLOHMANN_JSON_PASTE55, \ + NLOHMANN_JSON_PASTE54, \ + NLOHMANN_JSON_PASTE53, \ + NLOHMANN_JSON_PASTE52, \ + NLOHMANN_JSON_PASTE51, \ + NLOHMANN_JSON_PASTE50, \ + NLOHMANN_JSON_PASTE49, \ + NLOHMANN_JSON_PASTE48, \ + NLOHMANN_JSON_PASTE47, \ + NLOHMANN_JSON_PASTE46, \ + NLOHMANN_JSON_PASTE45, \ + NLOHMANN_JSON_PASTE44, \ + NLOHMANN_JSON_PASTE43, \ + NLOHMANN_JSON_PASTE42, \ + NLOHMANN_JSON_PASTE41, \ + NLOHMANN_JSON_PASTE40, \ + NLOHMANN_JSON_PASTE39, \ + NLOHMANN_JSON_PASTE38, \ + NLOHMANN_JSON_PASTE37, \ + NLOHMANN_JSON_PASTE36, \ + NLOHMANN_JSON_PASTE35, \ + NLOHMANN_JSON_PASTE34, \ + NLOHMANN_JSON_PASTE33, \ + NLOHMANN_JSON_PASTE32, \ + NLOHMANN_JSON_PASTE31, \ + NLOHMANN_JSON_PASTE30, \ + NLOHMANN_JSON_PASTE29, \ + NLOHMANN_JSON_PASTE28, \ + NLOHMANN_JSON_PASTE27, \ + NLOHMANN_JSON_PASTE26, \ + NLOHMANN_JSON_PASTE25, \ + NLOHMANN_JSON_PASTE24, \ + NLOHMANN_JSON_PASTE23, \ + NLOHMANN_JSON_PASTE22, \ + NLOHMANN_JSON_PASTE21, \ + NLOHMANN_JSON_PASTE20, \ + NLOHMANN_JSON_PASTE19, \ + NLOHMANN_JSON_PASTE18, \ + NLOHMANN_JSON_PASTE17, \ + NLOHMANN_JSON_PASTE16, \ + NLOHMANN_JSON_PASTE15, \ + NLOHMANN_JSON_PASTE14, \ + NLOHMANN_JSON_PASTE13, \ + NLOHMANN_JSON_PASTE12, \ + NLOHMANN_JSON_PASTE11, \ + NLOHMANN_JSON_PASTE10, \ + NLOHMANN_JSON_PASTE9, \ + NLOHMANN_JSON_PASTE8, \ + NLOHMANN_JSON_PASTE7, \ + NLOHMANN_JSON_PASTE6, \ + NLOHMANN_JSON_PASTE5, \ + NLOHMANN_JSON_PASTE4, \ + NLOHMANN_JSON_PASTE3, \ + NLOHMANN_JSON_PASTE2, \ + NLOHMANN_JSON_PASTE1)(__VA_ARGS__)) +#define NLOHMANN_JSON_PASTE2(func, v1) func(v1) +#define NLOHMANN_JSON_PASTE3(func, v1, v2) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE2(func, v2) +#define NLOHMANN_JSON_PASTE4(func, v1, v2, v3) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE3(func, v2, v3) +#define NLOHMANN_JSON_PASTE5(func, v1, v2, v3, v4) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE4(func, v2, v3, v4) +#define NLOHMANN_JSON_PASTE6(func, v1, v2, v3, v4, v5) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE5(func, v2, v3, v4, v5) +#define NLOHMANN_JSON_PASTE7(func, v1, v2, v3, v4, v5, v6) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE6(func, v2, v3, v4, v5, v6) +#define NLOHMANN_JSON_PASTE8(func, v1, v2, v3, v4, v5, v6, v7) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE7(func, v2, v3, v4, v5, v6, v7) +#define NLOHMANN_JSON_PASTE9(func, v1, v2, v3, v4, v5, v6, v7, v8) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE8(func, v2, v3, v4, v5, v6, v7, v8) +#define NLOHMANN_JSON_PASTE10(func, v1, v2, v3, v4, v5, v6, v7, v8, v9) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE9(func, v2, v3, v4, v5, v6, v7, v8, v9) +#define NLOHMANN_JSON_PASTE11(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE10(func, v2, v3, v4, v5, v6, v7, v8, v9, v10) +#define NLOHMANN_JSON_PASTE12(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE11(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11) +#define NLOHMANN_JSON_PASTE13(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE12(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12) +#define NLOHMANN_JSON_PASTE14(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE13(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13) +#define NLOHMANN_JSON_PASTE15(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE14(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14) +#define NLOHMANN_JSON_PASTE16(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE15(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15) +#define NLOHMANN_JSON_PASTE17(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE16(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16) +#define NLOHMANN_JSON_PASTE18(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE17(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17) +#define NLOHMANN_JSON_PASTE19(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE18(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18) +#define NLOHMANN_JSON_PASTE20(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE19(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19) +#define NLOHMANN_JSON_PASTE21(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE20(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20) +#define NLOHMANN_JSON_PASTE22(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE21(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21) +#define NLOHMANN_JSON_PASTE23(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE22(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22) +#define NLOHMANN_JSON_PASTE24(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE23(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23) +#define NLOHMANN_JSON_PASTE25(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE24(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24) +#define NLOHMANN_JSON_PASTE26(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE25(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25) +#define NLOHMANN_JSON_PASTE27(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE26(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26) +#define NLOHMANN_JSON_PASTE28(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE27(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27) +#define NLOHMANN_JSON_PASTE29(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE28(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28) +#define NLOHMANN_JSON_PASTE30(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE29(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29) +#define NLOHMANN_JSON_PASTE31(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE30(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30) +#define NLOHMANN_JSON_PASTE32(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE31(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31) +#define NLOHMANN_JSON_PASTE33(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE32(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32) +#define NLOHMANN_JSON_PASTE34(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE33(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33) +#define NLOHMANN_JSON_PASTE35(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE34(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34) +#define NLOHMANN_JSON_PASTE36(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE35(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35) +#define NLOHMANN_JSON_PASTE37(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE36(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36) +#define NLOHMANN_JSON_PASTE38(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE37(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37) +#define NLOHMANN_JSON_PASTE39(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE38(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38) +#define NLOHMANN_JSON_PASTE40(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE39(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39) +#define NLOHMANN_JSON_PASTE41(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE40(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40) +#define NLOHMANN_JSON_PASTE42(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE41(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41) +#define NLOHMANN_JSON_PASTE43(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE42(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42) +#define NLOHMANN_JSON_PASTE44(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE43(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43) +#define NLOHMANN_JSON_PASTE45(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE44(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44) +#define NLOHMANN_JSON_PASTE46(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE45(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45) +#define NLOHMANN_JSON_PASTE47(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE46(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46) +#define NLOHMANN_JSON_PASTE48(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE47(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47) +#define NLOHMANN_JSON_PASTE49(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE48(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48) +#define NLOHMANN_JSON_PASTE50(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE49(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49) +#define NLOHMANN_JSON_PASTE51(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE50(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50) +#define NLOHMANN_JSON_PASTE52(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE51(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51) +#define NLOHMANN_JSON_PASTE53(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE52(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52) +#define NLOHMANN_JSON_PASTE54(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE53(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53) +#define NLOHMANN_JSON_PASTE55(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE54(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54) +#define NLOHMANN_JSON_PASTE56(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE55(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55) +#define NLOHMANN_JSON_PASTE57(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE56(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56) +#define NLOHMANN_JSON_PASTE58(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE57(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57) +#define NLOHMANN_JSON_PASTE59(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE58(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58) +#define NLOHMANN_JSON_PASTE60(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE59(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59) +#define NLOHMANN_JSON_PASTE61(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v60) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE60(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v60) +#define NLOHMANN_JSON_PASTE62(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v60, v61) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE61(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v60, v61) +#define NLOHMANN_JSON_PASTE63(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v60, v61, v62) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE62(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v60, v61, v62) +#define NLOHMANN_JSON_PASTE64(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v60, v61, v62, v63) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE63(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v60, v61, v62, v63) + +#define NLOHMANN_JSON_TO(v1) nlohmann_json_j[#v1] = nlohmann_json_t.v1; +#define NLOHMANN_JSON_FROM(v1) nlohmann_json_j.at(#v1).get_to(nlohmann_json_t.v1); +#define NLOHMANN_JSON_FROM_WITH_DEFAULT(v1) nlohmann_json_t.v1 = nlohmann_json_j.value(#v1, nlohmann_json_default_obj.v1); + +/*! +@brief macro +@def NLOHMANN_DEFINE_TYPE_INTRUSIVE +@since version 3.9.0 +*/ +#define NLOHMANN_DEFINE_TYPE_INTRUSIVE(Type, ...) \ + friend void to_json(nlohmann::json& nlohmann_json_j, const Type& nlohmann_json_t) { NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_TO, __VA_ARGS__)) } \ + friend void from_json(const nlohmann::json& nlohmann_json_j, Type& nlohmann_json_t) { NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_FROM, __VA_ARGS__)) } + +#define NLOHMANN_DEFINE_TYPE_INTRUSIVE_WITH_DEFAULT(Type, ...) \ + friend void to_json(nlohmann::json& nlohmann_json_j, const Type& nlohmann_json_t) { NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_TO, __VA_ARGS__)) } \ + friend void from_json(const nlohmann::json& nlohmann_json_j, Type& nlohmann_json_t) { const Type nlohmann_json_default_obj{}; NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_FROM_WITH_DEFAULT, __VA_ARGS__)) } + +#define NLOHMANN_DEFINE_TYPE_INTRUSIVE_ONLY_SERIALIZE(Type, ...) \ + friend void to_json(nlohmann::json& nlohmann_json_j, const Type& nlohmann_json_t) { NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_TO, __VA_ARGS__)) } + +/*! +@brief macro +@def NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE +@since version 3.9.0 +*/ +#define NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(Type, ...) \ + inline void to_json(nlohmann::json& nlohmann_json_j, const Type& nlohmann_json_t) { NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_TO, __VA_ARGS__)) } \ + inline void from_json(const nlohmann::json& nlohmann_json_j, Type& nlohmann_json_t) { NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_FROM, __VA_ARGS__)) } + +#define NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE_ONLY_SERIALIZE(Type, ...) \ + inline void to_json(nlohmann::json& nlohmann_json_j, const Type& nlohmann_json_t) { NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_TO, __VA_ARGS__)) } + +#define NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE_WITH_DEFAULT(Type, ...) \ + inline void to_json(nlohmann::json& nlohmann_json_j, const Type& nlohmann_json_t) { NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_TO, __VA_ARGS__)) } \ + inline void from_json(const nlohmann::json& nlohmann_json_j, Type& nlohmann_json_t) { const Type nlohmann_json_default_obj{}; NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_FROM_WITH_DEFAULT, __VA_ARGS__)) } + +// inspired from https://stackoverflow.com/a/26745591 +// allows to call any std function as if (e.g. with begin): +// using std::begin; begin(x); +// +// it allows using the detected idiom to retrieve the return type +// of such an expression +#define NLOHMANN_CAN_CALL_STD_FUNC_IMPL(std_name) \ + namespace detail { \ + using std::std_name; \ + \ + template \ + using result_of_##std_name = decltype(std_name(std::declval()...)); \ + } \ + \ + namespace detail2 { \ + struct std_name##_tag \ + { \ + }; \ + \ + template \ + std_name##_tag std_name(T&&...); \ + \ + template \ + using result_of_##std_name = decltype(std_name(std::declval()...)); \ + \ + template \ + struct would_call_std_##std_name \ + { \ + static constexpr auto const value = ::nlohmann::detail:: \ + is_detected_exact::value; \ + }; \ + } /* namespace detail2 */ \ + \ + template \ + struct would_call_std_##std_name : detail2::would_call_std_##std_name \ + { \ + } + +#ifndef JSON_USE_IMPLICIT_CONVERSIONS + #define JSON_USE_IMPLICIT_CONVERSIONS 1 +#endif + +#if JSON_USE_IMPLICIT_CONVERSIONS + #define JSON_EXPLICIT +#else + #define JSON_EXPLICIT explicit +#endif + +#ifndef JSON_DISABLE_ENUM_SERIALIZATION + #define JSON_DISABLE_ENUM_SERIALIZATION 0 +#endif + +#ifndef JSON_USE_GLOBAL_UDLS + #define JSON_USE_GLOBAL_UDLS 1 +#endif + +#if JSON_HAS_THREE_WAY_COMPARISON + #include // partial_ordering +#endif + +NLOHMANN_JSON_NAMESPACE_BEGIN +namespace detail +{ + +/////////////////////////// +// JSON type enumeration // +/////////////////////////// + +/*! +@brief the JSON type enumeration + +This enumeration collects the different JSON types. It is internally used to +distinguish the stored values, and the functions @ref basic_json::is_null(), +@ref basic_json::is_object(), @ref basic_json::is_array(), +@ref basic_json::is_string(), @ref basic_json::is_boolean(), +@ref basic_json::is_number() (with @ref basic_json::is_number_integer(), +@ref basic_json::is_number_unsigned(), and @ref basic_json::is_number_float()), +@ref basic_json::is_discarded(), @ref basic_json::is_primitive(), and +@ref basic_json::is_structured() rely on it. + +@note There are three enumeration entries (number_integer, number_unsigned, and +number_float), because the library distinguishes these three types for numbers: +@ref basic_json::number_unsigned_t is used for unsigned integers, +@ref basic_json::number_integer_t is used for signed integers, and +@ref basic_json::number_float_t is used for floating-point numbers or to +approximate integers which do not fit in the limits of their respective type. + +@sa see @ref basic_json::basic_json(const value_t value_type) -- create a JSON +value with the default value for a given type + +@since version 1.0.0 +*/ +enum class value_t : std::uint8_t +{ + null, ///< null value + object, ///< object (unordered set of name/value pairs) + array, ///< array (ordered collection of values) + string, ///< string value + boolean, ///< boolean value + number_integer, ///< number value (signed integer) + number_unsigned, ///< number value (unsigned integer) + number_float, ///< number value (floating-point) + binary, ///< binary array (ordered collection of bytes) + discarded ///< discarded by the parser callback function +}; + +/*! +@brief comparison operator for JSON types + +Returns an ordering that is similar to Python: +- order: null < boolean < number < object < array < string < binary +- furthermore, each type is not smaller than itself +- discarded values are not comparable +- binary is represented as a b"" string in python and directly comparable to a + string; however, making a binary array directly comparable with a string would + be surprising behavior in a JSON file. + +@since version 1.0.0 +*/ +#if JSON_HAS_THREE_WAY_COMPARISON + inline std::partial_ordering operator<=>(const value_t lhs, const value_t rhs) noexcept // *NOPAD* +#else + inline bool operator<(const value_t lhs, const value_t rhs) noexcept +#endif +{ + static constexpr std::array order = {{ + 0 /* null */, 3 /* object */, 4 /* array */, 5 /* string */, + 1 /* boolean */, 2 /* integer */, 2 /* unsigned */, 2 /* float */, + 6 /* binary */ + } + }; + + const auto l_index = static_cast(lhs); + const auto r_index = static_cast(rhs); +#if JSON_HAS_THREE_WAY_COMPARISON + if (l_index < order.size() && r_index < order.size()) + { + return order[l_index] <=> order[r_index]; // *NOPAD* + } + return std::partial_ordering::unordered; +#else + return l_index < order.size() && r_index < order.size() && order[l_index] < order[r_index]; +#endif +} + +// GCC selects the built-in operator< over an operator rewritten from +// a user-defined spaceship operator +// Clang, MSVC, and ICC select the rewritten candidate +// (see GCC bug https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105200) +#if JSON_HAS_THREE_WAY_COMPARISON && defined(__GNUC__) +inline bool operator<(const value_t lhs, const value_t rhs) noexcept +{ + return std::is_lt(lhs <=> rhs); // *NOPAD* +} +#endif + +} // namespace detail +NLOHMANN_JSON_NAMESPACE_END + +// #include +// __ _____ _____ _____ +// __| | __| | | | JSON for Modern C++ +// | | |__ | | | | | | version 3.11.3 +// |_____|_____|_____|_|___| https://github.com/nlohmann/json +// +// SPDX-FileCopyrightText: 2013-2023 Niels Lohmann +// SPDX-License-Identifier: MIT + + + +// #include + + +NLOHMANN_JSON_NAMESPACE_BEGIN +namespace detail +{ + +/*! +@brief replace all occurrences of a substring by another string + +@param[in,out] s the string to manipulate; changed so that all + occurrences of @a f are replaced with @a t +@param[in] f the substring to replace with @a t +@param[in] t the string to replace @a f + +@pre The search string @a f must not be empty. **This precondition is +enforced with an assertion.** + +@since version 2.0.0 +*/ +template +inline void replace_substring(StringType& s, const StringType& f, + const StringType& t) +{ + JSON_ASSERT(!f.empty()); + for (auto pos = s.find(f); // find first occurrence of f + pos != StringType::npos; // make sure f was found + s.replace(pos, f.size(), t), // replace with t, and + pos = s.find(f, pos + t.size())) // find next occurrence of f + {} +} + +/*! + * @brief string escaping as described in RFC 6901 (Sect. 4) + * @param[in] s string to escape + * @return escaped string + * + * Note the order of escaping "~" to "~0" and "/" to "~1" is important. + */ +template +inline StringType escape(StringType s) +{ + replace_substring(s, StringType{"~"}, StringType{"~0"}); + replace_substring(s, StringType{"/"}, StringType{"~1"}); + return s; +} + +/*! + * @brief string unescaping as described in RFC 6901 (Sect. 4) + * @param[in] s string to unescape + * @return unescaped string + * + * Note the order of escaping "~1" to "/" and "~0" to "~" is important. + */ +template +static void unescape(StringType& s) +{ + replace_substring(s, StringType{"~1"}, StringType{"/"}); + replace_substring(s, StringType{"~0"}, StringType{"~"}); +} + +} // namespace detail +NLOHMANN_JSON_NAMESPACE_END + +// #include +// __ _____ _____ _____ +// __| | __| | | | JSON for Modern C++ +// | | |__ | | | | | | version 3.11.3 +// |_____|_____|_____|_|___| https://github.com/nlohmann/json +// +// SPDX-FileCopyrightText: 2013-2023 Niels Lohmann +// SPDX-License-Identifier: MIT + + + +#include // size_t + +// #include + + +NLOHMANN_JSON_NAMESPACE_BEGIN +namespace detail +{ + +/// struct to capture the start position of the current token +struct position_t +{ + /// the total number of characters read + std::size_t chars_read_total = 0; + /// the number of characters read in the current line + std::size_t chars_read_current_line = 0; + /// the number of lines read + std::size_t lines_read = 0; + + /// conversion to size_t to preserve SAX interface + constexpr operator size_t() const + { + return chars_read_total; + } +}; + +} // namespace detail +NLOHMANN_JSON_NAMESPACE_END + +// #include + +// #include +// __ _____ _____ _____ +// __| | __| | | | JSON for Modern C++ +// | | |__ | | | | | | version 3.11.3 +// |_____|_____|_____|_|___| https://github.com/nlohmann/json +// +// SPDX-FileCopyrightText: 2013-2023 Niels Lohmann +// SPDX-FileCopyrightText: 2018 The Abseil Authors +// SPDX-License-Identifier: MIT + + + +#include // array +#include // size_t +#include // conditional, enable_if, false_type, integral_constant, is_constructible, is_integral, is_same, remove_cv, remove_reference, true_type +#include // index_sequence, make_index_sequence, index_sequence_for + +// #include + + +NLOHMANN_JSON_NAMESPACE_BEGIN +namespace detail +{ + +template +using uncvref_t = typename std::remove_cv::type>::type; + +#ifdef JSON_HAS_CPP_14 + +// the following utilities are natively available in C++14 +using std::enable_if_t; +using std::index_sequence; +using std::make_index_sequence; +using std::index_sequence_for; + +#else + +// alias templates to reduce boilerplate +template +using enable_if_t = typename std::enable_if::type; + +// The following code is taken from https://github.com/abseil/abseil-cpp/blob/10cb35e459f5ecca5b2ff107635da0bfa41011b4/absl/utility/utility.h +// which is part of Google Abseil (https://github.com/abseil/abseil-cpp), licensed under the Apache License 2.0. + +//// START OF CODE FROM GOOGLE ABSEIL + +// integer_sequence +// +// Class template representing a compile-time integer sequence. An instantiation +// of `integer_sequence` has a sequence of integers encoded in its +// type through its template arguments (which is a common need when +// working with C++11 variadic templates). `absl::integer_sequence` is designed +// to be a drop-in replacement for C++14's `std::integer_sequence`. +// +// Example: +// +// template< class T, T... Ints > +// void user_function(integer_sequence); +// +// int main() +// { +// // user_function's `T` will be deduced to `int` and `Ints...` +// // will be deduced to `0, 1, 2, 3, 4`. +// user_function(make_integer_sequence()); +// } +template +struct integer_sequence +{ + using value_type = T; + static constexpr std::size_t size() noexcept + { + return sizeof...(Ints); + } +}; + +// index_sequence +// +// A helper template for an `integer_sequence` of `size_t`, +// `absl::index_sequence` is designed to be a drop-in replacement for C++14's +// `std::index_sequence`. +template +using index_sequence = integer_sequence; + +namespace utility_internal +{ + +template +struct Extend; + +// Note that SeqSize == sizeof...(Ints). It's passed explicitly for efficiency. +template +struct Extend, SeqSize, 0> +{ + using type = integer_sequence < T, Ints..., (Ints + SeqSize)... >; +}; + +template +struct Extend, SeqSize, 1> +{ + using type = integer_sequence < T, Ints..., (Ints + SeqSize)..., 2 * SeqSize >; +}; + +// Recursion helper for 'make_integer_sequence'. +// 'Gen::type' is an alias for 'integer_sequence'. +template +struct Gen +{ + using type = + typename Extend < typename Gen < T, N / 2 >::type, N / 2, N % 2 >::type; +}; + +template +struct Gen +{ + using type = integer_sequence; +}; + +} // namespace utility_internal + +// Compile-time sequences of integers + +// make_integer_sequence +// +// This template alias is equivalent to +// `integer_sequence`, and is designed to be a drop-in +// replacement for C++14's `std::make_integer_sequence`. +template +using make_integer_sequence = typename utility_internal::Gen::type; + +// make_index_sequence +// +// This template alias is equivalent to `index_sequence<0, 1, ..., N-1>`, +// and is designed to be a drop-in replacement for C++14's +// `std::make_index_sequence`. +template +using make_index_sequence = make_integer_sequence; + +// index_sequence_for +// +// Converts a typename pack into an index sequence of the same length, and +// is designed to be a drop-in replacement for C++14's +// `std::index_sequence_for()` +template +using index_sequence_for = make_index_sequence; + +//// END OF CODE FROM GOOGLE ABSEIL + +#endif + +// dispatch utility (taken from ranges-v3) +template struct priority_tag : priority_tag < N - 1 > {}; +template<> struct priority_tag<0> {}; + +// taken from ranges-v3 +template +struct static_const +{ + static JSON_INLINE_VARIABLE constexpr T value{}; +}; + +#ifndef JSON_HAS_CPP_17 + template + constexpr T static_const::value; +#endif + +template +inline constexpr std::array make_array(Args&& ... args) +{ + return std::array {{static_cast(std::forward(args))...}}; +} + +} // namespace detail +NLOHMANN_JSON_NAMESPACE_END + +// #include +// __ _____ _____ _____ +// __| | __| | | | JSON for Modern C++ +// | | |__ | | | | | | version 3.11.3 +// |_____|_____|_____|_|___| https://github.com/nlohmann/json +// +// SPDX-FileCopyrightText: 2013-2023 Niels Lohmann +// SPDX-License-Identifier: MIT + + + +#include // numeric_limits +#include // false_type, is_constructible, is_integral, is_same, true_type +#include // declval +#include // tuple +#include // char_traits + +// #include +// __ _____ _____ _____ +// __| | __| | | | JSON for Modern C++ +// | | |__ | | | | | | version 3.11.3 +// |_____|_____|_____|_|___| https://github.com/nlohmann/json +// +// SPDX-FileCopyrightText: 2013-2023 Niels Lohmann +// SPDX-License-Identifier: MIT + + + +#include // random_access_iterator_tag + +// #include + +// #include + +// #include + + +NLOHMANN_JSON_NAMESPACE_BEGIN +namespace detail +{ + +template +struct iterator_types {}; + +template +struct iterator_types < + It, + void_t> +{ + using difference_type = typename It::difference_type; + using value_type = typename It::value_type; + using pointer = typename It::pointer; + using reference = typename It::reference; + using iterator_category = typename It::iterator_category; +}; + +// This is required as some compilers implement std::iterator_traits in a way that +// doesn't work with SFINAE. See https://github.com/nlohmann/json/issues/1341. +template +struct iterator_traits +{ +}; + +template +struct iterator_traits < T, enable_if_t < !std::is_pointer::value >> + : iterator_types +{ +}; + +template +struct iterator_traits::value>> +{ + using iterator_category = std::random_access_iterator_tag; + using value_type = T; + using difference_type = ptrdiff_t; + using pointer = T*; + using reference = T&; +}; + +} // namespace detail +NLOHMANN_JSON_NAMESPACE_END + +// #include + +// #include +// __ _____ _____ _____ +// __| | __| | | | JSON for Modern C++ +// | | |__ | | | | | | version 3.11.3 +// |_____|_____|_____|_|___| https://github.com/nlohmann/json +// +// SPDX-FileCopyrightText: 2013-2023 Niels Lohmann +// SPDX-License-Identifier: MIT + + + +// #include + + +NLOHMANN_JSON_NAMESPACE_BEGIN + +NLOHMANN_CAN_CALL_STD_FUNC_IMPL(begin); + +NLOHMANN_JSON_NAMESPACE_END + +// #include +// __ _____ _____ _____ +// __| | __| | | | JSON for Modern C++ +// | | |__ | | | | | | version 3.11.3 +// |_____|_____|_____|_|___| https://github.com/nlohmann/json +// +// SPDX-FileCopyrightText: 2013-2023 Niels Lohmann +// SPDX-License-Identifier: MIT + + + +// #include + + +NLOHMANN_JSON_NAMESPACE_BEGIN + +NLOHMANN_CAN_CALL_STD_FUNC_IMPL(end); + +NLOHMANN_JSON_NAMESPACE_END + +// #include + +// #include + +// #include +// __ _____ _____ _____ +// __| | __| | | | JSON for Modern C++ +// | | |__ | | | | | | version 3.11.3 +// |_____|_____|_____|_|___| https://github.com/nlohmann/json +// +// SPDX-FileCopyrightText: 2013-2023 Niels Lohmann +// SPDX-License-Identifier: MIT + +#ifndef INCLUDE_NLOHMANN_JSON_FWD_HPP_ + #define INCLUDE_NLOHMANN_JSON_FWD_HPP_ + + #include // int64_t, uint64_t + #include // map + #include // allocator + #include // string + #include // vector + + // #include + + + /*! + @brief namespace for Niels Lohmann + @see https://github.com/nlohmann + @since version 1.0.0 + */ + NLOHMANN_JSON_NAMESPACE_BEGIN + + /*! + @brief default JSONSerializer template argument + + This serializer ignores the template arguments and uses ADL + ([argument-dependent lookup](https://en.cppreference.com/w/cpp/language/adl)) + for serialization. + */ + template + struct adl_serializer; + + /// a class to store JSON values + /// @sa https://json.nlohmann.me/api/basic_json/ + template class ObjectType = + std::map, + template class ArrayType = std::vector, + class StringType = std::string, class BooleanType = bool, + class NumberIntegerType = std::int64_t, + class NumberUnsignedType = std::uint64_t, + class NumberFloatType = double, + template class AllocatorType = std::allocator, + template class JSONSerializer = + adl_serializer, + class BinaryType = std::vector, // cppcheck-suppress syntaxError + class CustomBaseClass = void> + class basic_json; + + /// @brief JSON Pointer defines a string syntax for identifying a specific value within a JSON document + /// @sa https://json.nlohmann.me/api/json_pointer/ + template + class json_pointer; + + /*! + @brief default specialization + @sa https://json.nlohmann.me/api/json/ + */ + using json = basic_json<>; + + /// @brief a minimal map-like container that preserves insertion order + /// @sa https://json.nlohmann.me/api/ordered_map/ + template + struct ordered_map; + + /// @brief specialization that maintains the insertion order of object keys + /// @sa https://json.nlohmann.me/api/ordered_json/ + using ordered_json = basic_json; + + NLOHMANN_JSON_NAMESPACE_END + +#endif // INCLUDE_NLOHMANN_JSON_FWD_HPP_ + + +NLOHMANN_JSON_NAMESPACE_BEGIN +/*! +@brief detail namespace with internal helper functions + +This namespace collects functions that should not be exposed, +implementations of some @ref basic_json methods, and meta-programming helpers. + +@since version 2.1.0 +*/ +namespace detail +{ + +///////////// +// helpers // +///////////// + +// Note to maintainers: +// +// Every trait in this file expects a non CV-qualified type. +// The only exceptions are in the 'aliases for detected' section +// (i.e. those of the form: decltype(T::member_function(std::declval()))) +// +// In this case, T has to be properly CV-qualified to constraint the function arguments +// (e.g. to_json(BasicJsonType&, const T&)) + +template struct is_basic_json : std::false_type {}; + +NLOHMANN_BASIC_JSON_TPL_DECLARATION +struct is_basic_json : std::true_type {}; + +// used by exceptions create() member functions +// true_type for pointer to possibly cv-qualified basic_json or std::nullptr_t +// false_type otherwise +template +struct is_basic_json_context : + std::integral_constant < bool, + is_basic_json::type>::type>::value + || std::is_same::value > +{}; + +////////////////////// +// json_ref helpers // +////////////////////// + +template +class json_ref; + +template +struct is_json_ref : std::false_type {}; + +template +struct is_json_ref> : std::true_type {}; + +////////////////////////// +// aliases for detected // +////////////////////////// + +template +using mapped_type_t = typename T::mapped_type; + +template +using key_type_t = typename T::key_type; + +template +using value_type_t = typename T::value_type; + +template +using difference_type_t = typename T::difference_type; + +template +using pointer_t = typename T::pointer; + +template +using reference_t = typename T::reference; + +template +using iterator_category_t = typename T::iterator_category; + +template +using to_json_function = decltype(T::to_json(std::declval()...)); + +template +using from_json_function = decltype(T::from_json(std::declval()...)); + +template +using get_template_function = decltype(std::declval().template get()); + +// trait checking if JSONSerializer::from_json(json const&, udt&) exists +template +struct has_from_json : std::false_type {}; + +// trait checking if j.get is valid +// use this trait instead of std::is_constructible or std::is_convertible, +// both rely on, or make use of implicit conversions, and thus fail when T +// has several constructors/operator= (see https://github.com/nlohmann/json/issues/958) +template +struct is_getable +{ + static constexpr bool value = is_detected::value; +}; + +template +struct has_from_json < BasicJsonType, T, enable_if_t < !is_basic_json::value >> +{ + using serializer = typename BasicJsonType::template json_serializer; + + static constexpr bool value = + is_detected_exact::value; +}; + +// This trait checks if JSONSerializer::from_json(json const&) exists +// this overload is used for non-default-constructible user-defined-types +template +struct has_non_default_from_json : std::false_type {}; + +template +struct has_non_default_from_json < BasicJsonType, T, enable_if_t < !is_basic_json::value >> +{ + using serializer = typename BasicJsonType::template json_serializer; + + static constexpr bool value = + is_detected_exact::value; +}; + +// This trait checks if BasicJsonType::json_serializer::to_json exists +// Do not evaluate the trait when T is a basic_json type, to avoid template instantiation infinite recursion. +template +struct has_to_json : std::false_type {}; + +template +struct has_to_json < BasicJsonType, T, enable_if_t < !is_basic_json::value >> +{ + using serializer = typename BasicJsonType::template json_serializer; + + static constexpr bool value = + is_detected_exact::value; +}; + +template +using detect_key_compare = typename T::key_compare; + +template +struct has_key_compare : std::integral_constant::value> {}; + +// obtains the actual object key comparator +template +struct actual_object_comparator +{ + using object_t = typename BasicJsonType::object_t; + using object_comparator_t = typename BasicJsonType::default_object_comparator_t; + using type = typename std::conditional < has_key_compare::value, + typename object_t::key_compare, object_comparator_t>::type; +}; + +template +using actual_object_comparator_t = typename actual_object_comparator::type; + +///////////////// +// char_traits // +///////////////// + +// Primary template of char_traits calls std char_traits +template +struct char_traits : std::char_traits +{}; + +// Explicitly define char traits for unsigned char since it is not standard +template<> +struct char_traits : std::char_traits +{ + using char_type = unsigned char; + using int_type = uint64_t; + + // Redefine to_int_type function + static int_type to_int_type(char_type c) noexcept + { + return static_cast(c); + } + + static char_type to_char_type(int_type i) noexcept + { + return static_cast(i); + } + + static constexpr int_type eof() noexcept + { + return static_cast(EOF); + } +}; + +// Explicitly define char traits for signed char since it is not standard +template<> +struct char_traits : std::char_traits +{ + using char_type = signed char; + using int_type = uint64_t; + + // Redefine to_int_type function + static int_type to_int_type(char_type c) noexcept + { + return static_cast(c); + } + + static char_type to_char_type(int_type i) noexcept + { + return static_cast(i); + } + + static constexpr int_type eof() noexcept + { + return static_cast(EOF); + } +}; + +/////////////////// +// is_ functions // +/////////////////// + +// https://en.cppreference.com/w/cpp/types/conjunction +template struct conjunction : std::true_type { }; +template struct conjunction : B { }; +template +struct conjunction +: std::conditional(B::value), conjunction, B>::type {}; + +// https://en.cppreference.com/w/cpp/types/negation +template struct negation : std::integral_constant < bool, !B::value > { }; + +// Reimplementation of is_constructible and is_default_constructible, due to them being broken for +// std::pair and std::tuple until LWG 2367 fix (see https://cplusplus.github.io/LWG/lwg-defects.html#2367). +// This causes compile errors in e.g. clang 3.5 or gcc 4.9. +template +struct is_default_constructible : std::is_default_constructible {}; + +template +struct is_default_constructible> + : conjunction, is_default_constructible> {}; + +template +struct is_default_constructible> + : conjunction, is_default_constructible> {}; + +template +struct is_default_constructible> + : conjunction...> {}; + +template +struct is_default_constructible> + : conjunction...> {}; + +template +struct is_constructible : std::is_constructible {}; + +template +struct is_constructible> : is_default_constructible> {}; + +template +struct is_constructible> : is_default_constructible> {}; + +template +struct is_constructible> : is_default_constructible> {}; + +template +struct is_constructible> : is_default_constructible> {}; + +template +struct is_iterator_traits : std::false_type {}; + +template +struct is_iterator_traits> +{ + private: + using traits = iterator_traits; + + public: + static constexpr auto value = + is_detected::value && + is_detected::value && + is_detected::value && + is_detected::value && + is_detected::value; +}; + +template +struct is_range +{ + private: + using t_ref = typename std::add_lvalue_reference::type; + + using iterator = detected_t; + using sentinel = detected_t; + + // to be 100% correct, it should use https://en.cppreference.com/w/cpp/iterator/input_or_output_iterator + // and https://en.cppreference.com/w/cpp/iterator/sentinel_for + // but reimplementing these would be too much work, as a lot of other concepts are used underneath + static constexpr auto is_iterator_begin = + is_iterator_traits>::value; + + public: + static constexpr bool value = !std::is_same::value && !std::is_same::value && is_iterator_begin; +}; + +template +using iterator_t = enable_if_t::value, result_of_begin())>>; + +template +using range_value_t = value_type_t>>; + +// The following implementation of is_complete_type is taken from +// https://blogs.msdn.microsoft.com/vcblog/2015/12/02/partial-support-for-expression-sfinae-in-vs-2015-update-1/ +// and is written by Xiang Fan who agreed to using it in this library. + +template +struct is_complete_type : std::false_type {}; + +template +struct is_complete_type : std::true_type {}; + +template +struct is_compatible_object_type_impl : std::false_type {}; + +template +struct is_compatible_object_type_impl < + BasicJsonType, CompatibleObjectType, + enable_if_t < is_detected::value&& + is_detected::value >> +{ + using object_t = typename BasicJsonType::object_t; + + // macOS's is_constructible does not play well with nonesuch... + static constexpr bool value = + is_constructible::value && + is_constructible::value; +}; + +template +struct is_compatible_object_type + : is_compatible_object_type_impl {}; + +template +struct is_constructible_object_type_impl : std::false_type {}; + +template +struct is_constructible_object_type_impl < + BasicJsonType, ConstructibleObjectType, + enable_if_t < is_detected::value&& + is_detected::value >> +{ + using object_t = typename BasicJsonType::object_t; + + static constexpr bool value = + (is_default_constructible::value && + (std::is_move_assignable::value || + std::is_copy_assignable::value) && + (is_constructible::value && + std::is_same < + typename object_t::mapped_type, + typename ConstructibleObjectType::mapped_type >::value)) || + (has_from_json::value || + has_non_default_from_json < + BasicJsonType, + typename ConstructibleObjectType::mapped_type >::value); +}; + +template +struct is_constructible_object_type + : is_constructible_object_type_impl {}; + +template +struct is_compatible_string_type +{ + static constexpr auto value = + is_constructible::value; +}; + +template +struct is_constructible_string_type +{ + // launder type through decltype() to fix compilation failure on ICPC +#ifdef __INTEL_COMPILER + using laundered_type = decltype(std::declval()); +#else + using laundered_type = ConstructibleStringType; +#endif + + static constexpr auto value = + conjunction < + is_constructible, + is_detected_exact>::value; +}; + +template +struct is_compatible_array_type_impl : std::false_type {}; + +template +struct is_compatible_array_type_impl < + BasicJsonType, CompatibleArrayType, + enable_if_t < + is_detected::value&& + is_iterator_traits>>::value&& +// special case for types like std::filesystem::path whose iterator's value_type are themselves +// c.f. https://github.com/nlohmann/json/pull/3073 + !std::is_same>::value >> +{ + static constexpr bool value = + is_constructible>::value; +}; + +template +struct is_compatible_array_type + : is_compatible_array_type_impl {}; + +template +struct is_constructible_array_type_impl : std::false_type {}; + +template +struct is_constructible_array_type_impl < + BasicJsonType, ConstructibleArrayType, + enable_if_t::value >> + : std::true_type {}; + +template +struct is_constructible_array_type_impl < + BasicJsonType, ConstructibleArrayType, + enable_if_t < !std::is_same::value&& + !is_compatible_string_type::value&& + is_default_constructible::value&& +(std::is_move_assignable::value || + std::is_copy_assignable::value)&& +is_detected::value&& +is_iterator_traits>>::value&& +is_detected::value&& +// special case for types like std::filesystem::path whose iterator's value_type are themselves +// c.f. https://github.com/nlohmann/json/pull/3073 +!std::is_same>::value&& + is_complete_type < + detected_t>::value >> +{ + using value_type = range_value_t; + + static constexpr bool value = + std::is_same::value || + has_from_json::value || + has_non_default_from_json < + BasicJsonType, + value_type >::value; +}; + +template +struct is_constructible_array_type + : is_constructible_array_type_impl {}; + +template +struct is_compatible_integer_type_impl : std::false_type {}; + +template +struct is_compatible_integer_type_impl < + RealIntegerType, CompatibleNumberIntegerType, + enable_if_t < std::is_integral::value&& + std::is_integral::value&& + !std::is_same::value >> +{ + // is there an assert somewhere on overflows? + using RealLimits = std::numeric_limits; + using CompatibleLimits = std::numeric_limits; + + static constexpr auto value = + is_constructible::value && + CompatibleLimits::is_integer && + RealLimits::is_signed == CompatibleLimits::is_signed; +}; + +template +struct is_compatible_integer_type + : is_compatible_integer_type_impl {}; + +template +struct is_compatible_type_impl: std::false_type {}; + +template +struct is_compatible_type_impl < + BasicJsonType, CompatibleType, + enable_if_t::value >> +{ + static constexpr bool value = + has_to_json::value; +}; + +template +struct is_compatible_type + : is_compatible_type_impl {}; + +template +struct is_constructible_tuple : std::false_type {}; + +template +struct is_constructible_tuple> : conjunction...> {}; + +template +struct is_json_iterator_of : std::false_type {}; + +template +struct is_json_iterator_of : std::true_type {}; + +template +struct is_json_iterator_of : std::true_type +{}; + +// checks if a given type T is a template specialization of Primary +template