Skip to content

Commit

Permalink
added overload for C++ user to facilitate easier creation
Browse files Browse the repository at this point in the history
  • Loading branch information
pasotee committed Jul 25, 2024
1 parent 982b060 commit 82f69f2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Source/ConfigCatWrappers/Private/ConfigCatUserWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<configcat::ConfigCatUser>& InUser)
{
UConfigCatUserWrapper* Result = NewObject<UConfigCatUserWrapper>();
Expand Down
1 change: 1 addition & 0 deletions Source/ConfigCatWrappers/Public/ConfigCatUserWrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<FString, FString>& Attributes);
static UConfigCatUserWrapper* CreateUser(const FString& Id, const FString& Email = TEXT(""), const FString& Country = TEXT(""));
static UConfigCatUserWrapper* CreateUser(const std::shared_ptr<configcat::ConfigCatUser>& InUser);

/**
Expand Down

0 comments on commit 82f69f2

Please sign in to comment.