From f30e229619cd1e62a2b44c4257b0c1c256ebe751 Mon Sep 17 00:00:00 2001 From: Oprea Alexandru Date: Thu, 25 Jul 2024 19:10:17 +0300 Subject: [PATCH 1/4] Added Email, Country and Attributes as advanced parameters for blueprint-based functions --- Source/ConfigCatWrappers/Public/ConfigCatUserWrapper.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/ConfigCatWrappers/Public/ConfigCatUserWrapper.h b/Source/ConfigCatWrappers/Public/ConfigCatUserWrapper.h index c22c7c1..b0ff678 100644 --- a/Source/ConfigCatWrappers/Public/ConfigCatUserWrapper.h +++ b/Source/ConfigCatWrappers/Public/ConfigCatUserWrapper.h @@ -15,13 +15,13 @@ class CONFIGCATWRAPPERS_API UConfigCatUserWrapper : public UObject GENERATED_BODY() public: - UFUNCTION(BlueprintPure, Category = "ConfigCat|User") + UFUNCTION(BlueprintPure, Category = "ConfigCat|User", meta = (AdvancedDisplay = "Email, Country, Attributes")) static UConfigCatUserWrapper* CreateUser(const FString& Id, const FString& Email, const FString& Country, const TMap& Attributes); static UConfigCatUserWrapper* CreateUser(const std::shared_ptr& InUser); /** - * Gets the Id of a ConfigCatUser - */ + * Gets the Id of a ConfigCatUser + */ UFUNCTION(BlueprintPure, Category = "ConfigCat|User") FString GetIdentifier() const; @@ -46,7 +46,7 @@ class CONFIGCATWRAPPERS_API UConfigCatUserWrapper : public UObject bool HasStringArrayAttribute(const FString& Key) const; std::shared_ptr User; - + private: const configcat::ConfigCatUser::AttributeValue* GetUserAttributeForKey(const FString& Key) const; }; \ No newline at end of file From 982b06070a30dda778ba0417098c0231fd1f9dff Mon Sep 17 00:00:00 2001 From: Oprea Alexandru Date: Thu, 25 Jul 2024 19:10:48 +0300 Subject: [PATCH 2/4] version bump --- ConfigCat.uplugin | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ConfigCat.uplugin b/ConfigCat.uplugin index 77a5071..284645c 100644 --- a/ConfigCat.uplugin +++ b/ConfigCat.uplugin @@ -1,6 +1,6 @@ { "FileVersion": 3, - "VersionName": "2.1.3", + "VersionName": "2.1.4", "EngineVersion": "5.4", "FriendlyName": "ConfigCat", "Description": "ConfigCat is a hosted service for feature flag and configuration management. It lets you decouple feature releases from code deployments.", From 82f69f2fb3ecf2c2f894a50b07d757ad5a331780 Mon Sep 17 00:00:00 2001 From: Oprea Alexandru Date: Thu, 25 Jul 2024 19:28:24 +0300 Subject: [PATCH 3/4] added overload for C++ user to facilitate easier creation --- Source/ConfigCatWrappers/Private/ConfigCatUserWrapper.cpp | 5 +++++ Source/ConfigCatWrappers/Public/ConfigCatUserWrapper.h | 1 + 2 files changed, 6 insertions(+) diff --git a/Source/ConfigCatWrappers/Private/ConfigCatUserWrapper.cpp b/Source/ConfigCatWrappers/Private/ConfigCatUserWrapper.cpp index 475e9c7..ae3f8fc 100644 --- a/Source/ConfigCatWrappers/Private/ConfigCatUserWrapper.cpp +++ b/Source/ConfigCatWrappers/Private/ConfigCatUserWrapper.cpp @@ -24,6 +24,11 @@ UConfigCatUserWrapper* UConfigCatUserWrapper::CreateUser(const FString& Id, cons return CreateUser(ConfigCatUser::create(UserId, UserEmail, UserCountry, UserAttributes)); } +UConfigCatUserWrapper* UConfigCatUserWrapper::CreateUser(const FString& Id, const FString& Email, const FString& Country) +{ + return CreateUser(Id, Email, Country, {}); +} + UConfigCatUserWrapper* UConfigCatUserWrapper::CreateUser(const std::shared_ptr& InUser) { UConfigCatUserWrapper* Result = NewObject(); diff --git a/Source/ConfigCatWrappers/Public/ConfigCatUserWrapper.h b/Source/ConfigCatWrappers/Public/ConfigCatUserWrapper.h index b0ff678..2d3cf13 100644 --- a/Source/ConfigCatWrappers/Public/ConfigCatUserWrapper.h +++ b/Source/ConfigCatWrappers/Public/ConfigCatUserWrapper.h @@ -17,6 +17,7 @@ class CONFIGCATWRAPPERS_API UConfigCatUserWrapper : public UObject public: UFUNCTION(BlueprintPure, Category = "ConfigCat|User", meta = (AdvancedDisplay = "Email, Country, Attributes")) static UConfigCatUserWrapper* CreateUser(const FString& Id, const FString& Email, const FString& Country, const TMap& Attributes); + static UConfigCatUserWrapper* CreateUser(const FString& Id, const FString& Email = TEXT(""), const FString& Country = TEXT("")); static UConfigCatUserWrapper* CreateUser(const std::shared_ptr& InUser); /** From 7f7d00f546b844ce235553619347cc2fd3664d09 Mon Sep 17 00:00:00 2001 From: Oprea Alexandru Date: Thu, 25 Jul 2024 19:44:47 +0300 Subject: [PATCH 4/4] removed dedicated wrappers module + refactor to allow a single include in examples --- ConfigCat.uplugin | 6 --- Source/ConfigCat/ConfigCat.Build.cs | 1 - .../ConfigCat/Private/ConfigCatSubsystem.cpp | 8 ++-- .../Wrappers}/ConfigCatEvaluationWrapper.cpp | 10 ++--- .../ConfigCatPercentageOptionWrapper.cpp | 4 +- .../ConfigCatSettingValueContainerWrapper.cpp | 4 +- .../Wrappers}/ConfigCatSettingsWrapper.cpp | 8 ++-- .../ConfigCatTargetingRuleWrapper.cpp | 8 ++-- .../Wrappers}/ConfigCatUserWrapper.cpp | 43 ++++++++++--------- .../Wrappers}/ConfigCatValueWrapper.cpp | 2 +- Source/ConfigCat/Public/ConfigCatSubsystem.h | 2 + .../Wrappers}/ConfigCatEvaluationWrapper.h | 2 +- .../ConfigCatPercentageOptionWrapper.h | 2 +- .../ConfigCatSettingValueContainerWrapper.h | 2 +- .../Wrappers}/ConfigCatSettingsWrapper.h | 4 +- .../Wrappers}/ConfigCatTargetingRuleWrapper.h | 10 ++--- .../Public/Wrappers}/ConfigCatUserWrapper.h | 13 +++--- .../Public/Wrappers}/ConfigCatValueWrapper.h | 2 +- .../ConfigCatWrappers.Build.cs | 28 ------------ .../Private/ConfigCatWrappers.cpp | 5 --- .../Public/ConfigCatWrappers.h | 12 ------ 21 files changed, 65 insertions(+), 111 deletions(-) rename Source/{ConfigCatWrappers/Private => ConfigCat/Private/Wrappers}/ConfigCatEvaluationWrapper.cpp (91%) rename Source/{ConfigCatWrappers/Private => ConfigCat/Private/Wrappers}/ConfigCatPercentageOptionWrapper.cpp (89%) rename Source/{ConfigCatWrappers/Private => ConfigCat/Private/Wrappers}/ConfigCatSettingValueContainerWrapper.cpp (88%) rename Source/{ConfigCatWrappers/Private => ConfigCat/Private/Wrappers}/ConfigCatSettingsWrapper.cpp (92%) rename Source/{ConfigCatWrappers/Private => ConfigCat/Private/Wrappers}/ConfigCatTargetingRuleWrapper.cpp (96%) rename Source/{ConfigCatWrappers/Private => ConfigCat/Private/Wrappers}/ConfigCatUserWrapper.cpp (88%) rename Source/{ConfigCatWrappers/Private => ConfigCat/Private/Wrappers}/ConfigCatValueWrapper.cpp (97%) rename Source/{ConfigCatWrappers/Public => ConfigCat/Public/Wrappers}/ConfigCatEvaluationWrapper.h (95%) rename Source/{ConfigCatWrappers/Public => ConfigCat/Public/Wrappers}/ConfigCatPercentageOptionWrapper.h (90%) rename Source/{ConfigCatWrappers/Public => ConfigCat/Public/Wrappers}/ConfigCatSettingValueContainerWrapper.h (89%) rename Source/{ConfigCatWrappers/Public => ConfigCat/Public/Wrappers}/ConfigCatSettingsWrapper.h (92%) rename Source/{ConfigCatWrappers/Public => ConfigCat/Public/Wrappers}/ConfigCatTargetingRuleWrapper.h (93%) rename Source/{ConfigCatWrappers/Public => ConfigCat/Public/Wrappers}/ConfigCatUserWrapper.h (89%) rename Source/{ConfigCatWrappers/Public => ConfigCat/Public/Wrappers}/ConfigCatValueWrapper.h (95%) delete mode 100644 Source/ConfigCatWrappers/ConfigCatWrappers.Build.cs delete mode 100644 Source/ConfigCatWrappers/Private/ConfigCatWrappers.cpp delete mode 100644 Source/ConfigCatWrappers/Public/ConfigCatWrappers.h diff --git a/ConfigCat.uplugin b/ConfigCat.uplugin index 284645c..039e09d 100644 --- a/ConfigCat.uplugin +++ b/ConfigCat.uplugin @@ -19,12 +19,6 @@ "LoadingPhase": "PreDefault", "PlatformAllowList": [ "Win64", "Mac", "Linux", "Android", "iOS" ] }, - { - "Name": "ConfigCatWrappers", - "Type": "Runtime", - "LoadingPhase": "PreDefault", - "PlatformAllowList": [ "Win64", "Mac", "Linux", "Android", "iOS" ] - }, { "Name": "ConfigCatEditor", "Type": "Editor", diff --git a/Source/ConfigCat/ConfigCat.Build.cs b/Source/ConfigCat/ConfigCat.Build.cs index 111cf10..212111b 100644 --- a/Source/ConfigCat/ConfigCat.Build.cs +++ b/Source/ConfigCat/ConfigCat.Build.cs @@ -18,7 +18,6 @@ public ConfigCat(ReadOnlyTargetRules Target) : base(Target) PrivateDependencyModuleNames.AddRange(new[] { - "ConfigCatWrappers", "ConfigCatCppSdk" }); diff --git a/Source/ConfigCat/Private/ConfigCatSubsystem.cpp b/Source/ConfigCat/Private/ConfigCatSubsystem.cpp index 77116d1..6b9ba75 100644 --- a/Source/ConfigCat/Private/ConfigCatSubsystem.cpp +++ b/Source/ConfigCat/Private/ConfigCatSubsystem.cpp @@ -18,10 +18,10 @@ #include "ConfigCatLogger.h" #include "ConfigCatNetworkAdapter.h" #include "ConfigCatSettings.h" -#include "ConfigCatSettingsWrapper.h" -#include "ConfigCatEvaluationWrapper.h" -#include "ConfigCatUserWrapper.h" -#include "ConfigCatValueWrapper.h" + +#include "Wrappers/ConfigCatSettingsWrapper.h" +#include "Wrappers/ConfigCatEvaluationWrapper.h" +#include "Wrappers/ConfigCatValueWrapper.h" using namespace configcat; diff --git a/Source/ConfigCatWrappers/Private/ConfigCatEvaluationWrapper.cpp b/Source/ConfigCat/Private/Wrappers/ConfigCatEvaluationWrapper.cpp similarity index 91% rename from Source/ConfigCatWrappers/Private/ConfigCatEvaluationWrapper.cpp rename to Source/ConfigCat/Private/Wrappers/ConfigCatEvaluationWrapper.cpp index 3f9a300..15c0370 100644 --- a/Source/ConfigCatWrappers/Private/ConfigCatEvaluationWrapper.cpp +++ b/Source/ConfigCat/Private/Wrappers/ConfigCatEvaluationWrapper.cpp @@ -1,13 +1,13 @@ // Copyright (c) ConfigCat 2024. All Rights Reserved. -#include "ConfigCatEvaluationWrapper.h" +#include "Wrappers/ConfigCatEvaluationWrapper.h" #include "ConfigCatCppSDK/Include/log.h" -#include "ConfigCatPercentageOptionWrapper.h" -#include "ConfigCatTargetingRuleWrapper.h" -#include "ConfigCatUserWrapper.h" -#include "ConfigCatValueWrapper.h" +#include "Wrappers/ConfigCatPercentageOptionWrapper.h" +#include "Wrappers/ConfigCatTargetingRuleWrapper.h" +#include "Wrappers/ConfigCatUserWrapper.h" +#include "Wrappers/ConfigCatValueWrapper.h" UConfigCatEvaluationWrapper* UConfigCatEvaluationWrapper::CreateEvaluation(const configcat::EvaluationDetailsBase& InEvaluationDetails) { diff --git a/Source/ConfigCatWrappers/Private/ConfigCatPercentageOptionWrapper.cpp b/Source/ConfigCat/Private/Wrappers/ConfigCatPercentageOptionWrapper.cpp similarity index 89% rename from Source/ConfigCatWrappers/Private/ConfigCatPercentageOptionWrapper.cpp rename to Source/ConfigCat/Private/Wrappers/ConfigCatPercentageOptionWrapper.cpp index b249fcf..276358a 100644 --- a/Source/ConfigCatWrappers/Private/ConfigCatPercentageOptionWrapper.cpp +++ b/Source/ConfigCat/Private/Wrappers/ConfigCatPercentageOptionWrapper.cpp @@ -1,8 +1,8 @@ // Copyright (c) ConfigCat 2024. All Rights Reserved. -#include "ConfigCatPercentageOptionWrapper.h" +#include "Wrappers/ConfigCatPercentageOptionWrapper.h" -#include "ConfigCatValueWrapper.h" +#include "Wrappers/ConfigCatValueWrapper.h" UConfigCatPercentageOptionWrapper* UConfigCatPercentageOptionWrapper::CreatePercentageOption(const configcat::PercentageOption& InPercentageOption) { diff --git a/Source/ConfigCatWrappers/Private/ConfigCatSettingValueContainerWrapper.cpp b/Source/ConfigCat/Private/Wrappers/ConfigCatSettingValueContainerWrapper.cpp similarity index 88% rename from Source/ConfigCatWrappers/Private/ConfigCatSettingValueContainerWrapper.cpp rename to Source/ConfigCat/Private/Wrappers/ConfigCatSettingValueContainerWrapper.cpp index 44cd74d..ec17565 100644 --- a/Source/ConfigCatWrappers/Private/ConfigCatSettingValueContainerWrapper.cpp +++ b/Source/ConfigCat/Private/Wrappers/ConfigCatSettingValueContainerWrapper.cpp @@ -1,8 +1,8 @@ // Copyright (c) ConfigCat 2024. All Rights Reserved. -#include "ConfigCatSettingValueContainerWrapper.h" +#include "Wrappers/ConfigCatSettingValueContainerWrapper.h" -#include "ConfigCatValueWrapper.h" +#include "Wrappers/ConfigCatValueWrapper.h" UConfigCatSettingValueContainerWrapper* UConfigCatSettingValueContainerWrapper::CreateSettingValue(const configcat::SettingValueContainer& SettingValueContainer) { diff --git a/Source/ConfigCatWrappers/Private/ConfigCatSettingsWrapper.cpp b/Source/ConfigCat/Private/Wrappers/ConfigCatSettingsWrapper.cpp similarity index 92% rename from Source/ConfigCatWrappers/Private/ConfigCatSettingsWrapper.cpp rename to Source/ConfigCat/Private/Wrappers/ConfigCatSettingsWrapper.cpp index 454760d..d7043a3 100644 --- a/Source/ConfigCatWrappers/Private/ConfigCatSettingsWrapper.cpp +++ b/Source/ConfigCat/Private/Wrappers/ConfigCatSettingsWrapper.cpp @@ -1,10 +1,10 @@ // Copyright (c) ConfigCat 2024. All Rights Reserved. -#include "ConfigCatSettingsWrapper.h" +#include "Wrappers/ConfigCatSettingsWrapper.h" -#include "ConfigCatPercentageOptionWrapper.h" -#include "ConfigCatTargetingRuleWrapper.h" -#include "ConfigCatValueWrapper.h" +#include "Wrappers/ConfigCatPercentageOptionWrapper.h" +#include "Wrappers/ConfigCatTargetingRuleWrapper.h" +#include "Wrappers/ConfigCatValueWrapper.h" using namespace configcat; diff --git a/Source/ConfigCatWrappers/Private/ConfigCatTargetingRuleWrapper.cpp b/Source/ConfigCat/Private/Wrappers/ConfigCatTargetingRuleWrapper.cpp similarity index 96% rename from Source/ConfigCatWrappers/Private/ConfigCatTargetingRuleWrapper.cpp rename to Source/ConfigCat/Private/Wrappers/ConfigCatTargetingRuleWrapper.cpp index 3421743..8fb7bc7 100644 --- a/Source/ConfigCatWrappers/Private/ConfigCatTargetingRuleWrapper.cpp +++ b/Source/ConfigCat/Private/Wrappers/ConfigCatTargetingRuleWrapper.cpp @@ -1,10 +1,10 @@ // Copyright (c) ConfigCat 2024. All Rights Reserved. -#include "ConfigCatTargetingRuleWrapper.h" +#include "Wrappers/ConfigCatTargetingRuleWrapper.h" -#include "ConfigCatSettingValueContainerWrapper.h" -#include "ConfigCatPercentageOptionWrapper.h" -#include "ConfigCatValueWrapper.h" +#include "Wrappers/ConfigCatSettingValueContainerWrapper.h" +#include "Wrappers/ConfigCatPercentageOptionWrapper.h" +#include "Wrappers/ConfigCatValueWrapper.h" UConfigCatUserConditionWrapper* UConfigCatUserConditionWrapper::CreateUserCondition(const configcat::UserCondition& InUserCondition) { diff --git a/Source/ConfigCatWrappers/Private/ConfigCatUserWrapper.cpp b/Source/ConfigCat/Private/Wrappers/ConfigCatUserWrapper.cpp similarity index 88% rename from Source/ConfigCatWrappers/Private/ConfigCatUserWrapper.cpp rename to Source/ConfigCat/Private/Wrappers/ConfigCatUserWrapper.cpp index ae3f8fc..1c5cdbf 100644 --- a/Source/ConfigCatWrappers/Private/ConfigCatUserWrapper.cpp +++ b/Source/ConfigCat/Private/Wrappers/ConfigCatUserWrapper.cpp @@ -1,11 +1,25 @@ // Copyright (c) ConfigCat 2024. All Rights Reserved. -#include "ConfigCatUserWrapper.h" +#include "Wrappers/ConfigCatUserWrapper.h" #include using namespace configcat; +namespace +{ + const ConfigCatUser::AttributeValue* GetUserAttributeForKey(const std::shared_ptr& User, const FString& Key) + { + if (!User) + { + return {}; + } + + const std::string AttributeKey = TCHAR_TO_UTF8(*Key); + return User->getAttribute(AttributeKey); + } +} + UConfigCatUserWrapper* UConfigCatUserWrapper::CreateUser(const FString& Id, const FString& Email, const FString& Country, const TMap& Attributes) { const std::string& UserId = TCHAR_TO_UTF8(*Id); @@ -50,7 +64,7 @@ FString UConfigCatUserWrapper::GetStringAttribute(const FString& Key) const { if (HasStringAttribute(Key)) { - const ConfigCatUser::AttributeValue* Attribute = GetUserAttributeForKey(Key); + const ConfigCatUser::AttributeValue* Attribute = GetUserAttributeForKey(User, Key); return UTF8_TO_TCHAR(std::get(*Attribute).c_str()); } @@ -61,7 +75,7 @@ double UConfigCatUserWrapper::GetNumberAttribute(const FString& Key) const { if (HasNumberAttribute(Key)) { - const ConfigCatUser::AttributeValue* Attribute = GetUserAttributeForKey(Key); + const ConfigCatUser::AttributeValue* Attribute = GetUserAttributeForKey(User, Key); return std::get(*Attribute); } @@ -72,7 +86,7 @@ FDateTime UConfigCatUserWrapper::GetTimeAttribute(const FString& Key) const { if (HasTimeAttribute(Key)) { - const ConfigCatUser::AttributeValue* Attribute = GetUserAttributeForKey(Key); + const ConfigCatUser::AttributeValue* Attribute = GetUserAttributeForKey(User, Key); const auto TimeSinceEpoch = std::get(*Attribute).time_since_epoch().count(); return FDateTime::FromUnixTimestamp(TimeSinceEpoch); } @@ -84,7 +98,7 @@ TArray UConfigCatUserWrapper::GetStringArrayAttribute(const FString& Ke { if (HasStringArrayAttribute(Key)) { - const ConfigCatUser::AttributeValue* Attribute = GetUserAttributeForKey(Key); + const ConfigCatUser::AttributeValue* Attribute = GetUserAttributeForKey(User, Key); TArray Result; const std::vector ArrayAttribute = std::get>(*Attribute); for (const std::string& ArrayIt : ArrayAttribute) @@ -104,35 +118,24 @@ bool UConfigCatUserWrapper::HasAnyAttribute(const FString& Key) const bool UConfigCatUserWrapper::HasStringAttribute(const FString& Key) const { - const ConfigCatUser::AttributeValue* Attribute = GetUserAttributeForKey(Key); + const ConfigCatUser::AttributeValue* Attribute = GetUserAttributeForKey(User, Key); return Attribute && std::holds_alternative(*Attribute); } bool UConfigCatUserWrapper::HasNumberAttribute(const FString& Key) const { - const ConfigCatUser::AttributeValue* Attribute = GetUserAttributeForKey(Key); + const ConfigCatUser::AttributeValue* Attribute = GetUserAttributeForKey(User, Key); return Attribute && std::holds_alternative(*Attribute); } bool UConfigCatUserWrapper::HasTimeAttribute(const FString& Key) const { - const ConfigCatUser::AttributeValue* Attribute = GetUserAttributeForKey(Key); + const ConfigCatUser::AttributeValue* Attribute = GetUserAttributeForKey(User, Key); return Attribute && std::holds_alternative(*Attribute); } bool UConfigCatUserWrapper::HasStringArrayAttribute(const FString& Key) const { - const ConfigCatUser::AttributeValue* Attribute = GetUserAttributeForKey(Key); + const ConfigCatUser::AttributeValue* Attribute = GetUserAttributeForKey(User, Key); return Attribute && std::holds_alternative>(*Attribute); -} - -const ConfigCatUser::AttributeValue* UConfigCatUserWrapper::GetUserAttributeForKey(const FString& Key) const -{ - if (!User) - { - return {}; - } - - const std::string AttributeKey = TCHAR_TO_UTF8(*Key); - return User->getAttribute(AttributeKey); } \ No newline at end of file diff --git a/Source/ConfigCatWrappers/Private/ConfigCatValueWrapper.cpp b/Source/ConfigCat/Private/Wrappers/ConfigCatValueWrapper.cpp similarity index 97% rename from Source/ConfigCatWrappers/Private/ConfigCatValueWrapper.cpp rename to Source/ConfigCat/Private/Wrappers/ConfigCatValueWrapper.cpp index 0e7bbca..7c17fd0 100644 --- a/Source/ConfigCatWrappers/Private/ConfigCatValueWrapper.cpp +++ b/Source/ConfigCat/Private/Wrappers/ConfigCatValueWrapper.cpp @@ -1,6 +1,6 @@ // Copyright (c) ConfigCat 2024. All Rights Reserved. -#include "ConfigCatValueWrapper.h" +#include "Wrappers/ConfigCatValueWrapper.h" UConfigCatValueWrapper* UConfigCatValueWrapper::CreateValue(const configcat::SettingValue& InValue) { diff --git a/Source/ConfigCat/Public/ConfigCatSubsystem.h b/Source/ConfigCat/Public/ConfigCatSubsystem.h index 63dc3b1..c777a30 100644 --- a/Source/ConfigCat/Public/ConfigCatSubsystem.h +++ b/Source/ConfigCat/Public/ConfigCatSubsystem.h @@ -6,6 +6,8 @@ #include #include +#include "Wrappers/ConfigCatUserWrapper.h" + #include "ConfigCatSubsystem.generated.h" class UConfigCatSettingsWrapper; diff --git a/Source/ConfigCatWrappers/Public/ConfigCatEvaluationWrapper.h b/Source/ConfigCat/Public/Wrappers/ConfigCatEvaluationWrapper.h similarity index 95% rename from Source/ConfigCatWrappers/Public/ConfigCatEvaluationWrapper.h rename to Source/ConfigCat/Public/Wrappers/ConfigCatEvaluationWrapper.h index 26dbaf2..e4edef3 100644 --- a/Source/ConfigCatWrappers/Public/ConfigCatEvaluationWrapper.h +++ b/Source/ConfigCat/Public/Wrappers/ConfigCatEvaluationWrapper.h @@ -15,7 +15,7 @@ class UConfigCatUserWrapper; class UConfigCatValueWrapper; UCLASS(DisplayName="Config Cat Evaluation") -class CONFIGCATWRAPPERS_API UConfigCatEvaluationWrapper : public UObject +class CONFIGCAT_API UConfigCatEvaluationWrapper : public UObject { GENERATED_BODY() diff --git a/Source/ConfigCatWrappers/Public/ConfigCatPercentageOptionWrapper.h b/Source/ConfigCat/Public/Wrappers/ConfigCatPercentageOptionWrapper.h similarity index 90% rename from Source/ConfigCatWrappers/Public/ConfigCatPercentageOptionWrapper.h rename to Source/ConfigCat/Public/Wrappers/ConfigCatPercentageOptionWrapper.h index 8024b91..cc86468 100644 --- a/Source/ConfigCatWrappers/Public/ConfigCatPercentageOptionWrapper.h +++ b/Source/ConfigCat/Public/Wrappers/ConfigCatPercentageOptionWrapper.h @@ -9,7 +9,7 @@ class UConfigCatValueWrapper; UCLASS(DisplayName="Config Cat Percentage Option") -class CONFIGCATWRAPPERS_API UConfigCatPercentageOptionWrapper : public UObject +class CONFIGCAT_API UConfigCatPercentageOptionWrapper : public UObject { GENERATED_BODY() diff --git a/Source/ConfigCatWrappers/Public/ConfigCatSettingValueContainerWrapper.h b/Source/ConfigCat/Public/Wrappers/ConfigCatSettingValueContainerWrapper.h similarity index 89% rename from Source/ConfigCatWrappers/Public/ConfigCatSettingValueContainerWrapper.h rename to Source/ConfigCat/Public/Wrappers/ConfigCatSettingValueContainerWrapper.h index 14b1292..1f64373 100644 --- a/Source/ConfigCatWrappers/Public/ConfigCatSettingValueContainerWrapper.h +++ b/Source/ConfigCat/Public/Wrappers/ConfigCatSettingValueContainerWrapper.h @@ -10,7 +10,7 @@ class UConfigCatValueWrapper; UCLASS(DisplayName="Config Cat Setting Value Container") -class CONFIGCATWRAPPERS_API UConfigCatSettingValueContainerWrapper : public UObject +class CONFIGCAT_API UConfigCatSettingValueContainerWrapper : public UObject { GENERATED_BODY() diff --git a/Source/ConfigCatWrappers/Public/ConfigCatSettingsWrapper.h b/Source/ConfigCat/Public/Wrappers/ConfigCatSettingsWrapper.h similarity index 92% rename from Source/ConfigCatWrappers/Public/ConfigCatSettingsWrapper.h rename to Source/ConfigCat/Public/Wrappers/ConfigCatSettingsWrapper.h index 529461f..6bc08b9 100644 --- a/Source/ConfigCatWrappers/Public/ConfigCatSettingsWrapper.h +++ b/Source/ConfigCat/Public/Wrappers/ConfigCatSettingsWrapper.h @@ -22,7 +22,7 @@ enum class EConfigCatSettingTypeWrapper : uint8 }; UCLASS(DisplayName="Config Cat Setting") -class CONFIGCATWRAPPERS_API UConfigCatSettingWrapper : public UObject +class CONFIGCAT_API UConfigCatSettingWrapper : public UObject { GENERATED_BODY() @@ -54,7 +54,7 @@ class CONFIGCATWRAPPERS_API UConfigCatSettingWrapper : public UObject }; UCLASS(DisplayName="Config Cat Settings") -class CONFIGCATWRAPPERS_API UConfigCatSettingsWrapper : public UObject +class CONFIGCAT_API UConfigCatSettingsWrapper : public UObject { GENERATED_BODY() diff --git a/Source/ConfigCatWrappers/Public/ConfigCatTargetingRuleWrapper.h b/Source/ConfigCat/Public/Wrappers/ConfigCatTargetingRuleWrapper.h similarity index 93% rename from Source/ConfigCatWrappers/Public/ConfigCatTargetingRuleWrapper.h rename to Source/ConfigCat/Public/Wrappers/ConfigCatTargetingRuleWrapper.h index 9ec38fa..b960a15 100644 --- a/Source/ConfigCatWrappers/Public/ConfigCatTargetingRuleWrapper.h +++ b/Source/ConfigCat/Public/Wrappers/ConfigCatTargetingRuleWrapper.h @@ -54,7 +54,7 @@ enum class EConfigCatUserComparator : uint8 }; UCLASS(DisplayName="Config Cat User Condition") -class CONFIGCATWRAPPERS_API UConfigCatUserConditionWrapper : public UObject +class CONFIGCAT_API UConfigCatUserConditionWrapper : public UObject { GENERATED_BODY() @@ -94,7 +94,7 @@ enum class EConfigCatPrerequisiteFlagComparator : uint8 }; UCLASS(DisplayName="Config Cat Prerequisite Flag Condition") -class CONFIGCATWRAPPERS_API UConfigCatPrerequisiteFlagConditionWrapper : public UObject +class CONFIGCAT_API UConfigCatPrerequisiteFlagConditionWrapper : public UObject { GENERATED_BODY() @@ -120,7 +120,7 @@ enum class EConfigCatSegmentComparator : uint8 }; UCLASS(DisplayName="Config Cat Segment Condition") -class CONFIGCATWRAPPERS_API UConfigCatSegmentConditionWrapper : public UObject +class CONFIGCAT_API UConfigCatSegmentConditionWrapper : public UObject { GENERATED_BODY() @@ -136,7 +136,7 @@ class CONFIGCATWRAPPERS_API UConfigCatSegmentConditionWrapper : public UObject }; USTRUCT(BlueprintType) -struct CONFIGCATWRAPPERS_API FConfigCatConditionContainer +struct CONFIGCAT_API FConfigCatConditionContainer { GENERATED_BODY() @@ -161,7 +161,7 @@ struct FConfigCatThenContainer }; UCLASS(DisplayName="Config Cat Targeting Rule") -class CONFIGCATWRAPPERS_API UConfigCatTargetingRuleWrapper : public UObject +class CONFIGCAT_API UConfigCatTargetingRuleWrapper : public UObject { GENERATED_BODY() diff --git a/Source/ConfigCatWrappers/Public/ConfigCatUserWrapper.h b/Source/ConfigCat/Public/Wrappers/ConfigCatUserWrapper.h similarity index 89% rename from Source/ConfigCatWrappers/Public/ConfigCatUserWrapper.h rename to Source/ConfigCat/Public/Wrappers/ConfigCatUserWrapper.h index 2d3cf13..82e54de 100644 --- a/Source/ConfigCatWrappers/Public/ConfigCatUserWrapper.h +++ b/Source/ConfigCat/Public/Wrappers/ConfigCatUserWrapper.h @@ -2,15 +2,19 @@ #pragma once -#include - #include + #include #include "ConfigCatUserWrapper.generated.h" +namespace configcat +{ + class ConfigCatUser; +} + UCLASS(DisplayName="Config Cat User") -class CONFIGCATWRAPPERS_API UConfigCatUserWrapper : public UObject +class CONFIGCAT_API UConfigCatUserWrapper : public UObject { GENERATED_BODY() @@ -47,7 +51,4 @@ class CONFIGCATWRAPPERS_API UConfigCatUserWrapper : public UObject bool HasStringArrayAttribute(const FString& Key) const; std::shared_ptr User; - -private: - const configcat::ConfigCatUser::AttributeValue* GetUserAttributeForKey(const FString& Key) const; }; \ No newline at end of file diff --git a/Source/ConfigCatWrappers/Public/ConfigCatValueWrapper.h b/Source/ConfigCat/Public/Wrappers/ConfigCatValueWrapper.h similarity index 95% rename from Source/ConfigCatWrappers/Public/ConfigCatValueWrapper.h rename to Source/ConfigCat/Public/Wrappers/ConfigCatValueWrapper.h index 40e2fab..d0fe383 100644 --- a/Source/ConfigCatWrappers/Public/ConfigCatValueWrapper.h +++ b/Source/ConfigCat/Public/Wrappers/ConfigCatValueWrapper.h @@ -9,7 +9,7 @@ #include "ConfigCatValueWrapper.generated.h" UCLASS(DisplayName="Config Cat SettingValue") -class CONFIGCATWRAPPERS_API UConfigCatValueWrapper : public UObject +class CONFIGCAT_API UConfigCatValueWrapper : public UObject { GENERATED_BODY() diff --git a/Source/ConfigCatWrappers/ConfigCatWrappers.Build.cs b/Source/ConfigCatWrappers/ConfigCatWrappers.Build.cs deleted file mode 100644 index 09126d8..0000000 --- a/Source/ConfigCatWrappers/ConfigCatWrappers.Build.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) ConfigCat 2024. All Rights Reserved. - -using UnrealBuildTool; - -public class ConfigCatWrappers : ModuleRules -{ - public ConfigCatWrappers(ReadOnlyTargetRules Target) : base(Target) - { - PublicDependencyModuleNames.AddRange(new[] - { - "Core", - "CoreUObject", - "DeveloperSettings", - "Projects", - "Engine", - "HTTP" - }); - - PrivateDependencyModuleNames.AddRange(new[] - { - "ConfigCatCppSdk" - }); - - PrivateIncludePaths.Add("ThirdParty"); - - bEnableExceptions = true; - } -} \ No newline at end of file diff --git a/Source/ConfigCatWrappers/Private/ConfigCatWrappers.cpp b/Source/ConfigCatWrappers/Private/ConfigCatWrappers.cpp deleted file mode 100644 index 2a704b6..0000000 --- a/Source/ConfigCatWrappers/Private/ConfigCatWrappers.cpp +++ /dev/null @@ -1,5 +0,0 @@ -// Copyright (c) ConfigCat 2024. All Rights Reserved. - -#include "ConfigCatWrappers.h" - -IMPLEMENT_MODULE(FConfigCatWrappersModule, ConfigCatWrappers) \ No newline at end of file diff --git a/Source/ConfigCatWrappers/Public/ConfigCatWrappers.h b/Source/ConfigCatWrappers/Public/ConfigCatWrappers.h deleted file mode 100644 index 11c10b5..0000000 --- a/Source/ConfigCatWrappers/Public/ConfigCatWrappers.h +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) ConfigCat 2024. All Rights Reserved. - -#pragma once - -#include - -/** - * @brief ConfigCatWrappers module contains all the blueprint-friendly wrapper classes based on the cpp-sdk classes - */ -class FConfigCatWrappersModule : public IModuleInterface -{ -};