How to use the variables types?

I’m trying to use https://docs.unrealengine.com/latest/INT/API/Runtime/Core/Internationalization/FInternationalization/GetCulturesWithA-/index.html but I always get this error: Unrecognized type ‘FCultureRef’. I never used c++ before.

Here’s how I’m doing it:



.h
UFUNCTION(BlueprintPure, meta = (DisplayName = "Get supported Culture Names"), Category = "Cultures")
	static TArray<FCultureRef> GetSupportedCultureNames(bool IncludeDerivedCultures = true);

-----

.cpp
TArray<FCultureRef> UMainMenuManagerOBJ::GetSupportedCultureNames(bool IncludeDerivedCultures)
{
	TArray<FCultureRef> Cultures;
	FInternationalization::Get().GetCulturesWithAvailableLocalization(FPaths::GetEditorLocalizationPaths(), Cultures, IncludeDerivedCultures);

	return Cultures;
}

I looked at the source but could no find anything to help me.
Thanks.

Did you include

Internationalization/Internationalization.h

in your .h file?

Yes, I had it included.

I tried the same and got this error to. Perhaps someone from the engine support staff might take a look at this. Here is what my crashdump logs for that error:


Dump Summary
------------
Dump File:    UnrealHeaderTool.exe.8420.dmp : C:\Users\xxxx\AppData\Local\CrashDumps\UnrealHeaderTool.exe.8420.dmp
Last Write Time:    09.07.2015 14:35:26
Process Name:    UnrealHeaderTool.exe : C:\Temp\Epic Games\4.8\Engine\Binaries\Win64\UnrealHeaderTool.exe
Process Architecture:    x64
Exception Code:    0xC0000005
**Exception Information:    The thread tried to read from or write to a virtual address for which it does not have the appropriate access.**
Heap Information:    Not Present

System Information
------------------
OS Version:    6.1.7601
CLR Version(s):    

Modules
-------
Module Name    Module Path    Module Version
-----------    -----------    --------------
UnrealHeaderTool.exe    C:\Temp\Epic Games\4.8\Engine\Binaries\Win64\UnrealHeaderTool.exe    4.8.1.0
ntdll.dll    C:\Windows\System32
tdll.dll    6.1.7601.18869
kernel32.dll    C:\Windows\System32\kernel32.dll    6.1.7601.18869
KERNELBASE.dll    C:\Windows\System32\KERNELBASE.dll    6.1.7601.18869
sysfer.dll    C:\Windows\System32\sysfer.dll    12.1.5337.5000
UnrealHeaderTool-Core.dll    C:\Temp\Epic Games\4.8\Engine\Binaries\Win64\UnrealHeaderTool-Core.dll    4.8.1.0
dbghelp.dll    C:\Windows\System32\dbghelp.dll    6.1.7601.17514
msvcrt.dll    C:\Windows\System32\msvcrt.dll    7.0.7601.17744
winmm.dll    C:\Windows\System32\winmm.dll    6.1.7600.16385
user32.dll    C:\Windows\System32\user32.dll    6.1.7601.17514
gdi32.dll    C:\Windows\System32\gdi32.dll    6.1.7601.18778
lpk.dll    C:\Windows\System32\lpk.dll    6.1.7601.18768
usp10.dll    C:\Windows\System32\usp10.dll    1.626.7601.18454
advapi32.dll    C:\Windows\System32\advapi32.dll    6.1.7601.18869
sechost.dll    C:\Windows\System32\sechost.dll    6.1.7601.18869
rpcrt4.dll    C:\Windows\System32\rpcrt4.dll    6.1.7601.18532
shell32.dll    C:\Windows\System32\shell32.dll    6.1.7601.18762
shlwapi.dll    C:\Windows\System32\shlwapi.dll    6.1.7601.17514
ole32.dll    C:\Windows\System32\ole32.dll    6.1.7601.17514
oleaut32.dll    C:\Windows\System32\oleaut32.dll    6.1.7601.18679
netapi32.dll    C:\Windows\System32
etapi32.dll    6.1.7601.17887
netutils.dll    C:\Windows\System32
etutils.dll    6.1.7601.17514
srvcli.dll    C:\Windows\System32\srvcli.dll    6.1.7601.17514
wkscli.dll    C:\Windows\System32\wkscli.dll    6.1.7601.17514
IPHLPAPI.DLL    C:\Windows\System32\IPHLPAPI.DLL    6.1.7601.17514
nsi.dll    C:\Windows\System32
si.dll    6.1.7600.16385
winnsi.dll    C:\Windows\System32\winnsi.dll    6.1.7600.16385
setupapi.dll    C:\Windows\System32\setupapi.dll    6.1.7601.17514
cfgmgr32.dll    C:\Windows\System32\cfgmgr32.dll    6.1.7601.17514
devobj.dll    C:\Windows\System32\devobj.dll    6.1.7600.16385
dwmapi.dll    C:\Windows\System32\dwmapi.dll    6.1.7601.18796
imm32.dll    C:\Windows\System32\imm32.dll    6.1.7600.16385
msctf.dll    C:\Windows\System32\msctf.dll    6.1.7601.18731
XINPUT1_3.dll    C:\Windows\System32\XINPUT1_3.dll    9.18.944.0
msvcp120.dll    C:\Windows\System32\msvcp120.dll    12.0.21005.1
msvcr120.dll    C:\Windows\System32\msvcr120.dll    12.0.21005.1
wer.dll    C:\Windows\System32\wer.dll    6.1.7601.18381
version.dll    C:\Windows\System32\version.dll    6.1.7600.16385
psapi.dll    C:\Windows\System32\psapi.dll    6.1.7600.16385
powrprof.dll    C:\Windows\System32\powrprof.dll    6.1.7600.16385
UnrealHeaderTool-CoreUObject.dll    C:\Temp\Epic Games\4.8\Engine\Binaries\Win64\UnrealHeaderTool-CoreUObject.dll    4.8.1.0
UnrealHeaderTool-Projects.dll    C:\Temp\Epic Games\4.8\Engine\Binaries\Win64\UnrealHeaderTool-Projects.dll    4.8.1.0
UnrealHeaderTool-Json.dll    C:\Temp\Epic Games\4.8\Engine\Binaries\Win64\UnrealHeaderTool-Json.dll    4.8.1.0
CRYPTBASE.dll    C:\Windows\System32\CRYPTBASE.dll    6.1.7600.16385
VSPerf120.dll    C:\Windows\System32\VSPerf120.dll    12.0.30501.0
icudt53.dll    C:\Temp\Epic Games\4.8\Engine\Binaries\ThirdParty\ICU\icu4c-53_1\Win64\VS2013\icudt53.dll    0.0.0.0
icuuc53.dll    C:\Temp\Epic Games\4.8\Engine\Binaries\ThirdParty\ICU\icu4c-53_1\Win64\VS2013\icuuc53.dll    53.1.0.0
icuin53.dll    C:\Temp\Epic Games\4.8\Engine\Binaries\ThirdParty\ICU\icu4c-53_1\Win64\VS2013\icuin53.dll    53.1.0.0
icule53.dll    C:\Temp\Epic Games\4.8\Engine\Binaries\ThirdParty\ICU\icu4c-53_1\Win64\VS2013\icule53.dll    53.1.0.0
iculx53.dll    C:\Temp\Epic Games\4.8\Engine\Binaries\ThirdParty\ICU\icu4c-53_1\Win64\VS2013\iculx53.dll    53.1.0.0
icuio53.dll    C:\Temp\Epic Games\4.8\Engine\Binaries\ThirdParty\ICU\icu4c-53_1\Win64\VS2013\icuio53.dll    53.1.0.0
sspicli.dll    C:\Windows\System32\sspicli.dll    6.1.7601.18869
uxtheme.dll    C:\Windows\System32\uxtheme.dll    6.1.7600.16385
profapi.dll    C:\Windows\System32\profapi.dll    6.1.7600.16385

