4#include "Misc/ConfigCacheIni.h"
12 constexpr const TCHAR*
GlobalSection = TEXT(
"/Script/CoffeeLibrary.Config");
13 constexpr const TCHAR*
UserSection = TEXT(
"/Script/CoffeeLibrary.UserConfig");
22 int32 Result = DefaultValue;
53 float Result = DefaultValue;
84 FString Result = DefaultValue;
115 return GetInt(Key, bDefaultValue ? 1 : 0) != 0;
120 SetInt(Key, bValue ? 1 : 0, bAutoSave);
135 int32 Result = DefaultValue;
178 float Result = DefaultValue;
221 FString Result = DefaultValue;
258 return GetUserInt(UserId, Key, bDefaultValue ? 1 : 0) != 0;
263 SetUserInt(UserId, Key, bValue ? 1 : 0, bAutoSave);
288 return GConfig->GetString(
305 return GConfig->GetString(
349 GConfig->EmptySection(
368 TArray<FString> AllKeys;
375 const FString UserPrefix = FString::Printf(TEXT(
"User_%d_"), UserId);
376 for (
const FString& KeyValue : AllKeys)
381 if (KeyValue.Split(TEXT(
"="), &Key, &Value))
383 if (Key.StartsWith(UserPrefix))
402 GConfig->Flush(
false, GGameUserSettingsIni);
421 return FString::Printf(TEXT(
"User_%d_%s"), UserId, *Key);
static FString GetString(const FString &Key, const FString &DefaultValue=TEXT(""))
전역 문자열 설정 읽기
static FString GetUserString(int32 UserId, const FString &Key, const FString &DefaultValue=TEXT(""))
유저별 문자열 설정 읽기
static void SetFloat(const FString &Key, float Value, bool bAutoSave=true)
전역 실수 설정 저장
static void SetUserFloat(int32 UserId, const FString &Key, float Value, bool bAutoSave=true)
유저별 실수 설정 저장
static void SetUserJson(int32 UserId, const FString &Key, const FString &JsonData, bool bAutoSave=true)
유저별 JSON 데이터 저장
static FString MakeUserKey(int32 UserId, const FString &Key)
유저별 키 생성 (UserId 접두사 추가)
static void SetUserString(int32 UserId, const FString &Key, const FString &Value, bool bAutoSave=true)
유저별 문자열 설정 저장
static bool HasUserKey(int32 UserId, const FString &Key)
유저별 키 존재 여부 확인
static float GetUserFloat(int32 UserId, const FString &Key, float DefaultValue=0.0f)
유저별 실수 설정 읽기
static int32 GetUserInt(int32 UserId, const FString &Key, int32 DefaultValue=0)
유저별 정수 설정 읽기
static FString GetUserSection()
유저별 설정 Config Section 이름 반환
static FString GetGlobalSection()
전역 설정 Config Section 이름 반환
static void DeleteUserKey(int32 UserId, const FString &Key, bool bAutoSave=true)
유저별 키 삭제
static void DeleteKey(const FString &Key, bool bAutoSave=true)
전역 키 삭제
static FString GetUserJson(int32 UserId, const FString &Key, const FString &DefaultJson=TEXT("[]"))
유저별 JSON 데이터 읽기
static int32 GetInt(const FString &Key, int32 DefaultValue=0)
전역 정수 설정 읽기
static void SetString(const FString &Key, const FString &Value, bool bAutoSave=true)
전역 문자열 설정 저장
static void SetInt(const FString &Key, int32 Value, bool bAutoSave=true)
전역 정수 설정 저장
static void Save()
대기 중인 모든 변경사항을 디스크에 저장
static float GetFloat(const FString &Key, float DefaultValue=0.0f)
전역 실수 설정 읽기
static void SetUserInt(int32 UserId, const FString &Key, int32 Value, bool bAutoSave=true)
유저별 정수 설정 저장
static void SetBool(const FString &Key, bool bValue, bool bAutoSave=true)
전역 불린 설정 저장
static void DeleteAll(bool bAutoSave=true)
모든 전역 설정 삭제 (주의!)
static void DeleteAllUserData(int32 UserId, bool bAutoSave=true)
특정 유저의 모든 설정 삭제
static bool GetUserBool(int32 UserId, const FString &Key, bool bDefaultValue=false)
유저별 불린 설정 읽기
static bool GetBool(const FString &Key, bool bDefaultValue=false)
전역 불린 설정 읽기
static bool HasKey(const FString &Key)
전역 키 존재 여부 확인
static void SetUserBool(int32 UserId, const FString &Key, bool bValue, bool bAutoSave=true)
유저별 불린 설정 저장
constexpr const TCHAR * GlobalSection
constexpr const TCHAR * UserSection