diff --git a/Samson/NameCollisions.inl b/Samson/NameCollisions.inl new file mode 100644 index 0000000..d103d70 --- /dev/null +++ b/Samson/NameCollisions.inl @@ -0,0 +1,121 @@ +#pragma once + +/* +* SDK generated by Dumper-7 +* +* https://github.com/Encryqed/Dumper-7 +*/ + +// FORWARD DECLARATIONS + + +namespace ABP_LL_Melee_Player_Weapon_Pipe { struct FAnimBlueprintGeneratedConstantData; } + +namespace EMovementMode { enum class EMovementMode : uint8; } + +namespace ABP_LL_VehicleEvade_Environmental { struct FAnimBlueprintGeneratedConstantData; } + +namespace ABP_LL_Intimidation_Success { struct FAnimBlueprintGeneratedConstantData; } + +namespace ABP_ContainedActions { struct FAnimBlueprintGeneratedConstantData; } + +namespace Face_AnimBP { struct FAnimBlueprintGeneratedConstantData; } + +namespace ABP_LL_Intimidation_Success_Responder { struct FAnimBlueprintGeneratedConstantData; } + +namespace ABP_LL_Intimidation_Fail_Responder { struct FAnimBlueprintGeneratedConstantData; } + +namespace ABP_LL_MeleeShoveReact_PlayerDefault { struct FAnimBlueprintGeneratedConstantData; } + +namespace ABP_LL_Intimidation_Fail { struct FAnimBlueprintGeneratedConstantData; } + +namespace ABP_LL_MeleeGrabbed_PlayerDefault { struct FAnimBlueprintGeneratedConstantData; } + +namespace ABP_LL_Suckerpunch { struct FAnimBlueprintGeneratedConstantData; } + +namespace ABP_LL_MeleeShove_PlayerDefault { struct FAnimBlueprintGeneratedConstantData; } + +namespace ABP_LL_EnvironmentalMelee_Railing { struct FAnimBlueprintGeneratedConstantData; } + +namespace GameplayAbilities { struct FServerAbilityRPCBatch; } + +namespace ABP_MeleeGraph { struct FAnimBlueprintGeneratedConstantData; } + +namespace ABP_LL_Env_Interact_Door { struct FAnimBlueprintGeneratedConstantData; } + +namespace ThrownWeapon { struct FAnimBlueprintGeneratedConstantData; } + +namespace ABP_LL_Loco_Crouch_PlayerDefault { struct FAnimBlueprintGeneratedConstantData; } + +namespace ABP_LL_MeleeGrab_PlayerDefault { struct FAnimBlueprintGeneratedConstantData; } + +namespace ABP_LL_EnvironmentalMelee_Table { struct FAnimBlueprintGeneratedConstantData; } + +namespace Engine { enum class EMovementMode : uint8; } + + +namespace ABP_LL_Melee_PlayerDefault +{ + struct FAnimBlueprintGeneratedMutableData; + struct FAnimBlueprintGeneratedConstantData; +} + +namespace Face_PostProcess_AnimBP +{ + struct FAnimBlueprintGeneratedConstantData; + struct FAnimBlueprintGeneratedMutableData; +} + +namespace ABP_InVehicleGraph +{ + struct FAnimBlueprintGeneratedMutableData; + struct FAnimBlueprintGeneratedConstantData; +} + +namespace ABP_LL_LocomotionUnarmed +{ + struct FAnimBlueprintGeneratedConstantData; + struct FAnimBlueprintGeneratedMutableData; +} + +namespace ABP_LL_Loco_Melee_PlayerDefault +{ + struct FAnimBlueprintGeneratedConstantData; + struct FAnimBlueprintGeneratedMutableData; +} + +namespace ABP_Player +{ + struct FAnimBlueprintGeneratedMutableData; + struct FAnimBlueprintGeneratedConstantData; +} + +namespace ABP_CarBase +{ + struct FAnimBlueprintGeneratedMutableData; + struct FAnimBlueprintGeneratedConstantData; +} + +namespace ABP_LadderGraph +{ + struct FAnimBlueprintGeneratedConstantData; + struct FAnimBlueprintGeneratedMutableData; +} + +namespace ABP_PedestrianAnimSharingTransition +{ + struct FAnimBlueprintGeneratedConstantData; + struct FAnimBlueprintGeneratedMutableData; +} + +namespace ABP_LL_SmartObject_Base +{ + struct FAnimBlueprintGeneratedConstantData; + struct FAnimBlueprintGeneratedMutableData; +} + +namespace ABP_InAirGraph +{ + struct FAnimBlueprintGeneratedConstantData; + struct FAnimBlueprintGeneratedMutableData; +} diff --git a/Samson/PropertyFixup.hpp b/Samson/PropertyFixup.hpp new file mode 100644 index 0000000..6728734 --- /dev/null +++ b/Samson/PropertyFixup.hpp @@ -0,0 +1,21 @@ +#pragma once + +/* +* SDK generated by Dumper-7 +* +* https://github.com/Encryqed/Dumper-7 +*/ + +// PROPERTY-FIXUP + + +namespace SDK +{ + +class alignas(0x01) FMulticastSparseDelegateProperty_ +{ + unsigned __int8 Pad[0x1]; +}; + +} + diff --git a/Samson/SDK.hpp b/Samson/SDK.hpp new file mode 100644 index 0000000..dbfd304 --- /dev/null +++ b/Samson/SDK.hpp @@ -0,0 +1,968 @@ +#pragma once + +/* +* SDK generated by Dumper-7 +* +* https://github.com/Encryqed/Dumper-7 +*/ + +// CJ +// 5.7.4-263190+++p1+devstable-bmcode + +// Includes the entire SDK. Include files directly for faster compilation! + +#include "SDK/Basic.hpp" +#include "SDK/CoreUObject_structs.hpp" +#include "SDK/PhysicsCore_structs.hpp" +#include "SDK/InputCore_structs.hpp" +#include "SDK/Slate_structs.hpp" +#include "SDK/StateStream_structs.hpp" +#include "SDK/SlateCore_structs.hpp" +#include "SDK/ChaosVDRuntime_structs.hpp" +#include "SDK/Chaos_structs.hpp" +#include "SDK/RenderCore_structs.hpp" +#include "SDK/Engine_structs.hpp" +#include "SDK/CoreUObject_classes.hpp" +#include "SDK/BP_Skill_Perk_DamageBonus_classes.hpp" +#include "SDK/PhysicsCore_classes.hpp" +#include "SDK/FieldNotification_structs.hpp" +#include "SDK/ClothingSystemRuntimeInterface_structs.hpp" +#include "SDK/AudioPlatformConfiguration_structs.hpp" +#include "SDK/DeveloperSettings_structs.hpp" +#include "SDK/DeveloperSettings_classes.hpp" +#include "SDK/AudioExtensions_structs.hpp" +#include "SDK/AudioExtensions_classes.hpp" +#include "SDK/NetCore_structs.hpp" +#include "SDK/NetCore_classes.hpp" +#include "SDK/Engine_classes.hpp" +#include "SDK/GameplayTags_structs.hpp" +#include "SDK/DataRegistry_structs.hpp" +#include "SDK/UniversalObjectLocator_structs.hpp" +#include "SDK/MovieScene_structs.hpp" +#include "SDK/GameplayAbilities_structs.hpp" +#include "SDK/GameplayAbilities_classes.hpp" +#include "SDK/CJWorldState_structs.hpp" +#include "SDK/CJInteraction_structs.hpp" +#include "SDK/AIModule_structs.hpp" +#include "SDK/CJInventory_structs.hpp" +#include "SDK/CJScreenNavigation_structs.hpp" +#include "SDK/CJWorldIcons_structs.hpp" +#include "SDK/ZoneGraph_structs.hpp" +#include "SDK/AkAudio_structs.hpp" +#include "SDK/ChaosVehicles_structs.hpp" +#include "SDK/AnimationCore_structs.hpp" +#include "SDK/CommonInput_structs.hpp" +#include "SDK/CJ_structs.hpp" +#include "SDK/PDA_Objective_Acquire_classes.hpp" +#include "SDK/InteractiveToolsFramework_structs.hpp" +#include "SDK/InteractiveToolsFramework_classes.hpp" +#include "SDK/ModelingComponents_structs.hpp" +#include "SDK/ModelingComponents_classes.hpp" +#include "SDK/AnimationCore_classes.hpp" +#include "SDK/InputCore_classes.hpp" +#include "SDK/SlateCore_classes.hpp" +#include "SDK/ImageCore_structs.hpp" +#include "SDK/ImageCore_classes.hpp" +#include "SDK/Slate_classes.hpp" +#include "SDK/EngineSettings_structs.hpp" +#include "SDK/EngineSettings_classes.hpp" +#include "SDK/BuildPatchServices_structs.hpp" +#include "SDK/BuildPatchServices_classes.hpp" +#include "SDK/ABP_LL_EnvironmentalMelee_Table_structs.hpp" +#include "SDK/ABP_LL_EnvironmentalMelee_Table_classes.hpp" +#include "SDK/MeshDescription_structs.hpp" +#include "SDK/MeshDescription_classes.hpp" +#include "SDK/BP_TutorialComponent_classes.hpp" +#include "SDK/NNE_structs.hpp" +#include "SDK/NNE_classes.hpp" +#include "SDK/FieldNotification_classes.hpp" +#include "SDK/IrisCore_structs.hpp" +#include "SDK/IrisCore_classes.hpp" +#include "SDK/GLBP_StreetLightHead01_Cold_classes.hpp" +#include "SDK/StaticMeshDescription_structs.hpp" +#include "SDK/StaticMeshDescription_classes.hpp" +#include "SDK/BP_ContextualCameraManager_PlayerCharacter_classes.hpp" +#include "SDK/SkeletalMeshDescription_structs.hpp" +#include "SDK/SkeletalMeshDescription_classes.hpp" +#include "SDK/BP_Flies01_classes.hpp" +#include "SDK/AssetRegistry_structs.hpp" +#include "SDK/AssetRegistry_classes.hpp" +#include "SDK/DataflowCore_structs.hpp" +#include "SDK/DataflowCore_classes.hpp" +#include "SDK/PropertyPath_structs.hpp" +#include "SDK/PropertyPath_classes.hpp" +#include "SDK/AudioLinkCore_classes.hpp" +#include "SDK/TypedElementFramework_structs.hpp" +#include "SDK/TypedElementFramework_classes.hpp" +#include "SDK/TypedElementRuntime_structs.hpp" +#include "SDK/TypedElementRuntime_classes.hpp" +#include "SDK/JsonUtilities_structs.hpp" +#include "SDK/JsonUtilities_classes.hpp" +#include "SDK/WBP_MenuButtonNew_classes.hpp" +#include "SDK/PDA_Objective_Reach_Simple_classes.hpp" +#include "SDK/PacketHandler_classes.hpp" +#include "SDK/ClothingSystemRuntimeInterface_classes.hpp" +#include "SDK/VehicleReadyToDrive_classes.hpp" +#include "SDK/ImageWriteQueue_structs.hpp" +#include "SDK/ImageWriteQueue_classes.hpp" +#include "SDK/MaterialShaderQualitySettings_structs.hpp" +#include "SDK/MaterialShaderQualitySettings_classes.hpp" +#include "SDK/BT_BehaviorTokenScoreCalculator_EquipWeapon_classes.hpp" +#include "SDK/EyeTracker_structs.hpp" +#include "SDK/EyeTracker_classes.hpp" +#include "SDK/Renderer_structs.hpp" +#include "SDK/Renderer_classes.hpp" +#include "SDK/HeadMountedDisplay_structs.hpp" +#include "SDK/HeadMountedDisplay_classes.hpp" +#include "SDK/Foliage_structs.hpp" +#include "SDK/Foliage_classes.hpp" +#include "SDK/Landscape_structs.hpp" +#include "SDK/Landscape_classes.hpp" +#include "SDK/SlateRHIRenderer_structs.hpp" +#include "SDK/SlateRHIRenderer_classes.hpp" +#include "SDK/TimeManagement_structs.hpp" +#include "SDK/TimeManagement_classes.hpp" +#include "SDK/MovieScene_classes.hpp" +#include "SDK/DataflowEngine_structs.hpp" +#include "SDK/DataflowEngine_classes.hpp" +#include "SDK/DataflowSimulation_structs.hpp" +#include "SDK/DataflowSimulation_classes.hpp" +#include "SDK/ChaosSolverEngine_structs.hpp" +#include "SDK/ChaosSolverEngine_classes.hpp" +#include "SDK/FieldSystemEngine_structs.hpp" +#include "SDK/FieldSystemEngine_classes.hpp" +#include "SDK/MeshModelingToolsExp_structs.hpp" +#include "SDK/ModelingOperators_structs.hpp" +#include "SDK/MeshModelingTools_structs.hpp" +#include "SDK/MeshModelingTools_classes.hpp" +#include "SDK/MeshModelingToolsExp_classes.hpp" +#include "SDK/ISMPool_classes.hpp" +#include "SDK/GeometryCollectionEngine_structs.hpp" +#include "SDK/GeometryCollectionEngine_classes.hpp" +#include "SDK/BP_Skill_CheatDeath_classes.hpp" +#include "SDK/AnimGraphRuntime_structs.hpp" +#include "SDK/AnimGraphRuntime_classes.hpp" +#include "SDK/Constraints_structs.hpp" +#include "SDK/Constraints_classes.hpp" +#include "SDK/AudioLinkEngine_classes.hpp" +#include "SDK/AudioMixer_structs.hpp" +#include "SDK/AudioMixer_classes.hpp" +#include "SDK/BP_SayScript_Commentary_Nate_classes.hpp" +#include "SDK/MovieSceneTracks_structs.hpp" +#include "SDK/MovieSceneTracks_classes.hpp" +#include "SDK/UMG_structs.hpp" +#include "SDK/UMG_classes.hpp" +#include "SDK/BP_AnimNotify_BreakVehicleWindow_classes.hpp" +#include "SDK/CinematicCamera_structs.hpp" +#include "SDK/CinematicCamera_classes.hpp" +#include "SDK/BP_CharacterLevelCalculation_Cops_classes.hpp" +#include "SDK/GameplayTags_classes.hpp" +#include "SDK/MovieSceneCapture_structs.hpp" +#include "SDK/MovieSceneCapture_classes.hpp" +#include "SDK/MediaAssets_structs.hpp" +#include "SDK/MediaAssets_classes.hpp" +#include "SDK/LevelSequence_structs.hpp" +#include "SDK/LevelSequence_classes.hpp" +#include "SDK/InterchangePipelines_structs.hpp" +#include "SDK/InterchangeNodes_structs.hpp" +#include "SDK/InterchangeCommon_structs.hpp" +#include "SDK/InterchangeFactoryNodes_structs.hpp" +#include "SDK/InterchangeCore_structs.hpp" +#include "SDK/InterchangeCore_classes.hpp" +#include "SDK/HairStrandsCore_structs.hpp" +#include "SDK/InterchangePipelines_classes.hpp" +#include "SDK/MRMesh_structs.hpp" +#include "SDK/MRMesh_classes.hpp" +#include "SDK/MoviePlayer_structs.hpp" +#include "SDK/MoviePlayer_classes.hpp" +#include "SDK/MassEntity_structs.hpp" +#include "SDK/MassEntity_classes.hpp" +#include "SDK/PLA_WoodenFence02_01_100_classes.hpp" +#include "SDK/Serialization_structs.hpp" +#include "SDK/Serialization_classes.hpp" +#include "SDK/USDClasses_structs.hpp" +#include "SDK/USDClasses_classes.hpp" +#include "SDK/Overlay_structs.hpp" +#include "SDK/Overlay_classes.hpp" +#include "SDK/ClothingSystemRuntimeCommon_structs.hpp" +#include "SDK/ClothingSystemRuntimeCommon_classes.hpp" +#include "SDK/ClothingSystemRuntimeNv_structs.hpp" +#include "SDK/ClothingSystemRuntimeNv_classes.hpp" +#include "SDK/NiagaraCore_structs.hpp" +#include "SDK/NiagaraCore_classes.hpp" +#include "SDK/PropertyBindingUtils_structs.hpp" +#include "SDK/PropertyBindingUtils_classes.hpp" +#include "SDK/NiagaraShader_structs.hpp" +#include "SDK/NiagaraShader_classes.hpp" +#include "SDK/Niagara_structs.hpp" +#include "SDK/Niagara_classes.hpp" +#include "SDK/GameplayTasks_structs.hpp" +#include "SDK/GameplayTasks_classes.hpp" +#include "SDK/ACLPlugin_structs.hpp" +#include "SDK/ACLPlugin_classes.hpp" +#include "SDK/NavigationSystem_structs.hpp" +#include "SDK/NavigationSystem_classes.hpp" +#include "SDK/AIModule_classes.hpp" +#include "SDK/WwiseFileHandler_structs.hpp" +#include "SDK/WwiseResourceLoader_structs.hpp" +#include "SDK/AkAudio_classes.hpp" +#include "SDK/ZoneGraph_classes.hpp" +#include "SDK/MotionTrajectory_structs.hpp" +#include "SDK/CJTimeOfDayPreset_structs.hpp" +#include "SDK/CJTimeOfDayPreset_classes.hpp" +#include "SDK/ChaosVehicles_classes.hpp" +#include "SDK/CommonLoadingScreen_structs.hpp" +#include "SDK/CJInteraction_classes.hpp" +#include "SDK/PCG_structs.hpp" +#include "SDK/PCG_classes.hpp" +#include "SDK/WorldConditions_structs.hpp" +#include "SDK/SmartObjectsModule_structs.hpp" +#include "SDK/CJInventory_classes.hpp" +#include "SDK/CJTime_structs.hpp" +#include "SDK/CJSlateWidgets_structs.hpp" +#include "SDK/CJ_classes.hpp" +#include "SDK/BP_CharacterSoundEffectsController_classes.hpp" +#include "SDK/Water_structs.hpp" +#include "SDK/Water_classes.hpp" +#include "SDK/CJRenderCore_structs.hpp" +#include "SDK/CJRenderCore_classes.hpp" +#include "SDK/BlendStack_structs.hpp" +#include "SDK/BlendStack_classes.hpp" +#include "SDK/CJEnvironment_classes.hpp" +#include "SDK/BP_CharacterVisualEffectsController_classes.hpp" +#include "SDK/CJTweening_structs.hpp" +#include "SDK/CJTweening_classes.hpp" +#include "SDK/EVehicleCameraType_structs.hpp" +#include "SDK/EnhancedInput_structs.hpp" +#include "SDK/EnhancedInput_classes.hpp" +#include "SDK/CommonInput_classes.hpp" +#include "SDK/CJSlateWidgets_classes.hpp" +#include "SDK/StartSyncWindow_classes.hpp" +#include "SDK/CommonUI_structs.hpp" +#include "SDK/CommonUI_classes.hpp" +#include "SDK/CJDebug_structs.hpp" +#include "SDK/CJDebug_classes.hpp" +#include "SDK/HTN_structs.hpp" +#include "SDK/HTN_classes.hpp" +#include "SDK/CJBehaviourToken_structs.hpp" +#include "SDK/CJBehaviourToken_classes.hpp" +#include "SDK/PCGGeometryScriptInterop_structs.hpp" +#include "SDK/GeometryScriptingCore_structs.hpp" +#include "SDK/Transient_structs.hpp" +#include "SDK/CJBuildInfo_classes.hpp" +#include "SDK/CJNamedLocations_structs.hpp" +#include "SDK/CJNamedLocations_classes.hpp" +#include "SDK/ImgMediaEngine_classes.hpp" +#include "SDK/CJTelemetry_structs.hpp" +#include "SDK/CJTelemetry_classes.hpp" +#include "SDK/CJWorldState_classes.hpp" +#include "SDK/CJTime_classes.hpp" +#include "SDK/CJJournal_structs.hpp" +#include "SDK/CJJournal_classes.hpp" +#include "SDK/CJBookmarks_structs.hpp" +#include "SDK/CJBookmarks_classes.hpp" +#include "SDK/VectorVM_structs.hpp" +#include "SDK/ModelViewViewModel_structs.hpp" +#include "SDK/ModelViewViewModel_classes.hpp" +#include "SDK/CJModelViewViewModel_classes.hpp" +#include "SDK/CJScreenNavigation_classes.hpp" +#include "SDK/SignificanceManager_classes.hpp" +#include "SDK/DataRegistry_classes.hpp" +#include "SDK/ModularGameplay_structs.hpp" +#include "SDK/ModularGameplay_classes.hpp" +#include "SDK/GeometryCache_structs.hpp" +#include "SDK/GeometryCache_classes.hpp" +#include "SDK/BP_SayCond_FacingEnemy_classes.hpp" +#include "SDK/ChaosCaching_structs.hpp" +#include "SDK/ChaosCaching_classes.hpp" +#include "SDK/HairStrandsCore_classes.hpp" +#include "SDK/Gauntlet_classes.hpp" +#include "SDK/GameSettings_structs.hpp" +#include "SDK/GameSettings_classes.hpp" +#include "SDK/OnlineSubsystem_structs.hpp" +#include "SDK/OnlineSubsystem_classes.hpp" +#include "SDK/OnlineSubsystemUtils_structs.hpp" +#include "SDK/OnlineSubsystemUtils_classes.hpp" +#include "SDK/Hotfix_structs.hpp" +#include "SDK/Hotfix_classes.hpp" +#include "SDK/GameSubtitles_structs.hpp" +#include "SDK/GameSubtitles_classes.hpp" +#include "SDK/StreamlineRHI_structs.hpp" +#include "SDK/StreamlineRHI_classes.hpp" +#include "SDK/StreamlineBlueprint_structs.hpp" +#include "SDK/StreamlineBlueprint_classes.hpp" +#include "SDK/StreamlineDLSSGBlueprint_structs.hpp" +#include "SDK/StreamlineDLSSGBlueprint_classes.hpp" +#include "SDK/StreamlineReflexBlueprint_structs.hpp" +#include "SDK/StreamlineReflexBlueprint_classes.hpp" +#include "SDK/DLSS_structs.hpp" +#include "SDK/DLSS_classes.hpp" +#include "SDK/BP_SO_LAL_SimpleInteraction_Base_classes.hpp" +#include "SDK/ChaosVDBlueprint_classes.hpp" +#include "SDK/DLSSBlueprint_structs.hpp" +#include "SDK/DLSSBlueprint_classes.hpp" +#include "SDK/CommonLoadingScreen_classes.hpp" +#include "SDK/WwiseFileHandler_classes.hpp" +#include "SDK/WwiseResourceLoader_classes.hpp" +#include "SDK/WwisePackagingRuntime_structs.hpp" +#include "SDK/WwisePackagingRuntime_classes.hpp" +#include "SDK/WwisePackaging_classes.hpp" +#include "SDK/Chooser_structs.hpp" +#include "SDK/ProxyTable_structs.hpp" +#include "SDK/ProxyTable_classes.hpp" +#include "SDK/ClientPilot_classes.hpp" +#include "SDK/CJLyraBase_structs.hpp" +#include "SDK/CJLyraBase_classes.hpp" +#include "SDK/CJSchedule_structs.hpp" +#include "SDK/CJSchedule_classes.hpp" +#include "SDK/BP_SayCond_TimeSinceLastLine_classes.hpp" +#include "SDK/CJWorldIcons_classes.hpp" +#include "SDK/OSC_structs.hpp" +#include "SDK/OSC_classes.hpp" +#include "SDK/CJOSC_classes.hpp" +#include "SDK/TargetingSystem_structs.hpp" +#include "SDK/TargetingSystem_classes.hpp" +#include "SDK/WorldConditions_classes.hpp" +#include "SDK/SmartObjectsModule_classes.hpp" +#include "SDK/GameplayBehaviorsModule_structs.hpp" +#include "SDK/GameplayBehaviorsModule_classes.hpp" +#include "SDK/ZoneGraphDebug_classes.hpp" +#include "SDK/ZoneGraphAnnotations_structs.hpp" +#include "SDK/ZoneGraphAnnotations_classes.hpp" +#include "SDK/FFXFSRSettings_structs.hpp" +#include "SDK/FFXFSRSettings_classes.hpp" +#include "SDK/RigVM_structs.hpp" +#include "SDK/RigVM_classes.hpp" +#include "SDK/CJ_Startup_classes.hpp" +#include "SDK/ControlRig_structs.hpp" +#include "SDK/ControlRig_classes.hpp" +#include "SDK/RigLogicModule_structs.hpp" +#include "SDK/RigLogicModule_classes.hpp" +#include "SDK/SunPosition_structs.hpp" +#include "SDK/SunPosition_classes.hpp" +#include "SDK/PLA_ResidentialLow04_classes.hpp" +#include "SDK/ChaosVehiclesCore_structs.hpp" +#include "SDK/ChaosVehiclesCore_classes.hpp" +#include "SDK/ChaosVehiclesEngine_classes.hpp" +#include "SDK/BP_Skill_Perk_HealWhenDefeatEnemy_classes.hpp" +#include "SDK/MotionWarping_structs.hpp" +#include "SDK/MotionWarping_classes.hpp" +#include "SDK/GeometryFlowCore_structs.hpp" +#include "SDK/ComputeFramework_structs.hpp" +#include "SDK/ComputeFramework_classes.hpp" +#include "SDK/AnimationWarpingRuntime_structs.hpp" +#include "SDK/AnimationWarpingRuntime_classes.hpp" +#include "SDK/GeometryScriptingCore_classes.hpp" +#include "SDK/AnimationLocomotionLibraryRuntime_classes.hpp" +#include "SDK/GameplayBehaviorSmartObjectsModule_classes.hpp" +#include "SDK/GeometryFramework_structs.hpp" +#include "SDK/GeometryFramework_classes.hpp" +#include "SDK/BP_VM_NpcIcon_classes.hpp" +#include "SDK/Chooser_classes.hpp" +#include "SDK/PoseSearch_structs.hpp" +#include "SDK/PoseSearch_classes.hpp" +#include "SDK/MotionTrajectory_classes.hpp" +#include "SDK/AnimationBudgetAllocator_structs.hpp" +#include "SDK/AnimationBudgetAllocator_classes.hpp" +#include "SDK/Awful_SplineMovement_structs.hpp" +#include "SDK/Awful_SplineMovement_classes.hpp" +#include "SDK/OnlineSubsystemSteam_classes.hpp" +#include "SDK/AnimationSharing_structs.hpp" +#include "SDK/AnimationSharing_classes.hpp" +#include "SDK/WwiseSimpleExternalSource_structs.hpp" +#include "SDK/WwiseSimpleExternalSource_classes.hpp" +#include "SDK/CJOnline_classes.hpp" +#include "SDK/CJCellStreaming_structs.hpp" +#include "SDK/CJCellStreaming_classes.hpp" +#include "SDK/BP_Item_Gun_classes.hpp" +#include "SDK/TextureUtilitiesCommon_structs.hpp" +#include "SDK/TextureUtilitiesCommon_classes.hpp" +#include "SDK/ModelingOperators_classes.hpp" +#include "SDK/EMovementState_structs.hpp" +#include "SDK/GeometryCacheTracks_structs.hpp" +#include "SDK/GeometryCacheTracks_classes.hpp" +#include "SDK/NiagaraAnimNotifies_structs.hpp" +#include "SDK/NiagaraAnimNotifies_classes.hpp" +#include "SDK/SequencerScripting_structs.hpp" +#include "SDK/SequencerScripting_classes.hpp" +#include "SDK/LiveLinkInterface_structs.hpp" +#include "SDK/LiveLinkInterface_classes.hpp" +#include "SDK/InterchangeEngine_structs.hpp" +#include "SDK/InterchangeEngine_classes.hpp" +#include "SDK/LiveLinkAnimationCore_structs.hpp" +#include "SDK/LiveLinkAnimationCore_classes.hpp" +#include "SDK/LiveLink_structs.hpp" +#include "SDK/LiveLink_classes.hpp" +#include "SDK/LiveLinkComponents_structs.hpp" +#include "SDK/LiveLinkComponents_classes.hpp" +#include "SDK/LiveLinkMovieScene_structs.hpp" +#include "SDK/LiveLinkMovieScene_classes.hpp" +#include "SDK/TakeMovieScene_structs.hpp" +#include "SDK/TakeMovieScene_classes.hpp" +#include "SDK/EStashLocation_structs.hpp" +#include "SDK/AudioCapture_structs.hpp" +#include "SDK/AudioCapture_classes.hpp" +#include "SDK/NamingTokens_structs.hpp" +#include "SDK/NamingTokens_classes.hpp" +#include "SDK/NamingTokensUI_classes.hpp" +#include "SDK/OptimusSettings_structs.hpp" +#include "SDK/OptimusSettings_classes.hpp" +#include "SDK/OptimusCore_structs.hpp" +#include "SDK/OptimusCore_classes.hpp" +#include "SDK/HairStrandsSolver_structs.hpp" +#include "SDK/HairStrandsSolver_classes.hpp" +#include "SDK/HairStrandsDeformer_structs.hpp" +#include "SDK/HairStrandsDeformer_classes.hpp" +#include "SDK/DataflowEnginePlugin_structs.hpp" +#include "SDK/DataflowEnginePlugin_classes.hpp" +#include "SDK/ProceduralMeshComponent_structs.hpp" +#include "SDK/ProceduralMeshComponent_classes.hpp" +#include "SDK/PBIK_structs.hpp" +#include "SDK/IKRig_structs.hpp" +#include "SDK/IKRig_classes.hpp" +#include "SDK/ContextualAnimation_structs.hpp" +#include "SDK/ContextualAnimation_classes.hpp" +#include "SDK/ConsoleVariablesEditorRuntime_structs.hpp" +#include "SDK/ConsoleVariablesEditorRuntime_classes.hpp" +#include "SDK/PCGGeometryScriptInterop_classes.hpp" +#include "SDK/WinDualShock_classes.hpp" +#include "SDK/SLoot_structs.hpp" +#include "SDK/Qos_structs.hpp" +#include "SDK/Qos_classes.hpp" +#include "SDK/Party_structs.hpp" +#include "SDK/Party_classes.hpp" +#include "SDK/Lobby_structs.hpp" +#include "SDK/Lobby_classes.hpp" +#include "SDK/Rejoin_structs.hpp" +#include "SDK/Rejoin_classes.hpp" +#include "SDK/CustomizableSequencerTracks_structs.hpp" +#include "SDK/CustomizableSequencerTracks_classes.hpp" +#include "SDK/BinkMediaPlayer_structs.hpp" +#include "SDK/BinkMediaPlayer_classes.hpp" +#include "SDK/InterchangeNodes_classes.hpp" +#include "SDK/VariantManagerContent_structs.hpp" +#include "SDK/VariantManagerContent_classes.hpp" +#include "SDK/InterchangeFactoryNodes_classes.hpp" +#include "SDK/InterchangeMessages_classes.hpp" +#include "SDK/InterchangeImport_structs.hpp" +#include "SDK/InterchangeImport_classes.hpp" +#include "SDK/GeometryCacheStreamer_classes.hpp" +#include "SDK/GeometryCacheUSD_classes.hpp" +#include "SDK/USDStage_structs.hpp" +#include "SDK/UnrealUSDWrapper_structs.hpp" +#include "SDK/USDStage_classes.hpp" +#include "SDK/AnalyticsBlueprintLibrary_structs.hpp" +#include "SDK/AnalyticsBlueprintLibrary_classes.hpp" +#include "SDK/BPI_SmartObjectPropHandling_classes.hpp" +#include "SDK/InterchangeExport_classes.hpp" +#include "SDK/SkeletalMerging_structs.hpp" +#include "SDK/SkeletalMerging_classes.hpp" +#include "SDK/BPFL_UI_HudNotifications_classes.hpp" +#include "SDK/SocketSubsystemEOS_classes.hpp" +#include "SDK/OnlineSubsystemEOS_structs.hpp" +#include "SDK/OnlineSubsystemEOS_classes.hpp" +#include "SDK/NISBlueprint_structs.hpp" +#include "SDK/NISBlueprint_classes.hpp" +#include "SDK/AudioAnalyzer_classes.hpp" +#include "SDK/AudioSynesthesia_structs.hpp" +#include "SDK/AudioSynesthesiaCore_structs.hpp" +#include "SDK/AudioSynesthesia_classes.hpp" +#include "SDK/AdvancedWidgets_structs.hpp" +#include "SDK/AdvancedWidgets_classes.hpp" +#include "SDK/AudioWidgets_structs.hpp" +#include "SDK/AudioWidgets_classes.hpp" +#include "SDK/StateTreeModule_structs.hpp" +#include "SDK/StateTreeModule_classes.hpp" +#include "SDK/TemplateSequence_structs.hpp" +#include "SDK/TemplateSequence_classes.hpp" +#include "SDK/GameplayCameras_structs.hpp" +#include "SDK/GameplayCameras_classes.hpp" +#include "SDK/EngineCameras_structs.hpp" +#include "SDK/EngineCameras_classes.hpp" +#include "SDK/CJCM_VehicleBumpAndRoll_classes.hpp" +#include "SDK/ChaosCloth_structs.hpp" +#include "SDK/ChaosCloth_classes.hpp" +#include "SDK/UObjectPlugin_structs.hpp" +#include "SDK/UObjectPlugin_classes.hpp" +#include "SDK/FacialAnimation_classes.hpp" +#include "SDK/GLTFExporter_structs.hpp" +#include "SDK/GLTFExporter_classes.hpp" +#include "SDK/PDA_Objective_PickupPassengers_classes.hpp" +#include "SDK/AutomationUtils_classes.hpp" +#include "SDK/GeometryCollectionTracks_structs.hpp" +#include "SDK/GeometryCollectionTracks_classes.hpp" +#include "SDK/ChaosNiagara_structs.hpp" +#include "SDK/ChaosNiagara_classes.hpp" +#include "SDK/GlobalConfigurationData_classes.hpp" +#include "SDK/LocalizableMessageBlueprint_classes.hpp" +#include "SDK/MCD_PlayerIsAttacking_classes.hpp" +#include "SDK/BP_Skill_TakedownHealing_classes.hpp" +#include "SDK/NiagaraSimCaching_structs.hpp" +#include "SDK/NiagaraSimCaching_classes.hpp" +#include "SDK/ImgMedia_structs.hpp" +#include "SDK/ImgMedia_classes.hpp" +#include "SDK/BP_Cosmetic_Mixin_classes.hpp" +#include "SDK/ImgMediaFactory_classes.hpp" +#include "SDK/PDA_Objective_Follow_classes.hpp" +#include "SDK/MediaCompositing_structs.hpp" +#include "SDK/MediaCompositing_classes.hpp" +#include "SDK/CompositeCore_structs.hpp" +#include "SDK/CompositeCore_classes.hpp" +#include "SDK/MediaPlate_structs.hpp" +#include "SDK/MediaPlate_classes.hpp" +#include "SDK/TcpMessaging_classes.hpp" +#include "SDK/UdpMessaging_structs.hpp" +#include "SDK/UdpMessaging_classes.hpp" +#include "SDK/MetaHumanSDKRuntime_structs.hpp" +#include "SDK/MetaHumanSDKRuntime_classes.hpp" +#include "SDK/ActorSequence_structs.hpp" +#include "SDK/ActorSequence_classes.hpp" +#include "SDK/ActorLayerUtilities_structs.hpp" +#include "SDK/ActorLayerUtilities_classes.hpp" +#include "SDK/AssetTags_classes.hpp" +#include "SDK/CustomMeshComponent_structs.hpp" +#include "SDK/CustomMeshComponent_classes.hpp" +#include "SDK/TraceUtilities_classes.hpp" +#include "SDK/WorldMetricsCore_structs.hpp" +#include "SDK/WorldMetricsCore_classes.hpp" +#include "SDK/CsvMetrics_classes.hpp" +#include "SDK/WwiseNiagara_classes.hpp" +#include "SDK/BP_Skill_DmgBonusLowHealth_classes.hpp" +#include "SDK/WwiseAudioLinkRuntime_classes.hpp" +#include "SDK/CoreOnline_structs.hpp" +#include "SDK/MediaUtils_structs.hpp" +#include "SDK/LocalFileNetworkReplayStreaming_structs.hpp" +#include "SDK/BP_FlagRaise_interval_classes.hpp" +#include "SDK/HttpNetworkReplayStreaming_structs.hpp" +#include "SDK/Landmass_structs.hpp" +#include "SDK/LiveLinkMessageBusFramework_structs.hpp" +#include "SDK/FullBodyIK_structs.hpp" +#include "SDK/DataflowNodes_structs.hpp" +#include "SDK/GeometryFlowMeshProcessing_structs.hpp" +#include "SDK/InterchangeCommonParser_structs.hpp" +#include "SDK/ControlRigSpline_structs.hpp" +#include "SDK/AudioWidgetsCore_structs.hpp" +#include "SDK/GeometryDataflowNodes_structs.hpp" +#include "SDK/FractureEngine_structs.hpp" +#include "SDK/GeometryCollectionNodes_structs.hpp" +#include "SDK/GeometryCollectionDepNodes_structs.hpp" +#include "SDK/EngineMessages_structs.hpp" +#include "SDK/SessionMessages_structs.hpp" +#include "SDK/WidgetCarousel_structs.hpp" +#include "SDK/WwiseObjectUtils_structs.hpp" +#include "SDK/LiveLinkControlRig_structs.hpp" +#include "SDK/BP_ReleaseLogic_Confront_classes.hpp" +#include "SDK/WebBrowser_structs.hpp" +#include "SDK/LocalizableMessage_structs.hpp" +#include "SDK/DmgTypeBP_Environmental_classes.hpp" +#include "SDK/PDA_LooseWanted_classes.hpp" +#include "SDK/BP_TurnOffClimbUp_classes.hpp" +#include "SDK/EActivityState_structs.hpp" +#include "SDK/EEnergyLevel_structs.hpp" +#include "SDK/BP_SayCond_NPCCommentary_Revenge_classes.hpp" +#include "SDK/BP_SayCond_MinAmountEnemies_classes.hpp" +#include "SDK/BP_Skill_Perk_DebtPaymentBonus_classes.hpp" +#include "SDK/BP_SayScript_SayWelcomeHome_classes.hpp" +#include "SDK/ALI_ContainedAction_classes.hpp" +#include "SDK/BP_SayScript_Commentary_Floyd_classes.hpp" +#include "SDK/WBP_HUD_VehicleHealthbar_classes.hpp" +#include "SDK/BP_SayCarIntro_classes.hpp" +#include "SDK/ECycleGait_structs.hpp" +#include "SDK/SGaitSequences_structs.hpp" +#include "SDK/BP_SayScript_Commentary_Carter_classes.hpp" +#include "SDK/BP_SayCond_GreatDay_classes.hpp" +#include "SDK/BP_SayCond_NotStrikeWarningApt_classes.hpp" +#include "SDK/BP_SayCond_NotSuppressed_classes.hpp" +#include "SDK/BP_SayScript_Commentary_Suzy_classes.hpp" +#include "SDK/ABP_LL_MeleeShove_PlayerDefault_structs.hpp" +#include "SDK/ABP_LL_MeleeShove_PlayerDefault_classes.hpp" +#include "SDK/BP_SayCond_NPCCommentary_Betrayal_classes.hpp" +#include "SDK/BP_SayCond_NPCCommentary_StitchedUp_classes.hpp" +#include "SDK/MCD_TimeSinceVisualContact_classes.hpp" +#include "SDK/BP_SayCond_MinEnemiesDefeated_classes.hpp" +#include "SDK/BP_SayCond_NPCCommentary_Stitches_classes.hpp" +#include "SDK/BP_SayScript_Commentary_OMalley_classes.hpp" +#include "SDK/PLA_HarborWoodBuilding06_classes.hpp" +#include "SDK/BP_SayCond_NPCCommentary_WelcomeHome_classes.hpp" +#include "SDK/WBP_EnemyHealthbar_classes.hpp" +#include "SDK/BP_SayCond_InDebtOrNotInDebt_classes.hpp" +#include "SDK/BP_SayCond_MinCombatTime_classes.hpp" +#include "SDK/BP_SayScript_Commentary_Richie_classes.hpp" +#include "SDK/BP_PickupItem_Action_classes.hpp" +#include "SDK/BP_SayCond_BadDay_classes.hpp" +#include "SDK/BP_SayScript_Commentary_Tommy_classes.hpp" +#include "SDK/BP_SayScript_Commentary_Vivian_classes.hpp" +#include "SDK/BP_SayCond_HasValidCombatTarget_classes.hpp" +#include "SDK/BP_SayCond_Evening_classes.hpp" +#include "SDK/BP_Attribute_Mixin_classes.hpp" +#include "SDK/BP_SayCond_Morning_classes.hpp" +#include "SDK/BP_SayCondition_IsStreetRaceCrime_classes.hpp" +#include "SDK/BP_SayCondition_IsKillMemberCrime_classes.hpp" +#include "SDK/BP_SayCondition_IsStealCarCrime_classes.hpp" +#include "SDK/ABP_PedestrianAnimSharingTransition_structs.hpp" +#include "SDK/ABP_PedestrianAnimSharingTransition_classes.hpp" +#include "SDK/BP_IntentCondition_IsHitCrime_classes.hpp" +#include "SDK/CJCM_DialogueZoomIn_classes.hpp" +#include "SDK/BP_Trash_Standalone02_200x200_Destr_classes.hpp" +#include "SDK/PLA_ElectricalKit05_classes.hpp" +#include "SDK/BP_SayCondition_IsRobberyCrime_classes.hpp" +#include "SDK/BP_SayCond_MaxDistance1_classes.hpp" +#include "SDK/BP_SayCond_Escaping_classes.hpp" +#include "SDK/PDA_Objective_Talk_classes.hpp" +#include "SDK/BP_ResumeFlow_classes.hpp" +#include "SDK/SPivotStateInfo_structs.hpp" +#include "SDK/PDA_Objective_Reach_classes.hpp" +#include "SDK/BP_AnimUtility_classes.hpp" +#include "SDK/PDA_Objective_Kill_classes.hpp" +#include "SDK/BPI_Radio_classes.hpp" +#include "SDK/BP_EndOfDayExperience_classes.hpp" +#include "SDK/BPFL_StoryDeck_classes.hpp" +#include "SDK/BP_Enforcement_classes.hpp" +#include "SDK/BP_Enforcement_Gang_classes.hpp" +#include "SDK/InputActionWidgetStyle_Default_classes.hpp" +#include "SDK/BP_CommonUIRichTextData_classes.hpp" +#include "SDK/BP_VM_HUD_SkillBase_classes.hpp" +#include "SDK/BP_Skill_UIMetaData_Mixin_classes.hpp" +#include "SDK/BP_Skill_Mixin_classes.hpp" +#include "SDK/PLA_ResidentialLow01_classes.hpp" +#include "SDK/BP_Attribute_UIMetaData_Mixin_classes.hpp" +#include "SDK/BP_Stat_UIMetaData_Mixin_classes.hpp" +#include "SDK/BP_TakeDrugsNotify_classes.hpp" +#include "SDK/BP_Stat_Mixin_classes.hpp" +#include "SDK/BP_POI_UIMetaData_Mixin_classes.hpp" +#include "SDK/BP_TutorialData_Mixin_classes.hpp" +#include "SDK/BP_Perk_Mixin_classes.hpp" +#include "SDK/GLBP_Billboard01_800x400_WallMounted01_classes.hpp" +#include "SDK/LS_Startup_classes.hpp" +#include "SDK/SPowerlineCableTarget_structs.hpp" +#include "SDK/BP_CableCluster_classes.hpp" +#include "SDK/BP_ActionCondition_AnyFlagsMatch_classes.hpp" +#include "SDK/EDoorHazardActionType_structs.hpp" +#include "SDK/LockRotation_classes.hpp" +#include "SDK/DmgTypeBP_Explosion_classes.hpp" +#include "SDK/DmgTypeBP_Shotgun_classes.hpp" +#include "SDK/ALI_EnvironmentalMelee_classes.hpp" +#include "SDK/BP_AnimNotify_FireAndForgetSFX_classes.hpp" +#include "SDK/EndToLocomotionBranch_classes.hpp" +#include "SDK/DmgTypeBP_Melee_classes.hpp" +#include "SDK/BP_ActionCondition_AllFlagsMatch_classes.hpp" +#include "SDK/BP_TriggerIntent_classes.hpp" +#include "SDK/EOpenDoorSideCheck_structs.hpp" +#include "SDK/BP_RoadsideDestructible_classes.hpp" +#include "SDK/SCollectibleRewards_structs.hpp" +#include "SDK/BP_CommonInput_classes.hpp" +#include "SDK/WBP_UILayout_classes.hpp" +#include "SDK/CommonInput_KeyboardMouse_classes.hpp" +#include "SDK/CommonInput_Gamepad_XSX_classes.hpp" +#include "SDK/CommonInput_Gamepad_PS5_classes.hpp" +#include "SDK/BP_DefaultUISoundEventHandler_classes.hpp" +#include "SDK/BP_Camera_Shake_VelocityBased_Vehicle_classes.hpp" +#include "SDK/VEPM_Nitro_classes.hpp" +#include "SDK/BP_DialogueComponent_classes.hpp" +#include "SDK/BP_MeleeWeapon_Base_classes.hpp" +#include "SDK/BP_DrivingMetadataComponent_classes.hpp" +#include "SDK/Audio_Impact_Component_classes.hpp" +#include "SDK/BP_VM_LevelAvailable_classes.hpp" +#include "SDK/BP_SO_LAL_Ui_SofaSleep_OnlyUseForUi_classes.hpp" +#include "SDK/SAttributeData_structs.hpp" +#include "SDK/ABP_Player_structs.hpp" +#include "SDK/SIKFootPinningSettings_structs.hpp" +#include "SDK/EMM_RotationMode_structs.hpp" +#include "SDK/EMM_Stance_structs.hpp" +#include "SDK/SIKFootPinningState_structs.hpp" +#include "SDK/SIKFootPinningCRPayload_structs.hpp" +#include "SDK/EMovementMode_structs.hpp" +#include "SDK/EUpperBodyFilterMode_structs.hpp" +#include "SDK/EMM_SpeedState_structs.hpp" +#include "SDK/ABP_Player_classes.hpp" +#include "SDK/CJCM_SideRam_classes.hpp" +#include "SDK/BPI_Skill_DealDamageMultiplier_classes.hpp" +#include "SDK/BPFL_CJ_Blueprint_Function_Library_classes.hpp" +#include "SDK/CJCM_Rooftop_Framing_Adjustment_classes.hpp" +#include "SDK/ALI_CarDoors_classes.hpp" +#include "SDK/ABP_CarBase_structs.hpp" +#include "SDK/ABP_CarBase_classes.hpp" +#include "SDK/SLevelUpData_structs.hpp" +#include "SDK/BP_KickDownAbilityComponent_classes.hpp" +#include "SDK/SXpEvents_structs.hpp" +#include "SDK/BP_Stat_ItemInstance_classes.hpp" +#include "SDK/ETailTargetSuspicionStates_structs.hpp" +#include "SDK/ABP_LL_Melee_PlayerDefault_structs.hpp" +#include "SDK/ABP_LL_Melee_PlayerDefault_classes.hpp" +#include "SDK/VEPM_inAir_classes.hpp" +#include "SDK/EObjectiveIconType_structs.hpp" +#include "SDK/PDA_MissionDelivery_classes.hpp" +#include "SDK/CJCM_NitroBoost_classes.hpp" +#include "SDK/BP_EPM_IdleRPMNoise_classes.hpp" +#include "SDK/DmgTypeBP_TakedownHealing_classes.hpp" +#include "SDK/CJCM_LookAt_classes.hpp" +#include "SDK/EVehicleCameraAngles_structs.hpp" +#include "SDK/BP_Camera_Shake_Burnout_New_classes.hpp" +#include "SDK/VEPM_SideRam_classes.hpp" +#include "SDK/BPI_Skill_TakeDamageMultiplier_classes.hpp" +#include "SDK/BP_VM_PointOfInterest_classes.hpp" +#include "SDK/BPI_RemoteKeys_classes.hpp" +#include "SDK/BP_SideRamComponent_classes.hpp" +#include "SDK/BP_Vignette_WreckFire_Wreck_classes.hpp" +#include "SDK/BPFL_Destruction_classes.hpp" +#include "SDK/CJCM_DriftMode_classes.hpp" +#include "SDK/BPFL_SkillSystemPrototype_classes.hpp" +#include "SDK/BP_VM_XpReceived_classes.hpp" +#include "SDK/VEPM_LastGear_classes.hpp" +#include "SDK/BP_Moth01_classes.hpp" +#include "SDK/BP_NitroComponent_classes.hpp" +#include "SDK/SStartingInventory_structs.hpp" +#include "SDK/MCD_Interested_classes.hpp" +#include "SDK/BP_Camera_Shake_GearChange_classes.hpp" +#include "SDK/VM_ObjectiveProgress_classes.hpp" +#include "SDK/VM_Objective_classes.hpp" +#include "SDK/BPFL_Objectives_classes.hpp" +#include "SDK/GLBP_Facadelight03_classes.hpp" +#include "SDK/PLA_WoodenFence02_01_200_classes.hpp" +#include "SDK/PLA_WoodenFence02_01_400_classes.hpp" +#include "SDK/PLA_WoodenFence01_Gate200_classes.hpp" +#include "SDK/PLA_Cartire_Stack03_classes.hpp" +#include "SDK/GLBP_StreetLight01_Warm_classes.hpp" +#include "SDK/GLBP_FacadeBroken_Cold_classes.hpp" +#include "SDK/GLBP_CagedLight03_Neutral_classes.hpp" +#include "SDK/BP_Powerline_classes.hpp" +#include "SDK/PLA_WindowPlanks03_classes.hpp" +#include "SDK/PLA_WindowPlanks04_classes.hpp" +#include "SDK/BP_Trash_Standalone05_200x100_Destr_classes.hpp" +#include "SDK/BP_Trash_Standalone03_200x100_Destr_classes.hpp" +#include "SDK/BP_Trash_Standalone01_200x200_Destr_classes.hpp" +#include "SDK/PLA_Billboard01_800x400_WallMounted01_classes.hpp" +#include "SDK/PLA_CarWreck01_Single02_classes.hpp" +#include "SDK/PLA_RooftopsResidentialMedium_classes.hpp" +#include "SDK/PLA_CarWreck01_Single03_classes.hpp" +#include "SDK/PLA_PlayerApartment01_classes.hpp" +#include "SDK/PLA_PlanterWindow01_classes.hpp" +#include "SDK/PLA_BrickBuilding_Front_8m_Residential_06_classes.hpp" +#include "SDK/BP_Engage_MultiTest_classes.hpp" +#include "SDK/ABP_LL_Env_Interact_Door_structs.hpp" +#include "SDK/ABP_LL_Env_Interact_Door_classes.hpp" +#include "SDK/BP_DoorBase_classes.hpp" +#include "SDK/BP_Camera_Shake_HitVehicle_New_classes.hpp" +#include "SDK/BPFL_Progression_classes.hpp" +#include "SDK/BP_Skill_Perk_classes.hpp" +#include "SDK/BP_Archetype_Component_classes.hpp" +#include "SDK/BPFL_XP_classes.hpp" +#include "SDK/BP_VehicleBase_classes.hpp" +#include "SDK/BP_ContextualCameraManager_Car_classes.hpp" +#include "SDK/BP_Trash_Wall01_100x600_Destr_classes.hpp" +#include "SDK/BP_Trash_Wall01_200x600_Destr_classes.hpp" +#include "SDK/BP_ItemInstance_Melee_classes.hpp" +#include "SDK/BP_Skill_TakeLessDmgWhenBroke_classes.hpp" +#include "SDK/BP_Skill_SlowerAdrBurnWhen0AP_classes.hpp" +#include "SDK/BP_Skill_HeavyAttacksPosDmgChance_classes.hpp" +#include "SDK/DmgTypeBP_HealOverTime_classes.hpp" +#include "SDK/BP_Skill_HealWhenAdrFull_classes.hpp" +#include "SDK/BP_Skill_AdrWhenDmgReceived_classes.hpp" +#include "SDK/BP_Skill_AdrenalineRush3_Melee_PosDmgBoost_classes.hpp" +#include "SDK/BP_Skill_AdrRush1_Melee_DmgBonus_classes.hpp" +#include "SDK/BP_Skill_AdrenalineRush2_Melee_HealOverTime_classes.hpp" +#include "SDK/BP_Skill_Perk_TakeLessDamage_classes.hpp" +#include "SDK/DmgTypeBP_Pistol_classes.hpp" +#include "SDK/BPI_KillObjective_classes.hpp" +#include "SDK/BP_InventoryItemUse_classes.hpp" +#include "SDK/BP_TakePainkillersAction_classes.hpp" +#include "SDK/BP_AdrenalineRushAction_classes.hpp" +#include "SDK/ConstrainInput_classes.hpp" +#include "SDK/BP_ActionCondition_OpenDoor_classes.hpp" +#include "SDK/BP_ReleaseLogic_EquipWeapon_classes.hpp" +#include "SDK/BP_TriggerEvadeMisdirection_classes.hpp" +#include "SDK/EarlyPivotBranch_classes.hpp" +#include "SDK/BP_ReleaseLogic_Attack_classes.hpp" +#include "SDK/BP_Attack_MultiTest_classes.hpp" +#include "SDK/BP_ActionCondition_NoFlagsMatch_classes.hpp" +#include "SDK/BP_ReducedPain_classes.hpp" +#include "SDK/BP_Blocking_classes.hpp" +#include "SDK/BP_CharacterLevelCalculation_NearPlayerLevel_classes.hpp" +#include "SDK/VM_HealthInventory_classes.hpp" +#include "SDK/ABP_LL_LocomotionUnarmed_structs.hpp" +#include "SDK/ABP_LL_LocomotionUnarmed_classes.hpp" +#include "SDK/BP_ChangeDisarmChance_Skill_classes.hpp" +#include "SDK/SAI_FirePattern_Struct_structs.hpp" +#include "SDK/ABP_InAirGraph_structs.hpp" +#include "SDK/ABP_InAirGraph_classes.hpp" +#include "SDK/ALI_Melee_classes.hpp" +#include "SDK/BP_ActionCondition_CheckDoor_classes.hpp" +#include "SDK/BP_UI_Interpolator_classes.hpp" +#include "SDK/BP_Camera_Shake_MeleeHitHeavy_classes.hpp" +#include "SDK/PDA_TutorialData_classes.hpp" +#include "SDK/BP_SMartObjectPropComponent_classes.hpp" +#include "SDK/BP_AnimNotifState_ShrinkCapsule_classes.hpp" +#include "SDK/SCycleGaitTransition_structs.hpp" +#include "SDK/BP_TriggerThreatStim_classes.hpp" +#include "SDK/Bp_CharacterCollidsWithSkirt_classes.hpp" +#include "SDK/BPI_Weapon_classes.hpp" +#include "SDK/SDestruction_Effect_Mapping_structs.hpp" +#include "SDK/EndOfTraversal_classes.hpp" +#include "SDK/MCD_InConflict_classes.hpp" +#include "SDK/BP_MeleeWeapon_Broken_classes.hpp" +#include "SDK/UsingSmartObjectSlot_classes.hpp" +#include "SDK/BP_Camera_Shake_Weapon_Fire_Pistol_classes.hpp" +#include "SDK/BP_VM_Tutorial_classes.hpp" +#include "SDK/BP_AnimNotify_BeepCar_classes.hpp" +#include "SDK/EStrafeSegment_structs.hpp" +#include "SDK/BPI_NPCController_classes.hpp" +#include "SDK/BP_AnimNotifState_MeleeCollision_classes.hpp" +#include "SDK/BP_AnimNotify_SetMovementMode_classes.hpp" +#include "SDK/CJCM_AdjustToEnviroSpace_classes.hpp" +#include "SDK/BP_AnimNotifState_NPC_MeleeCollision_classes.hpp" +#include "SDK/BP_ReleaseLogic_ChaseAttack_classes.hpp" +#include "SDK/ALI_LocomotionCore_classes.hpp" +#include "SDK/MCD_TargetEngage_classes.hpp" +#include "SDK/BP_NPCConfidencePrototype_classes.hpp" +#include "SDK/MCD_Confidence_classes.hpp" +#include "SDK/BP_Camera_Shake_BulletHit_classes.hpp" +#include "SDK/DmgTypeBP_Physics_Heavy_classes.hpp" +#include "SDK/WBP_UsableItem_classes.hpp" +#include "SDK/BP_Camera_Shake_Dialogue_classes.hpp" +#include "SDK/CJCM_DialogueHandicam_classes.hpp" +#include "SDK/EarlyToIdleBranch_classes.hpp" +#include "SDK/BP_AnimNotify_TraversalBlocking_classes.hpp" +#include "SDK/ALI_InVehicle_classes.hpp" +#include "SDK/MCD_Tresspasser_classes.hpp" +#include "SDK/SEffect_Mapping_structs.hpp" +#include "SDK/Face_PostProcess_AnimBP_structs.hpp" +#include "SDK/Face_PostProcess_AnimBP_classes.hpp" +#include "SDK/UpdateLadderMovement_classes.hpp" +#include "SDK/ABP_LadderGraph_structs.hpp" +#include "SDK/ABP_LadderGraph_classes.hpp" +#include "SDK/BP_EquipHoldable_classes.hpp" +#include "SDK/BP_CharacterBloodEffectsController_classes.hpp" +#include "SDK/EarlyGaitSwitchBranch_classes.hpp" +#include "SDK/BP_TraversalActionType_classes.hpp" +#include "SDK/BP_CharacterPhysicalAnimationComponent_classes.hpp" +#include "SDK/BPFL_WeaponFunctions_classes.hpp" +#include "SDK/TransitionFromLanding_classes.hpp" +#include "SDK/ECombo_PlaceInCombo_structs.hpp" +#include "SDK/BP_WeaponDispenser_classes.hpp" +#include "SDK/MCD_AttackedByPlayer_classes.hpp" +#include "SDK/BP_ContextualCameraManager_ProxyPlayerCharacter_classes.hpp" +#include "SDK/BP_Camera_Shake_MeleeHit_classes.hpp" +#include "SDK/BP_Camera_Shake_MeleeHitShove_classes.hpp" +#include "SDK/CJCM_Samson_Menu_classes.hpp" +#include "SDK/VM_OnboardingIntruction_classes.hpp" +#include "SDK/BP_AdrenalineRushNotify_classes.hpp" +#include "SDK/BP_Camera_Shake_VelocityBased_OnFoot_classes.hpp" +#include "SDK/AN_FootPlant_classes.hpp" +#include "SDK/SProcessTurnYawCurveInfo_structs.hpp" +#include "SDK/BP_ITM_Stat_Adrenaline_classes.hpp" +#include "SDK/BP_ForceDisarm_classes.hpp" +#include "SDK/BP_CharacterActionNotify_GainAdrenaline_classes.hpp" +#include "SDK/LandingToLocomotion_classes.hpp" +#include "SDK/EarlyToStartBranch_classes.hpp" +#include "SDK/ABP_InVehicleGraph_structs.hpp" +#include "SDK/ABP_InVehicleGraph_classes.hpp" +#include "SDK/ECombo_TypeOfPunch_structs.hpp" +#include "SDK/ABP_MeleeGraph_structs.hpp" +#include "SDK/ABP_MeleeGraph_classes.hpp" +#include "SDK/AN_FootLift_classes.hpp" +#include "SDK/DmgTypeBP_Physics_Light_classes.hpp" +#include "SDK/BP_LootableComponent_classes.hpp" +#include "SDK/BP_TriggerIntentOnTarget_classes.hpp" +#include "SDK/BP_CharacterActionNotify_PostureDamage_classes.hpp" +#include "SDK/EFieldActivationType_structs.hpp" +#include "SDK/BP_AnimNotify_TriggerIntent_classes.hpp" +#include "SDK/WBP_HUD_ProgressBar_classes.hpp" +#include "SDK/BP_VM_MenuTransition_classes.hpp" +#include "SDK/EFieldShapeType_structs.hpp" +#include "SDK/ABP_LL_VehicleEvade_Environmental_structs.hpp" +#include "SDK/ABP_LL_VehicleEvade_Environmental_classes.hpp" +#include "SDK/EarlyBranchToDazed_classes.hpp" +#include "SDK/AN_SmartObjectProp_classes.hpp" +#include "SDK/Face_AnimBP_structs.hpp" +#include "SDK/Face_AnimBP_classes.hpp" +#include "SDK/EAIMentalState_structs.hpp" +#include "SDK/EFieldForceVel_structs.hpp" +#include "SDK/ThrownWeapon_structs.hpp" +#include "SDK/ThrownWeapon_classes.hpp" +#include "SDK/ABP_LL_Melee_Player_Weapon_Pipe_structs.hpp" +#include "SDK/ABP_LL_Melee_Player_Weapon_Pipe_classes.hpp" +#include "SDK/ABP_LL_MeleeGrab_PlayerDefault_structs.hpp" +#include "SDK/ABP_LL_MeleeGrab_PlayerDefault_classes.hpp" +#include "SDK/ABP_LL_Suckerpunch_structs.hpp" +#include "SDK/ABP_LL_Suckerpunch_classes.hpp" +#include "SDK/ABP_LL_MeleeShoveReact_PlayerDefault_structs.hpp" +#include "SDK/ABP_LL_MeleeShoveReact_PlayerDefault_classes.hpp" +#include "SDK/ABP_LL_Intimidation_Success_structs.hpp" +#include "SDK/ABP_LL_Intimidation_Success_classes.hpp" +#include "SDK/ABP_LL_Intimidation_Success_Responder_structs.hpp" +#include "SDK/ABP_LL_Intimidation_Success_Responder_classes.hpp" +#include "SDK/ABP_LL_Intimidation_Fail_Responder_structs.hpp" +#include "SDK/ABP_LL_Intimidation_Fail_Responder_classes.hpp" +#include "SDK/ABP_LL_Intimidation_Fail_structs.hpp" +#include "SDK/ABP_LL_Intimidation_Fail_classes.hpp" +#include "SDK/ABP_LL_MeleeGrabbed_PlayerDefault_structs.hpp" +#include "SDK/ABP_LL_MeleeGrabbed_PlayerDefault_classes.hpp" +#include "SDK/BP_NpcController_classes.hpp" +#include "SDK/BP_TokenCalculator_Engage_classes.hpp" +#include "SDK/BP_TokenCalculator_Agression_classes.hpp" +#include "SDK/FS_Bullet_Default_classes.hpp" +#include "SDK/FS_MasterField_classes.hpp" +#include "SDK/BP_Pipe_classes.hpp" +#include "SDK/EndToIdleBranch_classes.hpp" +#include "SDK/ABP_ContainedActions_structs.hpp" +#include "SDK/ABP_ContainedActions_classes.hpp" +#include "SDK/BP_Pistol_classes.hpp" +#include "SDK/BP_Pistol_Child_classes.hpp" +#include "SDK/BP_PainkillersValid_classes.hpp" +#include "SDK/BP_CharacterActionNotify_GainAdrenaline_MissStreak_classes.hpp" +#include "SDK/ABP_LL_Loco_Melee_PlayerDefault_structs.hpp" +#include "SDK/ABP_LL_Loco_Melee_PlayerDefault_classes.hpp" +#include "SDK/ABP_LL_Loco_Crouch_PlayerDefault_structs.hpp" +#include "SDK/ABP_LL_Loco_Crouch_PlayerDefault_classes.hpp" +#include "SDK/BP_UE4_PlayerCharacter_classes.hpp" +#include "SDK/CJCM_AlignToDialogueCharacter_classes.hpp" +#include "SDK/BP_CombatMetadataComponent_classes.hpp" +#include "SDK/BP_DeathViewModel_classes.hpp" +#include "SDK/BP_VM_ActionPoints_classes.hpp" +#include "SDK/BP_DefaultDeathExperience_classes.hpp" +#include "SDK/STipOfTheDay_structs.hpp" +#include "SDK/BP_VM_HUD_HourToHour_classes.hpp" +#include "SDK/BP_VM_EndOfDayStat_classes.hpp" +#include "SDK/BP_NewDayViewModel_classes.hpp" +#include "SDK/BP_EndOfDayViewModel_classes.hpp" +#include "SDK/BPFL_UI_FunctionLibrary_classes.hpp" +#include "SDK/BP_VM_MissionFlow_classes.hpp" +#include "SDK/BP_VM_MissionEnded_classes.hpp" +#include "SDK/BP_MissionEndedExperience_classes.hpp" +#include "SDK/BTT_PlayerFindAndUseSmartObject_classes.hpp" +#include "SDK/ABP_LL_SmartObject_Base_structs.hpp" +#include "SDK/ABP_LL_SmartObject_Base_classes.hpp" +#include "SDK/BP_SO_LAL_SimpleInteraction_ThreeShot_classes.hpp" +#include "SDK/BP_GameLoopHandler_classes.hpp" +#include "SDK/BP_Skill_Perk_GainXPonKO_classes.hpp" +#include "SDK/BP_ITM_Stat_Health_classes.hpp" +#include "SDK/PDA_Objective_Race_classes.hpp" +#include "SDK/F_MissionAudioLocation_structs.hpp" +#include "SDK/PDA_MissionGetaway_classes.hpp" +#include "SDK/PDA_Objective_AcquireVehicle_classes.hpp" +#include "SDK/PDA_Objective_Wait_classes.hpp" +#include "SDK/BP_AnimNotifState_ShortenCapsule_classes.hpp" +#include "SDK/BP_AnimNotifState_RaiseStepHeight_classes.hpp" +#include "SDK/PreventDeathAnim_classes.hpp" +#include "SDK/BP_AnimNotify_FreezeAnimation_classes.hpp" +#include "SDK/BP_ChangeDisarmChance_classes.hpp" +#include "SDK/ABP_LL_EnvironmentalMelee_Railing_structs.hpp" +#include "SDK/ABP_LL_EnvironmentalMelee_Railing_classes.hpp" +#include "SDK/BP_ActionCondition_IsNotPlayer_classes.hpp" +#include "SDK/InputActionWidgetStyle_HUD_classes.hpp" +#include "SDK/WBP_New_InteractButton_classes.hpp" +#include "SDK/WBP_New_InteractionPoint_TargetMode_classes.hpp" +#include "SDK/MCD_HasTarget_classes.hpp" +#include "SDK/MCD_AllyIsAttacking_classes.hpp" +#include "SDK/MCD_Escalation_classes.hpp" +#include "SDK/MCD_Intensity_classes.hpp" +#include "SDK/BP_VM_HUD_VehicleHealthbar_classes.hpp" +#include "SDK/WBP_New_InteractionPoint_classes.hpp" +#include "SDK/EQC_Player_classes.hpp" +#include "SDK/BP_MusicControl_classes.hpp" +#include "SDK/WBP_Fade_Overlay_classes.hpp" +#include "SDK/EMenuActionButtonType_structs.hpp" +#include "SDK/CommonButtonStyle_Clear_classes.hpp" +#include "SDK/InputActionWidgetStyle_Default_Black_classes.hpp" +#include "SDK/WBP_MenuActionButton_classes.hpp" +#include "SDK/WBP_StartMenu_classes.hpp" diff --git a/Samson/UnrealContainers.hpp b/Samson/UnrealContainers.hpp new file mode 100644 index 0000000..4874083 --- /dev/null +++ b/Samson/UnrealContainers.hpp @@ -0,0 +1,909 @@ +#pragma once + +/* +* SDK generated by Dumper-7 +* +* https://github.com/Encryqed/Dumper-7 +*/ + +// Container implementations with iterators. See https://github.com/Fischsalat/UnrealContainers + +#include +#include +#include +#include "UtfN.hpp" + +namespace UC +{ + typedef int8_t int8; + typedef int16_t int16; + typedef int32_t int32; + typedef int64_t int64; + + typedef uint8_t uint8; + typedef uint16_t uint16; + typedef uint32_t uint32; + typedef uint64_t uint64; + + template + class TArray; + + template + class TSparseArray; + + template + class TSet; + + template + class TMap; + + template + class TPair; + + namespace Iterators + { + class FSetBitIterator; + + template + class TArrayIterator; + + template + class TContainerIterator; + + template + using TSparseArrayIterator = TContainerIterator>; + + template + using TSetIterator = TContainerIterator>; + + template + using TMapIterator = TContainerIterator>; + } + + + namespace ContainerImpl + { + namespace HelperFunctions + { + inline uint32 FloorLog2(uint32 Value) + { + uint32 pos = 0; + if (Value >= 1 << 16) { Value >>= 16; pos += 16; } + if (Value >= 1 << 8) { Value >>= 8; pos += 8; } + if (Value >= 1 << 4) { Value >>= 4; pos += 4; } + if (Value >= 1 << 2) { Value >>= 2; pos += 2; } + if (Value >= 1 << 1) { pos += 1; } + return pos; + } + + inline uint32 CountLeadingZeros(uint32 Value) + { + if (Value == 0) + return 32; + + return 31 - FloorLog2(Value); + } + } + + template + struct TAlignedBytes + { + alignas(Alignment) uint8 Pad[Size]; + }; + + template + class TInlineAllocator + { + public: + template + class ForElementType + { + private: + static constexpr int32 ElementSize = sizeof(ElementType); + static constexpr int32 ElementAlign = alignof(ElementType); + + static constexpr int32 InlineDataSizeBytes = NumInlineElements * ElementSize; + + private: + TAlignedBytes InlineData[NumInlineElements]; + ElementType* SecondaryData; + + public: + ForElementType() + : InlineData{ 0x0 }, SecondaryData(nullptr) + { + } + + ForElementType(ForElementType&&) = default; + ForElementType(const ForElementType&) = default; + + public: + ForElementType& operator=(ForElementType&&) = default; + ForElementType& operator=(const ForElementType&) = default; + + public: + inline const ElementType* GetAllocation() const { return SecondaryData ? SecondaryData : reinterpret_cast(&InlineData); } + + inline uint32 GetNumInlineBytes() const { return NumInlineElements; } + }; + }; + + class FBitArray + { + protected: + static constexpr int32 NumBitsPerDWORD = 32; + static constexpr int32 NumBitsPerDWORDLogTwo = 5; + + private: + TInlineAllocator<4>::ForElementType Data; + int32 NumBits; + int32 MaxBits; + + public: + FBitArray() + : NumBits(0), MaxBits(Data.GetNumInlineBytes() * NumBitsPerDWORD) + { + } + + FBitArray(const FBitArray&) = default; + + FBitArray(FBitArray&&) = default; + + public: + FBitArray& operator=(FBitArray&&) = default; + + FBitArray& operator=(const FBitArray& Other) = default; + + private: + inline void VerifyIndex(int32 Index) const { if (!IsValidIndex(Index)) throw std::out_of_range("Index was out of range!"); } + + public: + inline int32 Num() const { return NumBits; } + inline int32 Max() const { return MaxBits; } + + inline const uint32* GetData() const { return reinterpret_cast(Data.GetAllocation()); } + + inline bool IsValidIndex(int32 Index) const { return Index >= 0 && Index < NumBits; } + + inline bool IsValid() const { return GetData() && NumBits > 0; } + + public: + inline bool operator[](int32 Index) const { VerifyIndex(Index); return GetData()[Index / NumBitsPerDWORD] & (1 << (Index & (NumBitsPerDWORD - 1))); } + + inline bool operator==(const FBitArray& Other) const { return NumBits == Other.NumBits && GetData() == Other.GetData(); } + inline bool operator!=(const FBitArray& Other) const { return NumBits != Other.NumBits || GetData() != Other.GetData(); } + + public: + friend Iterators::FSetBitIterator begin(const FBitArray& Array); + friend Iterators::FSetBitIterator end (const FBitArray& Array); + }; + + template + union TSparseArrayElementOrFreeListLink + { + SparseArrayType ElementData; + + struct + { + int32 PrevFreeIndex; + int32 NextFreeIndex; + }; + }; + + template + class SetElement + { + private: + template + friend class TSet; + + private: + SetType Value; + int32 HashNextId; + int32 HashIndex; + }; + } + + + template + class TPair + { + public: + KeyType First; + ValueType Second; + + public: + TPair(KeyType Key, ValueType Value) + : First(Key), Second(Value) + { + } + + public: + inline KeyType& Key() { return First; } + inline const KeyType& Key() const { return First; } + + inline ValueType& Value() { return Second; } + inline const ValueType& Value() const { return Second; } + }; + + template + class TArray + { + private: + template + friend class TAllocatedArray; + + template + friend class TSparseArray; + + protected: + static constexpr uint64 ElementAlign = alignof(ArrayElementType); + static constexpr uint64 ElementSize = sizeof(ArrayElementType); + + protected: + ArrayElementType* Data; + int32 NumElements; + int32 MaxElements; + + public: + TArray() + : TArray(nullptr, 0, 0) + { + } + + TArray(ArrayElementType* Data, int32 NumElements, int32 MaxElements) + : Data(Data), NumElements(NumElements), MaxElements(MaxElements) + { + } + + TArray(const TArray&) = default; + + TArray(TArray&&) = default; + + public: + TArray& operator=(TArray&&) = default; + TArray& operator=(const TArray&) = default; + + private: + inline int32 GetSlack() const { return MaxElements - NumElements; } + + inline void VerifyIndex(int32 Index) const { if (!IsValidIndex(Index)) throw std::out_of_range("Index was out of range!"); } + + inline ArrayElementType& GetUnsafe(int32 Index) { return Data[Index]; } + inline const ArrayElementType& GetUnsafe(int32 Index) const { return Data[Index]; } + + public: + /* Adds to the array if there is still space for one more element */ + inline bool Add(const ArrayElementType& Element) + { + if (GetSlack() <= 0) + return false; + + Data[NumElements] = Element; + NumElements++; + + return true; + } + + inline bool Remove(int32 Index) + { + if (!IsValidIndex(Index)) + return false; + + NumElements--; + + for (int i = Index; i < NumElements; i++) + { + /* NumElements was decremented, acessing i + 1 is safe */ + Data[i] = Data[i + 1]; + } + + return true; + } + + inline void Clear() + { + NumElements = 0; + + if (Data) + memset(Data, 0, NumElements * ElementSize); + } + + public: + inline int32 Num() const { return NumElements; } + inline int32 Max() const { return MaxElements; } + + inline const ArrayElementType* GetDataPtr() const { return Data; } + + inline bool IsValidIndex(int32 Index) const { return Data && Index >= 0 && Index < NumElements; } + + inline bool IsValid() const { return Data && NumElements > 0 && MaxElements >= NumElements; } + + public: + inline ArrayElementType& operator[](int32 Index) { VerifyIndex(Index); return Data[Index]; } + inline const ArrayElementType& operator[](int32 Index) const { VerifyIndex(Index); return Data[Index]; } + + inline bool operator==(const TArray& Other) const { return Data == Other.Data; } + inline bool operator!=(const TArray& Other) const { return Data != Other.Data; } + + inline explicit operator bool() const { return IsValid(); }; + + public: + template friend Iterators::TArrayIterator begin(const TArray& Array); + template friend Iterators::TArrayIterator end (const TArray& Array); + }; + + class FString : public TArray + { + public: + friend std::ostream& operator<<(std::ostream& Stream, const UC::FString& Str) { return Stream << Str.ToString(); } + + public: + using TArray::TArray; + + FString(const wchar_t* Str) + { + const uint32 NullTerminatedLength = static_cast(wcslen(Str) + 0x1); + + Data = const_cast(Str); + NumElements = NullTerminatedLength; + MaxElements = NullTerminatedLength; + } + + FString(wchar_t* Str, int32 Num, int32 Max) + { + Data = Str; + NumElements = Num; + MaxElements = Max; + } + + public: + inline std::string ToString() const + { + if (*this) + { + return UtfN::Utf16StringToUtf8String(Data, NumElements - 1); // Exclude null-terminator + } + + return ""; + } + + inline std::wstring ToWString() const + { + if (*this) + return std::wstring(Data); + + return L""; + } + + public: + inline wchar_t* CStr() { return Data; } + inline const wchar_t* CStr() const { return Data; } + + public: + inline bool operator==(const FString& Other) const { return Other ? NumElements == Other.NumElements && wcscmp(Data, Other.Data) == 0 : false; } + inline bool operator!=(const FString& Other) const { return Other ? NumElements != Other.NumElements || wcscmp(Data, Other.Data) != 0 : true; } + }; + + // Utf8String that assumes C-APIs (strlen, strcmp) behaviour works for char8_t like Ansi strings, execept it's counting/comparing bytes not characters. + class FUtf8String : public TArray + { + public: + friend std::ostream& operator<<(std::ostream& Stream, const UC::FUtf8String& Str) { return Stream << Str.ToString(); } + + private: + inline const char* GetDataAsConstCharPtr() const + { + return reinterpret_cast(Data); + } + + public: + using TArray::TArray; + + FUtf8String(const char8_t* Str) + { + Data = const_cast(Str); + + const uint32 NullTerminatedLength = static_cast(strlen(GetDataAsConstCharPtr()) + 0x1); + + NumElements = NullTerminatedLength; + MaxElements = NullTerminatedLength; + } + + FUtf8String(char8_t* Str, int32 Num, int32 Max) + { + Data = Str; + NumElements = Num; + MaxElements = Max; + } + + public: + inline std::string ToString() const + { + if (*this) + { + return std::string(GetDataAsConstCharPtr(), NumElements - 1); // Exclude null-terminator + } + + return ""; + } + + inline std::wstring ToWString() const + { + if (*this) + return UtfN::StringToWString(ToString()); // Exclude null-terminator + + return L""; + } + + public: + inline char8_t* CStr() { return Data; } + inline const char8_t* CStr() const { return Data; } + + public: + inline bool operator==(const FUtf8String& Other) const { return Other ? NumElements == Other.NumElements && strcmp(GetDataAsConstCharPtr(), Other.GetDataAsConstCharPtr()) == 0 : false; } + inline bool operator!=(const FUtf8String& Other) const { return Other ? NumElements != Other.NumElements || strcmp(GetDataAsConstCharPtr(), Other.GetDataAsConstCharPtr()) != 0 : true; } + }; + + class FAnsiString : public TArray + { + public: + friend std::ostream& operator<<(std::ostream& Stream, const UC::FAnsiString& Str) { return Stream << Str.ToString(); } + + public: + using TArray::TArray; + + FAnsiString(const char* Str) + { + const uint32 NullTerminatedLength = static_cast(strlen(Str) + 0x1); + + Data = const_cast(Str); + NumElements = NullTerminatedLength; + MaxElements = NullTerminatedLength; + } + + FAnsiString(char* Str, int32 Num, int32 Max) + { + Data = Str; + NumElements = Num; + MaxElements = Max; + } + + public: + inline std::string ToString() const + { + if (*this) + { + return std::string(Data, NumElements - 1); // Exclude null-terminator + } + + return ""; + } + + inline std::wstring ToWString() const + { + if (*this) + return UtfN::StringToWString(ToString()); // Exclude null-terminator + + return L""; + } + + public: + inline char* CStr() { return Data; } + inline const char* CStr() const { return Data; } + + public: + inline bool operator==(const FAnsiString& Other) const { return Other ? NumElements == Other.NumElements && strcmp(Data, Other.Data) == 0 : false; } + inline bool operator!=(const FAnsiString& Other) const { return Other ? NumElements != Other.NumElements || strcmp(Data, Other.Data) != 0 : true; } + }; + + + /* + * Class to allow construction of a TArray, that uses c-style standard-library memory allocation. + * + * Useful for calling functions that expect a buffer of a certain size and do not reallocate that buffer. + * This avoids leaking memory, if the array would otherwise be allocated by the engine, and couldn't be freed without FMemory-functions. + */ + template + class TAllocatedArray : public TArray + { + public: + TAllocatedArray() = delete; + + public: + TAllocatedArray(int32 Size) + { + this->Data = static_cast(malloc(Size * sizeof(ArrayElementType))); + this->NumElements = 0x0; + this->MaxElements = Size; + } + + ~TAllocatedArray() + { + if (this->Data) + free(this->Data); + + this->NumElements = 0x0; + this->MaxElements = 0x0; + } + + public: + inline operator TArray() { return *reinterpret_cast< TArray*>(this); } + inline operator const TArray() const { return *reinterpret_cast*>(this); } + }; + + /* + * Class to allow construction of an FString, that uses c-style standard-library memory allocation. + * + * Useful for calling functions that expect a buffer of a certain size and do not reallocate that buffer. + * This avoids leaking memory, if the array would otherwise be allocated by the engine, and couldn't be freed without FMemory-functions. + */ + class FAllocatedString : public FString + { + public: + FAllocatedString() = delete; + + public: + FAllocatedString(int32 Size) + { + Data = static_cast(malloc(Size * sizeof(wchar_t))); + NumElements = 0x0; + MaxElements = Size; + } + + ~FAllocatedString() + { + if (Data) + free(Data); + + NumElements = 0x0; + MaxElements = 0x0; + } + + public: + inline operator FString() { return *reinterpret_cast< FString*>(this); } + inline operator const FString() const { return *reinterpret_cast(this); } + }; + template + class TSparseArray + { + private: + static constexpr uint32 ElementAlign = alignof(SparseArrayElementType); + static constexpr uint32 ElementSize = sizeof(SparseArrayElementType); + + private: + using FElementOrFreeListLink = ContainerImpl::TSparseArrayElementOrFreeListLink>; + + private: + TArray Data; + ContainerImpl::FBitArray AllocationFlags; + int32 FirstFreeIndex; + int32 NumFreeIndices; + + public: + TSparseArray() + : FirstFreeIndex(-1), NumFreeIndices(0) + { + } + + TSparseArray(TSparseArray&&) = default; + TSparseArray(const TSparseArray&) = default; + + public: + TSparseArray& operator=(TSparseArray&&) = default; + TSparseArray& operator=(const TSparseArray&) = default; + + private: + inline void VerifyIndex(int32 Index) const { if (!IsValidIndex(Index)) throw std::out_of_range("Index was out of range!"); } + + public: + inline int32 NumAllocated() const { return Data.Num(); } + + inline int32 Num() const { return NumAllocated() - NumFreeIndices; } + inline int32 Max() const { return Data.Max(); } + + inline bool IsValidIndex(int32 Index) const { return Data.IsValidIndex(Index) && AllocationFlags[Index]; } + + inline bool IsValid() const { return Data.IsValid() && AllocationFlags.IsValid(); } + + public: + const ContainerImpl::FBitArray& GetAllocationFlags() const { return AllocationFlags; } + + public: + inline SparseArrayElementType& operator[](int32 Index) { VerifyIndex(Index); return *reinterpret_cast(&Data.GetUnsafe(Index).ElementData); } + inline const SparseArrayElementType& operator[](int32 Index) const { VerifyIndex(Index); return *reinterpret_cast(&Data.GetUnsafe(Index).ElementData); } + + inline bool operator==(const TSparseArray& Other) const { return Data == Other.Data; } + inline bool operator!=(const TSparseArray& Other) const { return Data != Other.Data; } + + public: + template friend Iterators::TSparseArrayIterator begin(const TSparseArray& Array); + template friend Iterators::TSparseArrayIterator end (const TSparseArray& Array); + }; + + template + class TSet + { + private: + static constexpr uint32 ElementAlign = alignof(SetElementType); + static constexpr uint32 ElementSize = sizeof(SetElementType); + + private: + using SetDataType = ContainerImpl::SetElement; + using HashType = ContainerImpl::TInlineAllocator<1>::ForElementType; + + private: + TSparseArray Elements; + HashType Hash; + int32 HashSize; + + public: + TSet() + : HashSize(0) + { + } + + TSet(TSet&&) = default; + TSet(const TSet&) = default; + + public: + TSet& operator=(TSet&&) = default; + TSet& operator=(const TSet&) = default; + + private: + inline void VerifyIndex(int32 Index) const { if (!IsValidIndex(Index)) throw std::out_of_range("Index was out of range!"); } + + public: + inline int32 NumAllocated() const { return Elements.NumAllocated(); } + + inline int32 Num() const { return Elements.Num(); } + inline int32 Max() const { return Elements.Max(); } + + inline bool IsValidIndex(int32 Index) const { return Elements.IsValidIndex(Index); } + + inline bool IsValid() const { return Elements.IsValid(); } + + public: + const ContainerImpl::FBitArray& GetAllocationFlags() const { return Elements.GetAllocationFlags(); } + + public: + inline SetElementType& operator[] (int32 Index) { return Elements[Index].Value; } + inline const SetElementType& operator[] (int32 Index) const { return Elements[Index].Value; } + + inline bool operator==(const TSet& Other) const { return Elements == Other.Elements; } + inline bool operator!=(const TSet& Other) const { return Elements != Other.Elements; } + + public: + template friend Iterators::TSetIterator begin(const TSet& Set); + template friend Iterators::TSetIterator end (const TSet& Set); + }; + + template + class TMap + { + public: + using ElementType = TPair; + + private: + TSet Elements; + + private: + inline void VerifyIndex(int32 Index) const { if (!IsValidIndex(Index)) throw std::out_of_range("Index was out of range!"); } + + public: + inline int32 NumAllocated() const { return Elements.NumAllocated(); } + + inline int32 Num() const { return Elements.Num(); } + inline int32 Max() const { return Elements.Max(); } + + inline bool IsValidIndex(int32 Index) const { return Elements.IsValidIndex(Index); } + + inline bool IsValid() const { return Elements.IsValid(); } + + public: + const ContainerImpl::FBitArray& GetAllocationFlags() const { return Elements.GetAllocationFlags(); } + + public: + inline decltype(auto) Find(const KeyElementType& Key, bool(*Equals)(const KeyElementType& LeftKey, const KeyElementType& RightKey)) + { + for (auto It = begin(*this); It != end(*this); ++It) + { + if (Equals(It->Key(), Key)) + return It; + } + + return end(*this); + } + + public: + inline ElementType& operator[] (int32 Index) { return Elements[Index]; } + inline const ElementType& operator[] (int32 Index) const { return Elements[Index]; } + + inline bool operator==(const TMap& Other) const { return Elements == Other.Elements; } + inline bool operator!=(const TMap& Other) const { return Elements != Other.Elements; } + + public: + template friend Iterators::TMapIterator begin(const TMap& Map); + template friend Iterators::TMapIterator end (const TMap& Map); + }; + + namespace Iterators + { + class FRelativeBitReference + { + protected: + static constexpr int32 NumBitsPerDWORD = 32; + static constexpr int32 NumBitsPerDWORDLogTwo = 5; + + public: + inline explicit FRelativeBitReference(int32 BitIndex) + : WordIndex(BitIndex >> NumBitsPerDWORDLogTwo) + , Mask(1 << (BitIndex & (NumBitsPerDWORD - 1))) + { + } + + int32 WordIndex; + uint32 Mask; + }; + + class FSetBitIterator : public FRelativeBitReference + { + private: + const ContainerImpl::FBitArray& Array; + + uint32 UnvisitedBitMask; + int32 CurrentBitIndex; + int32 BaseBitIndex; + + public: + explicit FSetBitIterator(const ContainerImpl::FBitArray& InArray, int32 StartIndex = 0) + : FRelativeBitReference(StartIndex) + , Array(InArray) + , UnvisitedBitMask((~0U) << (StartIndex & (NumBitsPerDWORD - 1))) + , CurrentBitIndex(StartIndex) + , BaseBitIndex(StartIndex & ~(NumBitsPerDWORD - 1)) + { + if (StartIndex != Array.Num()) + FindFirstSetBit(); + } + + public: + inline FSetBitIterator& operator++() + { + UnvisitedBitMask &= ~this->Mask; + + FindFirstSetBit(); + + return *this; + } + + inline explicit operator bool() const { return CurrentBitIndex < Array.Num(); } + + inline bool operator==(const FSetBitIterator& Rhs) const { return CurrentBitIndex == Rhs.CurrentBitIndex && &Array == &Rhs.Array; } + inline bool operator!=(const FSetBitIterator& Rhs) const { return CurrentBitIndex != Rhs.CurrentBitIndex || &Array != &Rhs.Array; } + + public: + inline int32 GetIndex() { return CurrentBitIndex; } + + void FindFirstSetBit() + { + const uint32* ArrayData = Array.GetData(); + const int32 ArrayNum = Array.Num(); + const int32 LastWordIndex = (ArrayNum - 1) / NumBitsPerDWORD; + + uint32 RemainingBitMask = ArrayData[this->WordIndex] & UnvisitedBitMask; + while (!RemainingBitMask) + { + ++this->WordIndex; + BaseBitIndex += NumBitsPerDWORD; + if (this->WordIndex > LastWordIndex) + { + CurrentBitIndex = ArrayNum; + return; + } + + RemainingBitMask = ArrayData[this->WordIndex]; + UnvisitedBitMask = ~0; + } + + const uint32 NewRemainingBitMask = RemainingBitMask & (RemainingBitMask - 1); + + this->Mask = NewRemainingBitMask ^ RemainingBitMask; + + CurrentBitIndex = BaseBitIndex + NumBitsPerDWORD - 1 - ContainerImpl::HelperFunctions::CountLeadingZeros(this->Mask); + + if (CurrentBitIndex > ArrayNum) + CurrentBitIndex = ArrayNum; + } + }; + + template + class TArrayIterator + { + private: + TArray& IteratedArray; + int32 Index; + + public: + TArrayIterator(const TArray& Array, int32 StartIndex = 0x0) + : IteratedArray(const_cast&>(Array)), Index(StartIndex) + { + } + + public: + inline int32 GetIndex() { return Index; } + + inline int32 IsValid() { return IteratedArray.IsValidIndex(GetIndex()); } + + public: + inline TArrayIterator& operator++() { ++Index; return *this; } + inline TArrayIterator& operator--() { --Index; return *this; } + + inline ArrayType& operator*() { return IteratedArray[GetIndex()]; } + inline const ArrayType& operator*() const { return IteratedArray[GetIndex()]; } + + inline ArrayType* operator->() { return &IteratedArray[GetIndex()]; } + inline const ArrayType* operator->() const { return &IteratedArray[GetIndex()]; } + + inline bool operator==(const TArrayIterator& Other) const { return &IteratedArray == &Other.IteratedArray && Index == Other.Index; } + inline bool operator!=(const TArrayIterator& Other) const { return &IteratedArray != &Other.IteratedArray || Index != Other.Index; } + }; + + template + class TContainerIterator + { + private: + ContainerType& IteratedContainer; + FSetBitIterator BitIterator; + + public: + TContainerIterator(const ContainerType& Container, const ContainerImpl::FBitArray& BitArray, int32 StartIndex = 0x0) + : IteratedContainer(const_cast(Container)), BitIterator(BitArray, StartIndex) + { + } + + public: + inline int32 GetIndex() { return BitIterator.GetIndex(); } + + inline int32 IsValid() { return IteratedContainer.IsValidIndex(GetIndex()); } + + public: + inline TContainerIterator& operator++() { ++BitIterator; return *this; } + inline TContainerIterator& operator--() { --BitIterator; return *this; } + + inline auto& operator*() { return IteratedContainer[GetIndex()]; } + inline const auto& operator*() const { return IteratedContainer[GetIndex()]; } + + inline auto* operator->() { return &IteratedContainer[GetIndex()]; } + inline const auto* operator->() const { return &IteratedContainer[GetIndex()]; } + + inline bool operator==(const TContainerIterator& Other) const { return &IteratedContainer == &Other.IteratedContainer && BitIterator == Other.BitIterator; } + inline bool operator!=(const TContainerIterator& Other) const { return &IteratedContainer != &Other.IteratedContainer || BitIterator != Other.BitIterator; } + }; + } + + inline Iterators::FSetBitIterator begin(const ContainerImpl::FBitArray& Array) { return Iterators::FSetBitIterator(Array, 0); } + inline Iterators::FSetBitIterator end (const ContainerImpl::FBitArray& Array) { return Iterators::FSetBitIterator(Array, Array.Num()); } + + template inline Iterators::TArrayIterator begin(const TArray& Array) { return Iterators::TArrayIterator(Array, 0); } + template inline Iterators::TArrayIterator end (const TArray& Array) { return Iterators::TArrayIterator(Array, Array.Num()); } + + template inline Iterators::TSparseArrayIterator begin(const TSparseArray& Array) { return Iterators::TSparseArrayIterator(Array, Array.GetAllocationFlags(), 0); } + template inline Iterators::TSparseArrayIterator end (const TSparseArray& Array) { return Iterators::TSparseArrayIterator(Array, Array.GetAllocationFlags(), Array.NumAllocated()); } + + template inline Iterators::TSetIterator begin(const TSet& Set) { return Iterators::TSetIterator(Set, Set.GetAllocationFlags(), 0); } + template inline Iterators::TSetIterator end (const TSet& Set) { return Iterators::TSetIterator(Set, Set.GetAllocationFlags(), Set.NumAllocated()); } + + template inline Iterators::TMapIterator begin(const TMap& Map) { return Iterators::TMapIterator(Map, Map.GetAllocationFlags(), 0); } + template inline Iterators::TMapIterator end (const TMap& Map) { return Iterators::TMapIterator(Map, Map.GetAllocationFlags(), Map.NumAllocated()); } + +#if defined(_WIN64) + static_assert(sizeof(TArray) == 0x10, "TArray has a wrong size!"); + static_assert(sizeof(TSet) == 0x50, "TSet has a wrong size!"); + static_assert(sizeof(TMap) == 0x50, "TMap has a wrong size!"); +#elif defined(_WIN32) + static_assert(sizeof(TArray) == 0x0C, "TArray has a wrong size!"); + static_assert(sizeof(TSet) == 0x3C, "TSet has a wrong size!"); + static_assert(sizeof(TMap) == 0x3C, "TMap has a wrong size!"); +#endif +} diff --git a/Samson/UtfN.hpp b/Samson/UtfN.hpp new file mode 100644 index 0000000..0feb7d7 --- /dev/null +++ b/Samson/UtfN.hpp @@ -0,0 +1,1613 @@ +#pragma once + +/* +* SDK generated by Dumper-7 +* +* https://github.com/Encryqed/Dumper-7 +*/ + +// A simple C++ lib for converting between Utf8, Utf16 and Utf32. See https://github.com/Fischsalat/UTF-N + + +// Lower warning-level and turn off certain warnings for STL compilation +#if (defined(_MSC_VER)) +#pragma warning (push, 2) // Push warnings and set warn-level to 2 +#pragma warning(disable : 4365) // signed/unsigned mismatch +#pragma warning(disable : 4710) // 'FunctionName' was not inlined +#pragma warning(disable : 4711) // 'FunctionName' selected for automatic inline expansion +#elif (defined(__CLANG__) || defined(__GNUC__)) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wsign-compare" +#endif + +#include +#include +#include +#include + +#ifdef _DEBUG +#include +#endif // _DEBUG + + +// Restore warnings-levels after STL includes +#if (defined(_MSC_VER)) +#pragma warning (pop) +#elif (defined(__CLANG__) || defined(__GNUC__)) +#pragma GCC diagnostic pop +#endif // Warnings + + + +#if (defined(_MSC_VER)) +#pragma warning (push) +#pragma warning (disable: 4514) // C4514 "unreferenced inline function has been removed" +#pragma warning (disable: 4820) // C4820 "'n' bytes padding added after data member '...'" +#pragma warning(disable : 4127) // C4127 conditional expression is constant +#pragma warning(disable : 5045) // C5045 Compiler will insert Spectre mitigation for memory load if /Qspectre switch specified +#pragma warning(disable : 5246) // C5246 'ArrayVariable' the initialization of a subobject should be wrapped in braces +#elif (defined(__CLANG__) || defined(__GNUC__)) +#endif // Warnings + +#ifdef __cpp_constexpr +#define UTF_CONSTEXPR constexpr +#else +#define UTF_CONSTEXPR +#endif // __cpp_constexpr + + +#ifdef __cpp_if_constexpr +#define UTF_IF_CONSTEXPR constexpr +#else +#define UTF_IF_CONSTEXPR +#endif // __cpp_if_constexpr + + +#if (defined(__cpp_constexpr) && __cpp_constexpr >= 201304L) +#define UTF_CONSTEXPR14 constexpr +#else +#define UTF_CONSTEXPR14 +#endif + +#if (defined(__cpp_constexpr) && __cpp_constexpr >= 201603L) +#define UTF_CONSTEXPR17 constexpr +#else +#define UTF_CONSTEXPR17 inline +#endif + +#if (defined(__cpp_constexpr) && __cpp_constexpr >= 201907L) +#define UTF_CONSTEXPR20 constexpr +#else +#define UTF_CONSTEXPR20 inline +#endif + +#if (defined(__cpp_constexpr) && __cpp_constexpr >= 202211L) +#define UTF_CONSTEXPR23 constexpr +#else +#define UTF_CONSTEXPR23 inline +#endif + +#if (defined(__cpp_constexpr) && __cpp_constexpr >= 202406L) +#define UTF_CONSTEXPR26 constexpr +#else +#define UTF_CONSTEXPR26 inline +#endif + + +#ifdef __cpp_nodiscard +#define UTF_NODISCARD [[nodiscard]] +#else +#define UTF_NODISCARD +#endif + + +namespace UtfN +{ +#if defined(__cpp_char8_t) + typedef char8_t utf_cp8_t; + typedef char16_t utf_cp16_t; + typedef char32_t utf_cp32_t; +#elif defined(__cpp_unicode_characters) + typedef unsigned char utf_cp8_t; + typedef char16_t utf_cp16_t; + typedef char32_t utf_cp32_t; +#else + typedef unsigned char utf_cp8_t; + typedef uint16_t utf_cp16_t; + typedef uint32_t utf_cp32_t; +#endif + + namespace UtfImpl + { + namespace Utils + { + template + UTF_CONSTEXPR UTF_NODISCARD + bool IsFlagSet(value_type Value, flag_type Flag) noexcept + { + return (Value & Flag) == Flag; + } + + template + UTF_CONSTEXPR UTF_NODISCARD + value_type GetWithClearedFlag(value_type Value, flag_type Flag) noexcept + { + return static_cast(Value & static_cast(~Flag)); + } + + // Does not add/remove cv-qualifiers + template + UTF_CONSTEXPR UTF_NODISCARD + auto ForceCastIfMissmatch(current_type&& Arg) -> std::enable_if_t, std::decay_t>::value, current_type> + { + return static_cast(Arg); + } + + // Does not add/remove cv-qualifiers + template + UTF_CONSTEXPR UTF_NODISCARD + auto ForceCastIfMissmatch(current_type&& Arg) -> std::enable_if_t, std::decay_t>::value, target_type> + { + return reinterpret_cast(Arg); + } + } + + // wchar_t is a utf16 codepoint on windows, utf32 on linux + UTF_CONSTEXPR bool IsWCharUtf32 = sizeof(wchar_t) == 0x4; + + // Any value greater than this is not a valid Unicode symbol + UTF_CONSTEXPR utf_cp32_t MaxValidUnicodeChar = 0x10FFFF; + + namespace Utf8 + { + /* + * Available bits, and max values, for n-byte utf8 characters + * + * 01111111 -> 1 byte -> 7 bits + * 11011111 -> 2 bytes -> 5 + 6 bits -> 11 bits + * 11101111 -> 3 bytes -> 4 + 6 + 6 bits -> 16 bits + * 11110111 -> 4 bytes -> 3 + 6 + 6 + 6 bits -> 21 bits + * + * 10111111 -> follow up byte + */ + UTF_CONSTEXPR utf_cp32_t Max1ByteValue = (1 << 7) - 1; // 7 bits available + UTF_CONSTEXPR utf_cp32_t Max2ByteValue = (1 << 11) - 1; // 11 bits available + UTF_CONSTEXPR utf_cp32_t Max3ByteValue = (1 << 16) - 1; // 16 bits available + UTF_CONSTEXPR utf_cp32_t Max4ByteValue = 0x10FFFF; // 21 bits available, but not fully used + + // Flags for follow-up bytes of multibyte utf8 character + UTF_CONSTEXPR utf_cp8_t FollowupByteMask = 0b1000'0000; + UTF_CONSTEXPR utf_cp8_t FollowupByteDataMask = 0b0011'1111; + UTF_CONSTEXPR utf_cp8_t NumDataBitsInFollowupByte = 0x6; + + // Flags for start-bytes of multibyte utf8 characters + UTF_CONSTEXPR utf_cp8_t TwoByteFlag = 0b1100'0000; + UTF_CONSTEXPR utf_cp8_t ThreeByteFlag = 0b1110'0000; + UTF_CONSTEXPR utf_cp8_t FourByteFlag = 0b1111'0000; + + UTF_CONSTEXPR UTF_NODISCARD + bool IsValidFollowupCodepoint(const utf_cp8_t Codepoint) noexcept + { + // Test the upper 2 bytes for the FollowupByteMask + return (Codepoint & 0b1100'0000) == FollowupByteMask; + } + + template + UTF_CONSTEXPR UTF_NODISCARD + bool IsValidUtf8Sequence(const utf_cp8_t FirstCp, const utf_cp8_t SecondCp, const utf_cp8_t ThirdCp, const utf_cp8_t FourthCp) noexcept + { + switch (ByteSize) + { + case 1: + { + return SecondCp == 0 && ThirdCp == 0 && FourthCp == 0; + } + case 4: + { + const bool bIsOverlongEncoding = Utils::GetWithClearedFlag(FirstCp, ~Utf8::TwoByteFlag) != 0 && SecondCp == Utf8::FollowupByteMask; + return !bIsOverlongEncoding && IsValidFollowupCodepoint(SecondCp) && IsValidFollowupCodepoint(ThirdCp) && IsValidFollowupCodepoint(FourthCp); + } + case 3: + { + const bool bIsOverlongEncoding = Utils::GetWithClearedFlag(FirstCp, ~Utf8::ThreeByteFlag) != 0 && SecondCp == Utf8::FollowupByteMask; + return !bIsOverlongEncoding && IsValidFollowupCodepoint(SecondCp) && IsValidFollowupCodepoint(ThirdCp) && FourthCp == 0; + } + case 2: + { + const bool bIsOverlongEncoding = Utils::GetWithClearedFlag(FirstCp, ~Utf8::FourByteFlag) != 0 && SecondCp == Utf8::FollowupByteMask; + return !bIsOverlongEncoding && IsValidFollowupCodepoint(SecondCp) && ThirdCp == 0 && FourthCp == 0; + } + default: + { + return false; + break; + } + } + } + } + + namespace Utf16 + { + // Surrogate masks and offset for multibyte utf16 characters + UTF_CONSTEXPR utf_cp16_t HighSurrogateRangeStart = 0xD800; + UTF_CONSTEXPR utf_cp16_t LowerSurrogateRangeStart = 0xDC00; + + UTF_CONSTEXPR utf_cp32_t SurrogatePairOffset = 0x10000; + + // Unicode range for 2byte utf16 values + UTF_CONSTEXPR utf_cp32_t SurrogateRangeLowerBounds = 0xD800; + UTF_CONSTEXPR utf_cp32_t SurrogateRangeUpperBounds = 0xDFFF; + + + UTF_CONSTEXPR UTF_NODISCARD + bool IsHighSurrogate(const utf_cp16_t Codepoint) noexcept + { + // Range [0xD800 - 0xDC00[ + return Codepoint >= HighSurrogateRangeStart && Codepoint < LowerSurrogateRangeStart; + } + UTF_CONSTEXPR UTF_NODISCARD + bool IsLowSurrogate(const utf_cp16_t Codepoint) noexcept + { + // Range [0xDC00 - 0xDFFF] + return Codepoint >= LowerSurrogateRangeStart && Codepoint <= SurrogateRangeUpperBounds; + } + + // Tests if a utf16 value is a valid Unicode character + UTF_CONSTEXPR UTF_NODISCARD + bool IsValidUnicodeChar(const utf_cp16_t LowerCodepoint, const utf_cp16_t UpperCodepoint) noexcept + { + const bool IsValidHighSurrogate = IsHighSurrogate(UpperCodepoint); + const bool IsValidLowSurrogate = IsLowSurrogate(LowerCodepoint); + + // Both needt to be valid + if (IsValidHighSurrogate) + return IsValidLowSurrogate; + + // Neither are valid && the codepoints are not in the wrong surrogate ranges + return !IsValidLowSurrogate && !IsHighSurrogate(LowerCodepoint) && !IsLowSurrogate(UpperCodepoint); + } + } + + namespace Utf32 + { + // Tests if a utf32 value is a valid Unicode character + UTF_CONSTEXPR UTF_NODISCARD + bool IsValidUnicodeChar(const utf_cp32_t Codepoint) noexcept + { + // Codepoints must be within the valid unicode range and must not be within the range of Surrogate-values + return Codepoint < MaxValidUnicodeChar && (Codepoint < Utf16::SurrogateRangeLowerBounds || Codepoint > Utf16::SurrogateRangeUpperBounds); + } + } + + namespace Iterator + { + template + class utf_char_iterator_base_child_acessor + { + private: + template + friend class utf_char_iterator_base; + + private: + static UTF_CONSTEXPR + void ReadChar(child_type* This) + { + return This->ReadChar(); + } + }; + + template + class utf_char_iterator_base + { + public: + UTF_CONSTEXPR utf_char_iterator_base(codepoint_iterator_type Begin, codepoint_iterator_type End) + : CurrentIterator(Begin), NextCharStartIterator(Begin), EndIterator(End) + { + utf_char_iterator_base_child_acessor::ReadChar(static_cast(this)); + } + + template())), // Has begin + typename = decltype(std::end(std::declval())), // Has end + typename iterator_deref_type = decltype(*std::end(std::declval())), // Iterator can be dereferenced + typename = std::enable_if::type) == utf_char_type::GetCodepointSize()>::type // Return-value of derferenced iterator has the same size as one codepoint + > + explicit UTF_CONSTEXPR utf_char_iterator_base(container_type& Container) + : CurrentIterator(std::begin(Container)), NextCharStartIterator(std::begin(Container)), EndIterator(std::end(Container)) + { + utf_char_iterator_base_child_acessor::ReadChar(static_cast(this)); + } + + public: + UTF_CONSTEXPR inline + child_iterator_type& operator++() + { + // Skip ahead to the next char + CurrentIterator = NextCharStartIterator; + + // Populate the current char and advance the NextCharStartIterator + utf_char_iterator_base_child_acessor::ReadChar(static_cast(this)); + + + return *static_cast(this); + } + + public: + UTF_CONSTEXPR inline + utf_char_type operator*() const + { + return CurrentChar; + } + + UTF_CONSTEXPR inline bool operator==(const child_iterator_type& Other) const + { + return CurrentIterator == Other.CurrentIterator; + } + UTF_CONSTEXPR inline + bool operator!=(const child_iterator_type& Other) const + { + return CurrentIterator != Other.CurrentIterator; + } + + UTF_CONSTEXPR inline + explicit operator bool() const + { + return this->CurrentIterator != this->EndIterator; + } + + public: + UTF_CONSTEXPR inline + child_iterator_type begin() + { + return *static_cast(this); + } + + UTF_CONSTEXPR inline + child_iterator_type end() + { + return child_iterator_type(EndIterator, EndIterator); + } + + protected: + codepoint_iterator_type CurrentIterator; // Current byte pos + codepoint_iterator_type NextCharStartIterator; // Byte pos of the next character + codepoint_iterator_type EndIterator; // End Iterator + + utf_char_type CurrentChar; // Current character bytes + }; + } + } + + struct utf8_bytes + { + utf_cp8_t Codepoints[4] = { 0 }; + }; + + struct utf16_pair + { + utf_cp16_t Lower = 0; + utf_cp16_t Upper = 0; + }; + + UTF_CONSTEXPR inline + bool operator==(const utf8_bytes Left, const utf8_bytes Right) noexcept + { + return Left.Codepoints[0] == Right.Codepoints[0] + && Left.Codepoints[1] == Right.Codepoints[1] + && Left.Codepoints[2] == Right.Codepoints[2] + && Left.Codepoints[3] == Right.Codepoints[3]; + } + UTF_CONSTEXPR inline + bool operator!=(const utf8_bytes Left, const utf8_bytes Right) noexcept + { + return !(Left == Right); + } + + UTF_CONSTEXPR inline + bool operator==(const utf16_pair Left, const utf16_pair Right) noexcept + { + return Left.Upper == Right.Upper && Left.Lower == Right.Lower; + } + UTF_CONSTEXPR inline + bool operator!=(const utf16_pair Left, const utf16_pair Right) noexcept + { + return !(Left == Right); + } + + + enum class UtfEncodingType + { + Invalid, + Utf8, + Utf16, + Utf32 + }; + + template + struct utf_char; + + typedef utf_char utf_char8; + typedef utf_char utf_char16; + typedef utf_char utf_char32; + + template<> + struct utf_char + { + utf8_bytes Char = { 0 }; + + public: + UTF_CONSTEXPR utf_char() = default; + UTF_CONSTEXPR utf_char(utf_char&&) = default; + UTF_CONSTEXPR utf_char(const utf_char&) = default; + + UTF_CONSTEXPR utf_char(utf8_bytes InChar) noexcept; + + template()))> + UTF_CONSTEXPR utf_char(const char_type* SingleCharString) noexcept; + + public: + UTF_CONSTEXPR utf_char& operator=(utf_char&&) = default; + UTF_CONSTEXPR utf_char& operator=(const utf_char&) = default; + + UTF_CONSTEXPR utf_char& operator=(utf8_bytes inBytse) noexcept; + + public: + UTF_CONSTEXPR UTF_NODISCARD utf_cp8_t& operator[](const uint8_t Index); + UTF_CONSTEXPR UTF_NODISCARD const utf_cp8_t& operator[](const uint8_t Index) const; + + UTF_CONSTEXPR UTF_NODISCARD bool operator==(utf_char8 Other) const noexcept; + UTF_CONSTEXPR UTF_NODISCARD bool operator!=(utf_char8 Other) const noexcept; + + public: + UTF_CONSTEXPR UTF_NODISCARD utf_char8 GetAsUtf8() const noexcept; + UTF_CONSTEXPR UTF_NODISCARD utf_char16 GetAsUtf16() const noexcept; + UTF_CONSTEXPR UTF_NODISCARD utf_char32 GetAsUtf32() const noexcept; + + UTF_CONSTEXPR UTF_NODISCARD utf8_bytes Get() const; + + UTF_CONSTEXPR UTF_NODISCARD UtfEncodingType GetEncoding() const noexcept; + UTF_CONSTEXPR UTF_NODISCARD uint8_t GetNumCodepoints() const noexcept; + + UTF_CONSTEXPR UTF_NODISCARD static uint8_t GetCodepointSize() noexcept; + }; + + template<> + struct utf_char + { + utf16_pair Char = { 0 }; + + public: + UTF_CONSTEXPR utf_char() = default; + UTF_CONSTEXPR utf_char(utf_char&&) = default; + UTF_CONSTEXPR utf_char(const utf_char&) = default; + + UTF_CONSTEXPR utf_char(utf16_pair InChar) noexcept; + + template()))> + UTF_CONSTEXPR utf_char(const char_type* SingleCharString) noexcept; + + public: + UTF_CONSTEXPR utf_char& operator=(utf_char&&) = default; + UTF_CONSTEXPR utf_char& operator=(const utf_char&) = default; + + UTF_CONSTEXPR utf_char& operator=(utf16_pair inBytse) noexcept; + + public: + UTF_CONSTEXPR UTF_NODISCARD bool operator==(utf_char16 Other) const noexcept; + UTF_CONSTEXPR UTF_NODISCARD bool operator!=(utf_char16 Other) const noexcept; + + public: + UTF_CONSTEXPR UTF_NODISCARD utf_char8 GetAsUtf8() const noexcept; + UTF_CONSTEXPR UTF_NODISCARD utf_char16 GetAsUtf16() const noexcept; + UTF_CONSTEXPR UTF_NODISCARD utf_char32 GetAsUtf32() const noexcept; + + UTF_CONSTEXPR UTF_NODISCARD utf16_pair Get() const noexcept; + + UTF_CONSTEXPR UTF_NODISCARD UtfEncodingType GetEncoding() const noexcept; + UTF_CONSTEXPR UTF_NODISCARD uint8_t GetNumCodepoints() const noexcept; + + UTF_CONSTEXPR UTF_NODISCARD static uint8_t GetCodepointSize() noexcept; + }; + + template<> + struct utf_char + { + utf_cp32_t Char = { 0 }; + + public: + UTF_CONSTEXPR utf_char() = default; + UTF_CONSTEXPR utf_char(utf_char&&) = default; + UTF_CONSTEXPR utf_char(const utf_char&) = default; + + UTF_CONSTEXPR utf_char(utf_cp32_t InChar) noexcept; + + template()))> + UTF_CONSTEXPR utf_char(const char_type* SingleCharString) noexcept; + + public: + UTF_CONSTEXPR utf_char& operator=(utf_char&&) = default; + UTF_CONSTEXPR utf_char& operator=(const utf_char&) = default; + + UTF_CONSTEXPR utf_char& operator=(utf_cp32_t inBytse) noexcept; + + public: + UTF_CONSTEXPR UTF_NODISCARD bool operator==(utf_char32 Other) const noexcept; + UTF_CONSTEXPR UTF_NODISCARD bool operator!=(utf_char32 Other) const noexcept; + + public: + UTF_CONSTEXPR UTF_NODISCARD utf_char8 GetAsUtf8() const noexcept; + UTF_CONSTEXPR UTF_NODISCARD utf_char16 GetAsUtf16() const noexcept; + UTF_CONSTEXPR UTF_NODISCARD utf_char32 GetAsUtf32() const noexcept; + + UTF_CONSTEXPR UTF_NODISCARD utf_cp32_t Get() const noexcept; + + UTF_CONSTEXPR UTF_NODISCARD UtfEncodingType GetEncoding() const noexcept; + UTF_CONSTEXPR UTF_NODISCARD uint8_t GetNumCodepoints() const noexcept; + + UTF_CONSTEXPR UTF_NODISCARD static uint8_t GetCodepointSize() noexcept; + }; + + UTF_CONSTEXPR UTF_NODISCARD + uint8_t GetUtf8CharLenght(const utf_cp8_t C) noexcept + { + using namespace UtfImpl; + + /* No flag for any other byte-count is set */ + if ((C & 0b1000'0000) == 0) + { + return 0x1; + } + else if (Utils::IsFlagSet(C, Utf8::FourByteFlag)) + { + return 0x4; + } + else if (Utils::IsFlagSet(C, Utf8::ThreeByteFlag)) + { + return 0x3; + } + else if (Utils::IsFlagSet(C, Utf8::TwoByteFlag)) + { + return 0x2; + } + else + { + /* Invalid! This is a follow up codepoint but conversion needs to start at the start-codepoint. */ + return 0x0; + } + } + + UTF_CONSTEXPR UTF_NODISCARD + uint8_t GetUtf16CharLenght(const utf_cp16_t UpperCodepoint) noexcept + { + if (UtfImpl::Utf16::IsHighSurrogate(UpperCodepoint)) + return 0x2; + + return 0x1; + } + + UTF_CONSTEXPR UTF_NODISCARD + utf_char16 Utf32ToUtf16Pair(const utf_char32 Character) noexcept + { + using namespace UtfImpl; + + if (!Utf32::IsValidUnicodeChar(Character.Char)) + return utf16_pair{}; + + utf16_pair RetCharPair; + + if (Character.Char > USHRT_MAX) + { + const utf_cp32_t PreparedCodepoint = Character.Char - Utf16::SurrogatePairOffset; + + RetCharPair.Upper = (PreparedCodepoint >> 10) & 0b1111111111; + RetCharPair.Lower = PreparedCodepoint & 0b1111111111; + + // Surrogate-pair starting ranges for higher/lower surrogates + RetCharPair.Upper += Utf16::HighSurrogateRangeStart; + RetCharPair.Lower += Utf16::LowerSurrogateRangeStart; + + return RetCharPair; + } + + RetCharPair.Lower = static_cast(Character.Char); + + return RetCharPair; + } + + UTF_CONSTEXPR UTF_NODISCARD + utf_char32 Utf16PairToUtf32(const utf_char16 Character) noexcept + { + using namespace UtfImpl; + + // The surrogate-values are not valid Unicode codepoints + if (!Utf16::IsValidUnicodeChar(Character.Char.Lower, Character.Char.Upper)) + return utf_cp32_t{ 0 }; + + if (Character.Char.Upper) + { + // Move the characters back from the surrogate range to the normal range + const utf_cp16_t UpperCodepointWithoutSurrogate = static_cast(Character.Char.Upper - Utf16::HighSurrogateRangeStart); + const utf_cp16_t LowerCodepointWithoutSurrogate = static_cast(Character.Char.Lower - Utf16::LowerSurrogateRangeStart); + + return ((static_cast(UpperCodepointWithoutSurrogate) << 10) | LowerCodepointWithoutSurrogate) + Utf16::SurrogatePairOffset; + } + + return Character.Char.Lower; + } + + UTF_CONSTEXPR UTF_NODISCARD + utf_char8 Utf32ToUtf8Bytes(const utf_char32 Character) noexcept + { + using namespace UtfImpl; + using namespace UtfImpl::Utf8; + + if (!Utf32::IsValidUnicodeChar(Character.Char)) + return utf_char8{}; + + utf8_bytes RetBytes; + + if (Character.Char <= Max1ByteValue) + { + RetBytes.Codepoints[0] = static_cast(Character.Char); + } + else if (Character.Char <= Max2ByteValue) + { + /* Upper 3 bits of first byte are reserved for byte-lengh. */ + RetBytes.Codepoints[0] = TwoByteFlag; + RetBytes.Codepoints[0] |= Character.Char >> NumDataBitsInFollowupByte; // Lower bits stored in 2nd byte + + RetBytes.Codepoints[1] |= FollowupByteMask; + RetBytes.Codepoints[1] |= Character.Char & FollowupByteDataMask; + } + else if (Character.Char <= Max3ByteValue) + { + /* Upper 4 bits of first byte are reserved for byte-lengh. */ + RetBytes.Codepoints[0] = ThreeByteFlag; + RetBytes.Codepoints[0] |= Character.Char >> (NumDataBitsInFollowupByte * 2); // Lower bits stored in 2nd and 3rd bytes + + RetBytes.Codepoints[1] = FollowupByteMask; + RetBytes.Codepoints[1] |= (Character.Char >> NumDataBitsInFollowupByte) & FollowupByteDataMask; // Lower bits stored in 2nd byte + + RetBytes.Codepoints[2] = FollowupByteMask; + RetBytes.Codepoints[2] |= Character.Char & FollowupByteDataMask; + } + else if (Character.Char <= Max4ByteValue) + { + /* Upper 5 bits of first byte are reserved for byte-lengh. */ + RetBytes.Codepoints[0] = FourByteFlag; + RetBytes.Codepoints[0] |= Character.Char >> (NumDataBitsInFollowupByte * 3); // Lower bits stored in 2nd, 3rd and 4th bytes + + RetBytes.Codepoints[1] = FollowupByteMask; + RetBytes.Codepoints[1] |= (Character.Char >> (NumDataBitsInFollowupByte * 2)) & FollowupByteDataMask; // Lower bits stored in 3rd and 4th bytes + + RetBytes.Codepoints[2] = FollowupByteMask; + RetBytes.Codepoints[2] |= (Character.Char >> NumDataBitsInFollowupByte) & FollowupByteDataMask; // Lower bits stored in 4th byte + + RetBytes.Codepoints[3] = FollowupByteMask; + RetBytes.Codepoints[3] |= Character.Char & FollowupByteDataMask; + } + else + { + /* Above max allowed value. Invalid codepoint. */ + return RetBytes; + } + + return RetBytes; + } + + UTF_CONSTEXPR UTF_NODISCARD + utf_cp32_t Utf8BytesToUtf32(const utf_char8 Character) noexcept + { + using namespace UtfImpl; + using namespace UtfImpl::Utf8; + + /* No flag for any other byte-count is set */ + if ((Character[0] & 0b1000'0000) == 0) + { + if (!Utf8::IsValidUtf8Sequence<1>(Character[0], Character[1], Character[2], Character[3])) // Verifies encoding + return utf_cp32_t{ 0 }; + + return Character[0]; + } + else if (Utils::IsFlagSet(Character[0], FourByteFlag)) + { + utf_cp32_t RetChar = Utils::GetWithClearedFlag(Character[3], FollowupByteMask); + RetChar |= Utils::GetWithClearedFlag(Character[2], FollowupByteMask) << (NumDataBitsInFollowupByte * 1); // Clear the FollowupByteMask and move the bits to the right position + RetChar |= Utils::GetWithClearedFlag(Character[1], FollowupByteMask) << (NumDataBitsInFollowupByte * 2); // Clear the FollowupByteMask and move the bits to the right position + RetChar |= Utils::GetWithClearedFlag(Character[0], FourByteFlag) << (NumDataBitsInFollowupByte * 3); // Clear the FourByteFlag and move the bits to the right position + + if (!Utf8::IsValidUtf8Sequence<4>(Character[0], Character[1], Character[2], Character[3]) // Verifies encoding + || !Utf32::IsValidUnicodeChar(RetChar)) // Verifies ranges + return utf_cp32_t{ 0 }; + + return RetChar; + } + else if (Utils::IsFlagSet(Character[0], ThreeByteFlag)) + { + utf_cp32_t RetChar = Utils::GetWithClearedFlag(Character[2], FollowupByteMask); + RetChar |= Utils::GetWithClearedFlag(Character[1], FollowupByteMask) << (NumDataBitsInFollowupByte * 1); // Clear the FollowupByteMask and move the bits to the right position + RetChar |= Utils::GetWithClearedFlag(Character[0], ThreeByteFlag) << (NumDataBitsInFollowupByte * 2); // Clear the ThreeByteFlag and move the bits to the right position + + if (!Utf8::IsValidUtf8Sequence<3>(Character[0], Character[1], Character[2], Character[3]) // Verifies encoding + || !Utf32::IsValidUnicodeChar(RetChar)) // Verifies ranges + return utf_cp32_t{ 0 }; + + return RetChar; + } + else if (Utils::IsFlagSet(Character[0], TwoByteFlag)) + { + utf_cp32_t RetChar = Utils::GetWithClearedFlag(Character[1], FollowupByteMask); // Clear the FollowupByteMask and move the bits to the right position + RetChar |= Utils::GetWithClearedFlag(Character[0], TwoByteFlag) << NumDataBitsInFollowupByte; // Clear the TwoByteFlag and move the bits to the right position + + if (!Utf8::IsValidUtf8Sequence<2>(Character[0], Character[1], Character[2], Character[3]) // Verifies encoding + || !Utf32::IsValidUnicodeChar(RetChar)) // Verifies ranges + return utf_cp32_t{ 0 }; + + return RetChar; + } + else + { + /* Invalid! This is a follow up codepoint but conversion needs to start at the start-codepoint. */ + return 0; + } + } + + UTF_CONSTEXPR UTF_NODISCARD + utf_char8 Utf16PairToUtf8Bytes(const utf_char16 Character) noexcept + { + return Utf32ToUtf8Bytes(Utf16PairToUtf32(Character)); + } + + UTF_CONSTEXPR UTF_NODISCARD + utf_char16 Utf8BytesToUtf16(const utf_char8 Character) noexcept + { + return Utf32ToUtf16Pair(Utf8BytesToUtf32(Character)); + } + + template< + typename codepoint_iterator_type, + typename iterator_deref_type = decltype(*std::declval()), // Iterator can be dereferenced + typename = typename std::enable_if::type) == utf_char8::GetCodepointSize()>::type // Return-value of derferenced iterator has the same size as one codepoint + > + class utf8_iterator : public UtfImpl::Iterator::utf_char_iterator_base, codepoint_iterator_type, utf_char8> + { + private: + typedef typename utf8_iterator own_type; + + friend UtfImpl::Iterator::utf_char_iterator_base_child_acessor; + + public: + using UtfImpl::Iterator::utf_char_iterator_base::utf_char_iterator_base; + + public: + utf8_iterator() = delete; + + private: + void ReadChar() + { + if (this->NextCharStartIterator == this->EndIterator) + return; + + // Reset the bytes of the character + this->CurrentChar = utf8_bytes{ 0 }; + + const int CharCodepointCount = GetUtf8CharLenght(static_cast(*this->NextCharStartIterator)); + + for (int i = 0; i < CharCodepointCount; i++) + { + // The least character ended abruptly + if (this->NextCharStartIterator == this->EndIterator) + { + this->CurrentIterator = this->EndIterator; + this->CurrentChar = utf8_bytes{ 0 }; + break; + } + + this->CurrentChar[static_cast(i)] = static_cast(*this->NextCharStartIterator); + this->NextCharStartIterator++; + } + } + }; + + template< + typename codepoint_iterator_type, + typename iterator_deref_type = decltype(*std::declval()), // Iterator can be dereferenced + typename = typename std::enable_if::type) == utf_char16::GetCodepointSize()>::type // Return-value of derferenced iterator has the same size as one codepoint + > + class utf16_iterator : public UtfImpl::Iterator::utf_char_iterator_base, codepoint_iterator_type, utf_char16> + { + private: + typedef typename utf16_iterator own_type; + + friend UtfImpl::Iterator::utf_char_iterator_base_child_acessor; + + public: + using UtfImpl::Iterator::utf_char_iterator_base::utf_char_iterator_base; + + public: + utf16_iterator() = delete; + + private: + UTF_CONSTEXPR void ReadChar() + { + if (this->NextCharStartIterator == this->EndIterator) + return; + + // Reset the bytes of the character + this->CurrentChar = utf16_pair{ 0 }; + + const int CharCodepointCount = GetUtf16CharLenght(static_cast(*this->NextCharStartIterator)); + + if (CharCodepointCount == 0x1) + { + // Read the only codepoint + this->CurrentChar.Char.Lower = *this->NextCharStartIterator; + this->NextCharStartIterator++; + + return; + } + + // Read the first of two codepoints + this->CurrentChar.Char.Upper = *this->NextCharStartIterator; + this->NextCharStartIterator++; + + // The least character ended abruptly + if (this->NextCharStartIterator == this->EndIterator) + { + this->CurrentChar = utf16_pair{ 0 }; + this->CurrentIterator = this->EndIterator; + return; + } + + // Read the second of two codepoints + this->CurrentChar.Char.Lower = *this->NextCharStartIterator; + this->NextCharStartIterator++; + } + }; + + template< + typename codepoint_iterator_type, + typename iterator_deref_type = decltype(*std::declval()), // Iterator can be dereferenced + typename = typename std::enable_if::type) == utf_char32::GetCodepointSize()>::type // Return-value of derferenced iterator has the same size as one codepoint + > + class utf32_iterator : public UtfImpl::Iterator::utf_char_iterator_base, codepoint_iterator_type, utf_char32> + { + private: + typedef typename utf32_iterator own_type; + + friend UtfImpl::Iterator::utf_char_iterator_base_child_acessor; + + public: + using UtfImpl::Iterator::utf_char_iterator_base::utf_char_iterator_base; + + public: + utf32_iterator() = delete; + + public: + template + auto Replace(const char_type NewChar) -> std::enable_if_t::value> + { + this->CurrentChar = NewChar; + *this->CurrentIterator = NewChar; + } + + private: + void ReadChar() + { + if (this->NextCharStartIterator == this->EndIterator) + return; + + this->CurrentChar = *this->NextCharStartIterator; + this->NextCharStartIterator++; + } + }; + + template::value, int>::type = 0 + > + UTF_CONSTEXPR UTF_NODISCARD + utf_char8 ParseUtf8CharFromStr(const codepoint_type* Str) + { + if (!Str) + return utf8_bytes{}; + + const utf_cp8_t FirstCodepoint = static_cast(Str[0]); + const auto CharLength = GetUtf8CharLenght(FirstCodepoint); + + if (CharLength == 0) + return utf8_bytes{}; + + utf8_bytes RetChar; + RetChar.Codepoints[0] = FirstCodepoint; + + for (int i = 1; i < CharLength; i++) + { + const utf_cp8_t CurrentCodepoint = static_cast(Str[i]); + + // Filters the null-terminator and other invalid followup bytes + if (!UtfImpl::Utf8::IsValidFollowupCodepoint(CurrentCodepoint)) + return utf8_bytes{}; + + RetChar.Codepoints[i] = CurrentCodepoint; + } + + return RetChar; + } + + template::value, int>::type = 0 + > + UTF_CONSTEXPR UTF_NODISCARD + utf_char16 ParseUtf16CharFromStr(const codepoint_type* Str) + { + if (!Str) + return utf_char16{}; + + const utf_cp16_t FirstCodepoint = static_cast(Str[0]); + + if (GetUtf16CharLenght(FirstCodepoint) == 1) + return utf16_pair{ FirstCodepoint }; + + return utf16_pair{ FirstCodepoint, static_cast(Str[1]) }; + } + + template::value, int>::type = 0 + > + UTF_CONSTEXPR UTF_NODISCARD + utf_char32 ParseUtf32CharFromStr(const codepoint_type* Str) + { + if (!Str) + return utf_char32{}; + + return static_cast(Str[0]); + } + + + /* + * Conversions from UTF-16 to UTF-8 + */ + template()))>::type + > + UTF_CONSTEXPR20 UTF_NODISCARD + utf8_char_string Utf16StringToUtf8String(utf16_iterator StringIteratorToConvert) + { + utf8_char_string RetString; + + for (const utf_char16 Char : StringIteratorToConvert) + { + const auto NewChar = Utf16PairToUtf8Bytes(Char); + + for (int i = 0; i < NewChar.GetNumCodepoints(); i++) + RetString += static_cast(NewChar[static_cast(i)]); + } + + return RetString; + } + + template())), + typename = utf16_iterator + > + UTF_CONSTEXPR20 UTF_NODISCARD + utf8_char_string Utf16StringToUtf8String(const utf16_char_string& StringToConvert) + { + return Utf16StringToUtf8String(utf16_iterator(StringToConvert)); + } + + template + > + UTF_CONSTEXPR20 UTF_NODISCARD + utf8_char_string Utf16StringToUtf8String(utf16_char_type(&StringToConvert)[CStrLenght]) + { + return Utf16StringToUtf8String(utf16_iterator(std::begin(StringToConvert), std::end(StringToConvert))); + } + + template + > + UTF_CONSTEXPR20 UTF_NODISCARD + utf8_char_string Utf16StringToUtf8String(const utf16_char_type* StringToConvert, int NonNullTermiantedLength) + { + return Utf16StringToUtf8String(utf16_iterator(StringToConvert, StringToConvert + NonNullTermiantedLength)); + } + + + /* + * Conversions from UTF-32 to UTF-8 + */ + template()))>::type + > + UTF_CONSTEXPR20 UTF_NODISCARD + utf8_char_string Utf32StringToUtf8String(utf32_iterator StringIteratorToConvert) + { + utf8_char_string RetString; + + for (const utf_char32 Char : StringIteratorToConvert) + { + const auto NewChar = Utf32ToUtf8Bytes(Char); + + for (int i = 0; i < NewChar.GetNumCodepoints(); i++) + RetString += static_cast(NewChar[static_cast(i)]); + } + + return RetString; + } + + template())), + typename = utf32_iterator + > + UTF_CONSTEXPR20 UTF_NODISCARD + utf8_char_string Utf32StringToUtf8String(const utf32_char_string& StringToConvert) + { + return Utf32StringToUtf8String(utf32_iterator(StringToConvert)); + } + + template + > + UTF_CONSTEXPR20 UTF_NODISCARD + utf8_char_string Utf32StringToUtf8String(utf32_char_type(&StringToConvert)[cstr_lenght]) + { + return Utf32StringToUtf8String(utf32_iterator(std::begin(StringToConvert), std::end(StringToConvert))); + } + + template + > + UTF_CONSTEXPR20 UTF_NODISCARD + utf8_char_string Utf32StringToUtf8String(const utf32_char_type* StringToConvert, int NonNullTermiantedLength) + { + return Utf32StringToUtf8String(utf32_iterator(StringToConvert, StringToConvert + NonNullTermiantedLength)); + } + + + /* + * Conversions from UTF-8 to UTF-16 + */ + template()))>::type + > + UTF_CONSTEXPR20 UTF_NODISCARD + utf16_char_string Utf8StringToUtf16String(utf8_iterator StringIteratorToConvert) + { + utf16_char_string RetString; + + for (const utf_char8 Char : StringIteratorToConvert) + { + const auto NewChar = Utf8BytesToUtf16(Char); + + if (NewChar.GetNumCodepoints() > 1) + RetString += NewChar.Get().Upper; + + RetString += NewChar.Get().Lower; + } + + return RetString; + } + + template())), + typename = utf8_iterator + > + UTF_CONSTEXPR20 UTF_NODISCARD + utf16_char_string Utf8StringToUtf16String(const utf8_char_string& StringToConvert) + { + return Utf8StringToUtf16String(utf8_iterator(StringToConvert)); + } + + template + > + UTF_CONSTEXPR20 UTF_NODISCARD + utf16_char_string Utf8StringToUtf16String(utf8_char_type(&StringToConvert)[cstr_lenght]) + { + return Utf32StringToUtf16String(utf8_iterator(std::begin(StringToConvert), std::end(StringToConvert))); + } + + template + > + UTF_CONSTEXPR20 UTF_NODISCARD + utf16_char_string Utf8StringToUtf16String(const utf8_char_type* StringToConvert, int NonNullTermiantedLength) + { + return Utf32StringToUtf16String(utf32_iterator(StringToConvert, StringToConvert + NonNullTermiantedLength)); + } + + + /* + * Conversions from UTF-32 to UTF-16 + */ + template()))>::type + > + UTF_CONSTEXPR20 UTF_NODISCARD + utf16_char_string Utf32StringToUtf16String(utf32_iterator StringIteratorToConvert) + { + utf16_char_string RetString; + + for (const utf_char32 Char : StringIteratorToConvert) + { + const auto NewChar = Utf32ToUtf16Pair(Char); + + if (NewChar.GetNumCodepoints() > 1) + RetString += NewChar.Get().Upper; + + RetString += NewChar.Get().Lower; + } + + return RetString; + } + + template())), + typename = utf32_iterator + > + UTF_CONSTEXPR20 UTF_NODISCARD + utf16_char_string Utf32StringToUtf16String(const utf32_char_string& StringToConvert) + { + return Utf32StringToUtf16String(utf32_iterator(StringToConvert)); + } + + template + > + UTF_CONSTEXPR20 UTF_NODISCARD + utf16_char_string Utf32StringToUtf16String(utf32_char_type(&StringToConvert)[cstr_lenght]) + { + return Utf32StringToUtf16String(utf32_iterator(std::begin(StringToConvert), std::end(StringToConvert))); + } + + template + > + UTF_CONSTEXPR20 UTF_NODISCARD + utf16_char_string Utf32StringToUtf16String(const utf32_char_type* StringToConvert, int NonNullTermiantedLength) + { + return Utf32StringToUtf16String(utf32_iterator(StringToConvert, StringToConvert + NonNullTermiantedLength)); + } + + + /* + * Conversions from UTF-8 to UTF-32 + */ + template()))>::type + > + UTF_CONSTEXPR20 UTF_NODISCARD + utf32_char_string Utf8StringToUtf32String(utf8_iterator StringIteratorToConvert) + { + utf32_char_string RetString; + + for (const utf_char8 Char : StringIteratorToConvert) + { + RetString += Utf8BytesToUtf32(Char); + } + + return RetString; + } + + template())), + typename = utf8_iterator + > + UTF_CONSTEXPR20 UTF_NODISCARD + utf32_char_string Utf8StringToUtf32String(const utf8_char_string& StringToConvert) + { + return Utf8StringToUtf32String(utf8_iterator(StringToConvert)); + } + + template + > + UTF_CONSTEXPR20 UTF_NODISCARD + utf32_char_string Utf8StringToUtf32String(utf8_char_type(&StringToConvert)[cstr_lenght]) + { + return Utf8StringToUtf32String(utf8_iterator(std::begin(StringToConvert), std::end(StringToConvert))); + } + + template + > + UTF_CONSTEXPR20 UTF_NODISCARD + utf32_char_string Utf8StringToUtf32String(const utf8_char_type* StringToConvert, int NonNullTermiantedLength) + { + return Utf8StringToUtf32String(utf8_iterator(StringToConvert, StringToConvert + NonNullTermiantedLength)); + } + + + /* + * Conversions from UTF-16 to UTF-32 + */ + template()))>::type + > + UTF_CONSTEXPR20 UTF_NODISCARD + utf32_char_string Utf16StringToUtf32String(utf16_iterator StringIteratorToConvert) + { + utf32_char_string RetString; + + for (const utf_char16 Char : StringIteratorToConvert) + { + RetString += Utf16PairToUtf32(Char).Get(); + } + + return RetString; + } + + template())), + typename = utf16_iterator + > + UTF_CONSTEXPR20 UTF_NODISCARD + utf32_char_string Utf16StringToUtf32String(const utf16_char_string& StringToConvert) + { + return Utf16StringToUtf32String(utf16_iterator(StringToConvert)); + } + + template + > + UTF_CONSTEXPR20 UTF_NODISCARD + utf32_char_string Utf16StringToUtf32String(utf16_char_type(&StringToConvert)[cstr_lenght]) + { + return Utf16StringToUtf32String(utf16_iterator(std::begin(StringToConvert), std::end(StringToConvert))); + } + + template + > + UTF_CONSTEXPR20 UTF_NODISCARD + utf32_char_string Utf16StringToUtf32String(const utf16_char_type* StringToConvert, int NonNullTermiantedLength) + { + return Utf16StringToUtf32String(utf16_iterator(StringToConvert, StringToConvert + NonNullTermiantedLength)); + } + + + template())), // has 'begin()' + typename = decltype(std::end(std::declval())) // has 'end()' + > + UTF_CONSTEXPR20 UTF_NODISCARD + string_type WStringToString(const wstring_type& WideString) + { + using char_type = typename std::decay()))>::type; + + // Workaround to missing 'if constexpr (...)' in Cpp14. Satisfies the requirements of conversion-functions. Safe because the incorrect function is never going to be invoked. + struct dummy_2byte_str { uint16_t* begin() const { return nullptr; }; uint16_t* end() const { return nullptr; }; }; + struct dummy_4byte_str { uint32_t* begin() const { return nullptr; }; uint32_t* end() const { return nullptr; }; }; + + if UTF_IF_CONSTEXPR (sizeof(char_type) == 0x2) // UTF-16 + { + using type_to_use = typename std::conditional::type; + return Utf16StringToUtf8String(UtfImpl::Utils::ForceCastIfMissmatch(WideString)); + } + else // UTF-32 + { + using type_to_use = typename std::conditional::type; + return Utf32StringToUtf8String(UtfImpl::Utils::ForceCastIfMissmatch(WideString)); + } + } + + template())), // has 'begin()' + typename = decltype(std::end(std::declval())) // has 'end()' + > + UTF_CONSTEXPR20 UTF_NODISCARD + wstring_type StringToWString(const string_type& NarrowString) + { + using char_type = typename std::decay()))>::type; + + // Workaround to missing 'if constexpr (...)' in Cpp14. Satisfies the requirements of conversion-functions. Safe because the incorrect function is never going to be invoked. + struct dummy_2byte_str { uint16_t* begin() const { return nullptr; }; uint16_t* end() const { return nullptr; }; }; + struct dummy_4byte_str { uint32_t* begin() const { return nullptr; }; uint32_t* end() const { return nullptr; }; }; + + if UTF_IF_CONSTEXPR(sizeof(char_type) == 0x2) // UTF-16 + { + using type_to_use = typename std::conditional::type; + return Utf8StringToUtf16String(NarrowString); + } + else // UTF-32 + { + using type_to_use = typename std::conditional::type; + return Utf8StringToUtf32String(NarrowString); + } + } + + + template + UTF_CONSTEXPR byte_iterator_type ReplaceUtf8(byte_iterator_type Begin, byte_iterator_type End, utf_cp8_t CharToReplace, utf_cp8_t ReplacementChar) + { + using namespace UtfImpl; + + if (Begin == End) + return End; + + const auto ToReplaceSize = GetUtf8CharLenght(CharToReplace); + const auto ReplacementSize = GetUtf8CharLenght(ReplacementChar); + + if (ToReplaceSize == ReplacementSize) // Trivial replacement + { + // TODO + } + else if (ToReplaceSize < ReplacementSize) // + { + // TODO + } + else /* if (ToReplaceSize > ReplacementSize) */ // Replace and move following bytes back + { + // TODO + } + } + + // utf_char spezialization-implementation for Utf8 + UTF_CONSTEXPR utf_char::utf_char(utf8_bytes InChar) noexcept + : Char(InChar) + { + } + + template + UTF_CONSTEXPR utf_char::utf_char(const char_type* SingleCharString) noexcept + : utf_char(ParseUtf8CharFromStr(SingleCharString)) + { + } + + UTF_CONSTEXPR utf_char& utf_char::operator=(utf8_bytes inBytse) noexcept + { + Char.Codepoints[0] = inBytse.Codepoints[0]; + Char.Codepoints[1] = inBytse.Codepoints[1]; + Char.Codepoints[2] = inBytse.Codepoints[2]; + Char.Codepoints[3] = inBytse.Codepoints[3]; + + return *this; + } + + UTF_CONSTEXPR UTF_NODISCARD + bool utf_char::operator==(utf_char8 Other) const noexcept + { + return Char == Other.Char; + } + + UTF_CONSTEXPR UTF_NODISCARD + utf_cp8_t& utf_char::operator[](const uint8_t Index) + { +#ifdef _DEBUG + if (Index >= 0x4) + throw std::out_of_range("Index was greater than 4!"); +#endif // _DEBUG + return Char.Codepoints[Index]; + } + + UTF_CONSTEXPR UTF_NODISCARD + const utf_cp8_t& utf_char::operator[](const uint8_t Index) const + { +#ifdef _DEBUG + if (Index >= 0x4) + throw std::out_of_range("Index was greater than 4!"); +#endif // _DEBUG + return Char.Codepoints[Index]; + } + + UTF_CONSTEXPR UTF_NODISCARD + bool utf_char::operator!=(utf_char8 Other) const noexcept + { + return Char != Other.Char; + } + + UTF_CONSTEXPR UTF_NODISCARD + utf_char8 utf_char::GetAsUtf8() const noexcept + { + return *this; + } + + UTF_CONSTEXPR UTF_NODISCARD + utf_char16 utf_char::GetAsUtf16() const noexcept + { + return Utf8BytesToUtf16(*this); + } + + UTF_CONSTEXPR UTF_NODISCARD + utf_char32 utf_char::GetAsUtf32() const noexcept + { + return Utf8BytesToUtf32(*this); + } + + UTF_CONSTEXPR UTF_NODISCARD + utf8_bytes utf_char::Get() const + { + return Char; + } + + UTF_CONSTEXPR UTF_NODISCARD + UtfEncodingType utf_char::GetEncoding() const noexcept + { + return UtfEncodingType::Utf8; + } + + UTF_CONSTEXPR UTF_NODISCARD + uint8_t utf_char::GetNumCodepoints() const noexcept + { + return GetUtf8CharLenght(Char.Codepoints[0]); + } + + UTF_CONSTEXPR UTF_NODISCARD + /* static */ uint8_t utf_char::GetCodepointSize() noexcept + { + return 0x1; + } + + + + // utf_char spezialization-implementation for Utf8 + UTF_CONSTEXPR utf_char::utf_char(utf16_pair InChar) noexcept + : Char(InChar) + { + } + + template + UTF_CONSTEXPR utf_char::utf_char(const char_type* SingleCharString) noexcept + : utf_char(ParseUtf16CharFromStr(SingleCharString)) + { + } + + UTF_CONSTEXPR utf_char& utf_char::operator=(utf16_pair inBytse) noexcept + { + Char.Upper = inBytse.Upper; + Char.Lower = inBytse.Lower; + + return *this; + } + + UTF_CONSTEXPR UTF_NODISCARD + bool utf_char::operator==(utf_char16 Other) const noexcept + { + return Char == Other.Char; + } + + UTF_CONSTEXPR UTF_NODISCARD + bool utf_char::operator!=(utf_char16 Other) const noexcept + { + return Char != Other.Char; + } + + UTF_CONSTEXPR UTF_NODISCARD + utf_char8 utf_char::GetAsUtf8() const noexcept + { + return Utf16PairToUtf8Bytes(Char); + } + + UTF_CONSTEXPR UTF_NODISCARD + utf_char16 utf_char::GetAsUtf16() const noexcept + { + return Char; + } + + UTF_CONSTEXPR UTF_NODISCARD + utf_char32 utf_char::GetAsUtf32() const noexcept + { + return Utf16PairToUtf32(Char); + } + + UTF_CONSTEXPR UTF_NODISCARD + utf16_pair utf_char::Get() const noexcept + { + return Char; + } + + UTF_CONSTEXPR UTF_NODISCARD + UtfEncodingType utf_char::GetEncoding() const noexcept + { + return UtfEncodingType::Utf16; + } + + UTF_CONSTEXPR UTF_NODISCARD + uint8_t utf_char::GetNumCodepoints() const noexcept + { + return GetUtf16CharLenght(Char.Upper); + } + + UTF_CONSTEXPR UTF_NODISCARD + /* static */ uint8_t utf_char::GetCodepointSize() noexcept + { + return 0x2; + } + + + + // utf_char spezialization-implementation for Utf32 + UTF_CONSTEXPR utf_char::utf_char(utf_cp32_t InChar) noexcept + : Char(InChar) + { + } + + template + UTF_CONSTEXPR utf_char::utf_char(const char_type* SingleCharString) noexcept + : Char(*SingleCharString) + { + } + + UTF_CONSTEXPR utf_char& utf_char::operator=(utf_cp32_t inBytse) noexcept + { + Char = inBytse; + return *this; + } + + UTF_CONSTEXPR UTF_NODISCARD + bool utf_char::operator==(utf_char32 Other) const noexcept + { + return Char == Other.Char; + } + + UTF_CONSTEXPR UTF_NODISCARD + bool utf_char::operator!=(utf_char32 Other) const noexcept + { + return Char != Other.Char; + } + + UTF_CONSTEXPR UTF_NODISCARD + utf_char8 utf_char::GetAsUtf8() const noexcept + { + return Utf32ToUtf8Bytes(Char); + } + + UTF_CONSTEXPR UTF_NODISCARD + utf_char16 utf_char::GetAsUtf16() const noexcept + { + return Utf32ToUtf16Pair(Char); + } + + UTF_CONSTEXPR UTF_NODISCARD + utf_char32 utf_char::GetAsUtf32() const noexcept + { + return Char; + } + + UTF_CONSTEXPR UTF_NODISCARD + utf_cp32_t utf_char::Get() const noexcept + { + return Char; + } + + UTF_CONSTEXPR UTF_NODISCARD + UtfEncodingType utf_char::GetEncoding() const noexcept + { + return UtfEncodingType::Utf32; + } + + UTF_CONSTEXPR UTF_NODISCARD + uint8_t utf_char::GetNumCodepoints() const noexcept + { + return 0x1; + } + + UTF_CONSTEXPR UTF_NODISCARD + /* static */ uint8_t utf_char::GetCodepointSize() noexcept + { + return 0x4; + } +} + +#undef UTF_CONSTEXPR +#undef UTF_CONSTEXPR14 +#undef UTF_CONSTEXPR17 +#undef UTF_CONSTEXPR20 +#undef UTF_CONSTEXPR23 +#undef UTF_CONSTEXPR26 + + +// Restore all warnings suppressed for the UTF-N implementation +#if (defined(_MSC_VER)) +#pragma warning (pop) +#elif (defined(__CLANG__) || defined(__GNUC__)) +#pragma GCC diagnostic pop +#endif // Warnings \ No newline at end of file