The definition of FCulteRef states that it is threadsafe. Perhaps that is something we must take into account here.


#include "SharedPointer.h"

class FCulture;

typedef TSharedPtr<FCulture, ESPMode::ThreadSafe> FCulturePtr;
typedef TSharedRef<FCulture, ESPMode::ThreadSafe> FCultureRef;

Thanks for the info, guess we’ll have to wait.

I’m also having trouble with this https://docs.unrealengine.com/latest/INT/API/Runtime/Core/Misc/FConfigCacheIni/ForEachEntry/index.html.
My question at answerhub: https://answers.unrealengine.com/questions/251964/read-each-entry-from-ini-file.html, which I will copy below.

I’m trying to do:


USManager::GetGameSettings(){
 
     FString Section = "GameSettings";
 
     GConfig->ForEachEntry(
         SOMETHING_HERE_I_DONT_KNOW_WHAT
         *Section,
         GGameIni
         );

         //return outSettings;
 
 }

Here is the function (from Engine/SourceRuntime/Core/Public/Misc/ConfigCacheIni):


bool FConfigCacheIni::ForEachEntry(const FKeyValueSink& Visitor, const TCHAR* Section, const FString& Filename)
{
    FConfigFile* File = Find(Filename, 0);
    if(!File)
    {
        return false;
    }

    FConfigSection* Sec = File->Find(Section);
    if(!Sec)
    {
        return false;
    }

    for(FConfigSectionMap::TIterator It(*Sec); It; ++It)
    {
        Visitor.Execute(*It.Key().GetPlainNameString(), *It.Value());
    }

    return true;
}

Breaking down to this part: **Visitor.Execute(It.Key().GetPlainNameString(), It.Value());

Found this: DECLARE_DELEGATE_TwoParams(FKeyValueSink, const TCHAR, const TCHAR);**

And this: https://docs.unrealengine.com/latest/INT/Programming/UnrealArchitecture/Delegates/index.html

-Edit 1
I’m getting somewhere now:

I made a class:


class FGetFromIni
{
public:
	static void OnEntry(const TCHAR *Key, const TCHAR* Value)
	{
	}

	static TArray<FString> KeyAndValues;
};

And im calling:



TArray<FString> OMSPlugin::GetFromIni(FString Section)
{	
	GConfig->ForEachEntry(FKeyValueSink::CreateStatic(&FGetFromIni::OnEntry), *Section, GGameIni);
	
	return FGetFromIni::KeyAndValues;

Now I’m getting the error: error LNK2001: unresolved external symbol "public: static class TArray<class FString,class FDefaultAllocator> FGetFromIni::KeyAndValues"