本文整理汇总了C++中FString函数的典型用法代码示例。如果您正苦于以下问题:C++ FString函数的具体用法?C++ FString怎么用?C++ FString使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了FString函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: CopyFileToPublicStaging
bool CopyFileToPublicStaging(const FString& SourceFile)
{
FString IpaFilename = FPaths::GetCleanFilename(SourceFile);
return CopyFileToDevice(SourceFile, FString(TEXT("/PublicStaging/")) + IpaFilename, 1024*1024);
}
开发者ID:1vanK,项目名称:AHRUnrealEngine,代码行数:5,代码来源:IOSDeviceHelperMac.cpp
示例2: GetGraph
UK2Node::ERedirectType UK2Node::DoPinsMatchForReconstruction(const UEdGraphPin* NewPin, int32 NewPinIndex, const UEdGraphPin* OldPin, int32 OldPinIndex) const
{
ERedirectType RedirectType = ERedirectType_None;
// if the pin names do match
if (FCString::Stricmp(*(NewPin->PinName), *(OldPin->PinName)) == 0)
{
// Make sure we're not dealing with a menu node
UEdGraph* OuterGraph = GetGraph();
if( OuterGraph && OuterGraph->Schema )
{
const UEdGraphSchema_K2* K2Schema = Cast<const UEdGraphSchema_K2>(GetSchema());
if( !K2Schema || K2Schema->IsSelfPin(*NewPin) || K2Schema->ArePinTypesCompatible(OldPin->PinType, NewPin->PinType) )
{
RedirectType = ERedirectType_Name;
}
else
{
RedirectType = ERedirectType_None;
}
}
}
else
{
// try looking for a redirect if it's a K2 node
if (UK2Node* Node = Cast<UK2Node>(NewPin->GetOwningNode()))
{
if (OldPin->ParentPin == NULL)
{
// if you don't have matching pin, now check if there is any redirect param set
TArray<FString> OldPinNames;
GetRedirectPinNames(*OldPin, OldPinNames);
FName NewPinName;
RedirectType = ShouldRedirectParam(OldPinNames, /*out*/ NewPinName, Node);
// make sure they match
if ((RedirectType != ERedirectType_None) && FCString::Stricmp(*(NewPin->PinName), *(NewPinName.ToString())) != 0)
{
RedirectType = ERedirectType_None;
}
}
else
{
struct FPropertyDetails
{
const UEdGraphPin* Pin;
FString PropertyName;
FPropertyDetails(const UEdGraphPin* InPin, const FString& InPropertyName)
: Pin(InPin), PropertyName(InPropertyName)
{
}
};
TArray<FPropertyDetails> ParentHierarchy;
const UEdGraphPin* CurPin = OldPin;
do
{
ParentHierarchy.Add(FPropertyDetails(CurPin, CurPin->PinName.RightChop(CurPin->ParentPin->PinName.Len() + 1)));
CurPin = CurPin->ParentPin;
} while (CurPin->ParentPin);
// if you don't have matching pin, now check if there is any redirect param set
TArray<FString> OldPinNames;
GetRedirectPinNames(*CurPin, OldPinNames);
FString NewPinNameStr;
FName NewPinName;
RedirectType = ShouldRedirectParam(OldPinNames, /*out*/ NewPinName, Node);
NewPinNameStr = (RedirectType == ERedirectType_None ? CurPin->PinName : NewPinName.ToString());
for (int32 ParentIndex = ParentHierarchy.Num() - 1; ParentIndex >= 0; --ParentIndex)
{
const UEdGraphPin* CurPin = ParentHierarchy[ParentIndex].Pin;
const UEdGraphPin* ParentPin = CurPin->ParentPin;
TMap<FName, FName>* StructRedirects = UStruct::TaggedPropertyRedirects.Find(ParentPin->PinType.PinSubCategoryObject->GetFName());
if (StructRedirects)
{
FName* PropertyRedirect = StructRedirects->Find(FName(*ParentHierarchy[ParentIndex].PropertyName));
if (PropertyRedirect)
{
NewPinNameStr += FString("_") + PropertyRedirect->ToString();
}
else
{
NewPinNameStr += FString("_") + ParentHierarchy[ParentIndex].PropertyName;
}
}
else
{
NewPinNameStr += FString("_") + ParentHierarchy[ParentIndex].PropertyName;
}
}
// make sure they match
RedirectType = ((FCString::Stricmp(*(NewPin->PinName), *NewPinNameStr) != 0) ? ERedirectType_None : ERedirectType_Name);
}
//.........这里部分代码省略.........
开发者ID:1vanK,项目名称:AHRUnrealEngine,代码行数:101,代码来源:K2Node.cpp
示例3: TEXT
bool LocalizationCommandletTasks::ReportLoadedAudioAssets(const TArray<ULocalizationTarget*>& Targets, const TOptional<FString>& CultureName)
{
TSet<FString> LoadedDialogueWaveAssets;
TSet<FString> LoadedSoundWaveAssets;
for (const ULocalizationTarget* Target : Targets)
{
const FString RootAssetPath = Target->IsMemberOfEngineTargetSet() ? TEXT("/Engine") : TEXT("/Game");
TArray<FString> CulturesToTest;
{
if (CultureName.IsSet())
{
CulturesToTest.Add(CultureName.GetValue());
}
else
{
CulturesToTest.Reserve(Target->Settings.SupportedCulturesStatistics.Num());
for (const FCultureStatistics& CultureData : Target->Settings.SupportedCulturesStatistics)
{
CulturesToTest.Add(CultureData.CultureName);
}
}
}
TArray<FString> DialogueWavePathsToTest;
TArray<FString> SoundWavePathsToTest;
{
const FString NativeCulture = Target->Settings.SupportedCulturesStatistics.IsValidIndex(Target->Settings.NativeCultureIndex) ? Target->Settings.SupportedCulturesStatistics[Target->Settings.NativeCultureIndex].CultureName : FString();
const bool bImportNativeAsSource = Target->Settings.ImportDialogueSettings.bImportNativeAsSource && !NativeCulture.IsEmpty();
if (bImportNativeAsSource)
{
DialogueWavePathsToTest.Add(RootAssetPath);
SoundWavePathsToTest.Add(RootAssetPath / Target->Settings.ImportDialogueSettings.ImportedDialogueFolder);
}
for (const FString& Culture : CulturesToTest)
{
if (bImportNativeAsSource && Culture == NativeCulture)
{
continue;
}
DialogueWavePathsToTest.Add(RootAssetPath / TEXT("L10N") / Culture);
SoundWavePathsToTest.Add(RootAssetPath / TEXT("L10N") / Culture / Target->Settings.ImportDialogueSettings.ImportedDialogueFolder);
}
}
ForEachObjectOfClass(UDialogueWave::StaticClass(), [&](UObject* InObject)
{
const FString ObjectPath = InObject->GetPathName();
auto FindAssetPathPredicate = [&](const FString& InAssetPath) -> bool
{
return ObjectPath.StartsWith(InAssetPath, ESearchCase::IgnoreCase);
};
if (DialogueWavePathsToTest.ContainsByPredicate(FindAssetPathPredicate))
{
LoadedDialogueWaveAssets.Add(ObjectPath);
}
});
ForEachObjectOfClass(USoundWave::StaticClass(), [&](UObject* InObject)
{
const FString ObjectPath = InObject->GetPathName();
auto FindAssetPathPredicate = [&](const FString& InAssetPath) -> bool
{
return ObjectPath.StartsWith(InAssetPath, ESearchCase::IgnoreCase);
};
if (SoundWavePathsToTest.ContainsByPredicate(FindAssetPathPredicate))
{
LoadedSoundWaveAssets.Add(ObjectPath);
}
});
}
if (LoadedDialogueWaveAssets.Num() > 0 || LoadedSoundWaveAssets.Num() > 0)
{
FTextBuilder MsgBuilder;
MsgBuilder.AppendLine(LOCTEXT("Warning_LoadedAudioAssetsMsg", "The following audio assets have been loaded by the editor and may cause the dialogue import to fail as their files will be read-only."));
MsgBuilder.AppendLine(FText::GetEmpty());
MsgBuilder.AppendLine(LOCTEXT("Warning_LoadedAudioAssetsMsg_Continue", "Do you want to continue?"));
if (LoadedDialogueWaveAssets.Num() > 0)
{
MsgBuilder.AppendLine(FText::GetEmpty());
MsgBuilder.AppendLine(LOCTEXT("Warning_LoadedAudioAssetsMsg_DialogueWaves", "Dialogue Waves:"));
MsgBuilder.Indent();
for (const FString& LoadedDialogueWaveAsset : LoadedDialogueWaveAssets)
{
MsgBuilder.AppendLine(LoadedDialogueWaveAsset);
}
MsgBuilder.Unindent();
}
if (LoadedSoundWaveAssets.Num() > 0)
//.........这里部分代码省略.........
开发者ID:JustDo1989,项目名称:UnrealEngine4.11-HairWorks,代码行数:101,代码来源:LocalizationCommandletTasks.cpp
示例4: UE_LOG
FString UpdateManager::HelloWorld() {
UE_LOG(LogTemp, Log, TEXT("Hello, World"));
return FString("Hello, I'm Happy!");
}
开发者ID:jerusalemdax,项目名称:UE4Client,代码行数:4,代码来源:UpdateManager.cpp
示例5: return
FString FLiveEditorWizardBase::GetAdvanceButtonText() const
{
return (IsOnLastStep())? FString( TEXT("Finish") ) : FString( TEXT("Next") );
}
开发者ID:1vanK,项目名称:AHRUnrealEngine,代码行数:4,代码来源:LiveEditorWizardBase.cpp
示例6: UE_LOG_ONLINE
/**
* Create a search result from a server response
*
* @param ServerDetails Steam server details
*/
void FOnlineAsyncTaskSteamFindServerBase::ParseSearchResult(class gameserveritem_t* ServerDetails)
{
TSharedRef<FInternetAddr> ServerAddr = ISocketSubsystem::Get(PLATFORM_SOCKETSUBSYSTEM)->CreateInternetAddr();
ServerAddr->SetIp(ServerDetails->m_NetAdr.GetIP());
ServerAddr->SetPort(ServerDetails->m_NetAdr.GetConnectionPort());
int32 ServerQueryPort = ServerDetails->m_NetAdr.GetQueryPort();
UE_LOG_ONLINE(Warning, TEXT("Server response IP:%s"), *ServerAddr->ToString(false));
if (ServerDetails->m_bHadSuccessfulResponse)
{
FString GameTags(UTF8_TO_TCHAR(ServerDetails->m_szGameTags));
// Check for build compatibility
int32 ServerBuildId = 0;
int32 BuildUniqueId = GetBuildUniqueId();
TArray<FString> TagArray;
GameTags.ParseIntoArray(TagArray, TEXT(","), true);
if (TagArray.Num() > 0 && TagArray[0].StartsWith(STEAMKEY_BUILDUNIQUEID))
{
ServerBuildId = FCString::Atoi(*TagArray[0].Mid(ARRAY_COUNT(STEAMKEY_BUILDUNIQUEID)));
}
if (ServerBuildId != 0 && ServerBuildId == BuildUniqueId)
{
// Create a new pending search result
FPendingSearchResultSteam* NewPendingSearch = new (PendingSearchResults) FPendingSearchResultSteam(this);
NewPendingSearch->ServerId = FUniqueNetIdSteam(ServerDetails->m_steamID);
NewPendingSearch->HostAddr = ServerAddr;
// Fill search result members
FOnlineSessionSearchResult* NewSearchResult = &NewPendingSearch->PendingSearchResult;
NewSearchResult->PingInMs = FMath::Clamp(ServerDetails->m_nPing, 0, MAX_QUERY_PING);
// Fill session members
FOnlineSession* NewSession = &NewSearchResult->Session;
//NewSession->OwningUserId = ;
NewSession->OwningUserName = UTF8_TO_TCHAR(ServerDetails->GetName());
NewSession->NumOpenPublicConnections = ServerDetails->m_nMaxPlayers - ServerDetails->m_nPlayers;
NewSession->NumOpenPrivateConnections = 0;
// Fill session settings members
NewSession->SessionSettings.NumPublicConnections = ServerDetails->m_nMaxPlayers;
NewSession->SessionSettings.NumPrivateConnections = 0;
NewSession->SessionSettings.bAntiCheatProtected = ServerDetails->m_bSecure ? true : false;
NewSession->SessionSettings.Set(SETTING_MAPNAME, FString(UTF8_TO_TCHAR(ServerDetails->m_szMap)), EOnlineDataAdvertisementType::ViaOnlineService);
// Start a rules request for this new result
NewPendingSearch->ServerQueryHandle = SteamMatchmakingServersPtr->ServerRules(ServerDetails->m_NetAdr.GetIP(), ServerQueryPort, NewPendingSearch);
if (NewPendingSearch->ServerQueryHandle == HSERVERQUERY_INVALID)
{
// Remove the failed element
PendingSearchResults.RemoveAtSwap(PendingSearchResults.Num() - 1);
}
}
else
{
UE_LOG_ONLINE(Warning, TEXT("Removed incompatible build: ServerBuildUniqueId = 0x%08x, GetBuildUniqueId() = 0x%08x"),
ServerBuildId, BuildUniqueId);
}
}
}
开发者ID:RandomDeveloperM,项目名称:UE4_Hairworks,代码行数:70,代码来源:OnlineSessionAsyncServerSteam.cpp
示例7: FString
FString UBlackboardKeyType_NativeEnum::DescribeValue(const uint8* RawData) const
{
return EnumType ? EnumType->GetEnumName(GetValue(RawData)) : FString("UNKNOWN!");
}
开发者ID:1vanK,项目名称:AHRUnrealEngine,代码行数:4,代码来源:BlackboardKeyType_NativeEnum.cpp
示例8: MakeShareable
void FTODAssetPropertyDetails::CustomizeDetails(IDetailLayoutBuilder& DetailLayout)
{
const IDetailsView& DetailView = DetailLayout.GetDetailsView();
//first find asset we are going to edit.
TWeakObjectPtr<UObject> InspectedObject;
for (TWeakObjectPtr<UObject> inspObj : DetailView.GetSelectedObjects())
{
InspectedObject = inspObj;
break;
}
UTODAsset* TODAsset = Cast<UTODAsset>(InspectedObject.Get());
CurrentTODAsset = Cast<UTODAsset>(InspectedObject.Get());
if (TODAsset)
{
for (TFieldIterator<UProperty> PropIt(TODAsset->GetClass()); PropIt; ++PropIt)
{
UProperty* prop = *PropIt;
DetailLayout.HideProperty(prop->GetFName());
//PropertyHandles.Add(DetailLayout.GetProperty(prop->GetFName()));
UStructProperty* structProp = Cast<UStructProperty>(prop);
if (structProp)
{
FRuntimeFloatCurve* floatCurve = structProp->ContainerPtrToValuePtr<FRuntimeFloatCurve>(TODAsset);
if (floatCurve)
{
TSharedPtr<FTODFloatCurveProperty> tempFloatProp = MakeShareable(new FTODFloatCurveProperty());
tempFloatProp->PropertyHandle = DetailLayout.GetProperty(prop->GetFName());
tempFloatProp->TODAsset = TODAsset;
tempFloatProp->CategoryName = tempFloatProp->PropertyHandle->GetMetaData(TEXT("Category"));
FloatCurves.Add(tempFloatProp);
}
}
}
}
IDetailCategoryBuilder& DetailCategoryBuilder = DetailLayout.EditCategory("Property Detail");
FDetailWidgetRow& DetailRow = DetailCategoryBuilder.AddCustomRow(FString("Custom Row"));
////now customize each property
//FRuntimeFloatCurve* floatCurve;
TSharedPtr<IPropertyHandle> hour = DetailLayout.GetProperty(TEXT("Hour"));
DetailCategoryBuilder.AddProperty(hour);
IDetailCategoryBuilder& SunCategoryBuilder = DetailLayout.EditCategory("Sun");
IDetailCategoryBuilder& AFCategoryBuilder = DetailLayout.EditCategory("Atmospheric Fog");
IDetailCategoryBuilder& HFCategoryBuilder = DetailLayout.EditCategory("Height Fog");
IDetailCategoryBuilder& PPCategoryBuilder = DetailLayout.EditCategory("Post Process");
IDetailCategoryBuilder& SkyLightCategoryBuilder = DetailLayout.EditCategory("SkyLight");
IDetailCategoryBuilder& MoonCategoryBuilder = DetailLayout.EditCategory("Moon");
for (TSharedPtr<FTODFloatCurveProperty> floatCurves : FloatCurves)
{
if (floatCurves->CategoryName == FString("Sun"))
floatCurves->ConstructWidget(SunCategoryBuilder);
if (floatCurves->CategoryName == FString("Atmospheric Fog"))
floatCurves->ConstructWidget(AFCategoryBuilder);
if (floatCurves->CategoryName == FString("Height Fog"))
floatCurves->ConstructWidget(HFCategoryBuilder);
if (floatCurves->CategoryName == FString("Post Process"))
floatCurves->ConstructWidget(PPCategoryBuilder);
if (floatCurves->CategoryName == FString("SkyLight"))
floatCurves->ConstructWidget(SkyLightCategoryBuilder);
if (floatCurves->CategoryName == FString("Moon"))
floatCurves->ConstructWidget(MoonCategoryBuilder);
}
}
开发者ID:HyunhSo,项目名称:TimeOfDayPlugin,代码行数:72,代码来源:TODAssetPropertyDetails.cpp
示例9: MessageHandler
FOculusInput::FOculusInput( const TSharedRef< FGenericApplicationMessageHandler >& InMessageHandler )
: MessageHandler( InMessageHandler )
, ControllerPairs()
, TriggerThreshold(0.8f)
{
// Initializes LibOVR.
ovrInitParams initParams;
FMemory::Memset(initParams, 0);
initParams.Flags = ovrInit_RequestVersion;
initParams.RequestedMinorVersion = OVR_MINOR_VERSION;
#if !UE_BUILD_SHIPPING
// initParams.LogCallback = OvrLogCallback;
#endif
ovrResult initStatus = ovr_Initialize(&initParams);
if (!OVR_SUCCESS(initStatus) && initStatus == ovrError_LibLoad)
{
// fatal errors: can't load library
UE_LOG(LogOcInput, Log, TEXT("Can't find Oculus library %s: is proper Runtime installed? Version: %s"),
TEXT(OVR_FILE_DESCRIPTION_STRING), TEXT(OVR_VERSION_STRING));
return;
}
FOculusTouchControllerPair& ControllerPair = *new(ControllerPairs) FOculusTouchControllerPair();
// @todo: Unreal controller index should be assigned to us by the engine to ensure we don't contest with other devices
ControllerPair.UnrealControllerIndex = 0; //???? NextUnrealControllerIndex++;
// Load the config, even if we failed to initialize a controller
LoadConfig();
IModularFeatures::Get().RegisterModularFeature( GetModularFeatureName(), this );
GEngine->MotionControllerDevices.AddUnique(this);
// Register the FKeys
EKeys::AddKey(FKeyDetails(FOculusTouchCapacitiveKey::OculusTouch_Left_Thumbstick, LOCTEXT("OculusTouch_Left_Thumbstick", "Oculus Touch (L) Thumbstick CapTouch"), FKeyDetails::GamepadKey | FKeyDetails::FloatAxis));
EKeys::AddKey(FKeyDetails(FOculusTouchCapacitiveKey::OculusTouch_Left_FaceButton1, LOCTEXT("OculusTouch_Left_FaceButton1", "Oculus Touch (L) X Button CapTouch"), FKeyDetails::GamepadKey | FKeyDetails::FloatAxis));
EKeys::AddKey(FKeyDetails(FOculusTouchCapacitiveKey::OculusTouch_Left_Trigger, LOCTEXT("OculusTouch_Left_Trigger", "Oculus Touch (L) Trigger CapTouch"), FKeyDetails::GamepadKey | FKeyDetails::FloatAxis));
EKeys::AddKey(FKeyDetails(FOculusTouchCapacitiveKey::OculusTouch_Left_FaceButton2, LOCTEXT("OculusTouch_Left_FaceButton2", "Oculus Touch (L) Y Button CapTouch"), FKeyDetails::GamepadKey | FKeyDetails::FloatAxis));
EKeys::AddKey(FKeyDetails(FOculusTouchCapacitiveKey::OculusTouch_Left_IndexPointing, LOCTEXT("OculusTouch_Left_IndexPointing", "Oculus Touch (L) Pointing CapTouch"), FKeyDetails::GamepadKey | FKeyDetails::FloatAxis));
EKeys::AddKey(FKeyDetails(FOculusTouchCapacitiveKey::OculusTouch_Left_ThumbUp, LOCTEXT("OculusTouch_Left_ThumbUp", "Oculus Touch (L) Thumb Up CapTouch"), FKeyDetails::GamepadKey | FKeyDetails::FloatAxis));
EKeys::AddKey(FKeyDetails(FOculusTouchCapacitiveKey::OculusTouch_Right_Thumbstick, LOCTEXT("OculusTouch_Right_Thumbstick", "Oculus Touch (R) Thumbstick CapTouch"), FKeyDetails::GamepadKey | FKeyDetails::FloatAxis));
EKeys::AddKey(FKeyDetails(FOculusTouchCapacitiveKey::OculusTouch_Right_FaceButton1, LOCTEXT("OculusTouch_Right_FaceButton1", "Oculus Touch (R) A Button CapTouch"), FKeyDetails::GamepadKey | FKeyDetails::FloatAxis));
EKeys::AddKey(FKeyDetails(FOculusTouchCapacitiveKey::OculusTouch_Right_Trigger, LOCTEXT("OculusTouch_Right_Trigger", "Oculus Touch (R) Trigger CapTouch"), FKeyDetails::GamepadKey | FKeyDetails::FloatAxis));
EKeys::AddKey(FKeyDetails(FOculusTouchCapacitiveKey::OculusTouch_Right_FaceButton2, LOCTEXT("OculusTouch_Right_FaceButton2", "Oculus Touch (R) B Button CapTouch"), FKeyDetails::GamepadKey | FKeyDetails::FloatAxis));
EKeys::AddKey(FKeyDetails(FOculusTouchCapacitiveKey::OculusTouch_Right_IndexPointing, LOCTEXT("OculusTouch_Right_IndexPointing", "Oculus Touch (R) Pointing CapTouch"), FKeyDetails::GamepadKey | FKeyDetails::FloatAxis));
EKeys::AddKey(FKeyDetails(FOculusTouchCapacitiveKey::OculusTouch_Right_ThumbUp, LOCTEXT("OculusTouch_Right_ThumbUp", "Oculus Touch (R) Thumb Up CapTouch"), FKeyDetails::GamepadKey | FKeyDetails::FloatAxis));
UE_LOG(LogOcInput, Log, TEXT("OculusInput is initialized. Init status %d. Runtime version: %s"), int(initStatus), *FString(ANSI_TO_TCHAR(ovr_GetVersionString())));
}
开发者ID:ErwinT6,项目名称:T6Engine,代码行数:51,代码来源:OculusInput.cpp
示例10: cstr
//Rama's String From Binary Array
//This function requires #include <string>
FString CloudyWebAPIImpl::StringFromBinaryArray(const TArray<uint8>& BinaryArray)
{
//Create a string from a byte array!
std::string cstr(reinterpret_cast<const char*>(BinaryArray.GetData()), BinaryArray.Num());
return FString(cstr.c_str());
}
开发者ID:9gix,项目名称:CloudyGamePlugin,代码行数:8,代码来源:CloudyWebAPI.cpp
示例11: TestBasicStringExpression
virtual bool TestBasicStringExpression(const FTextFilterString& InValue, const ETextFilterTextComparisonMode InTextComparisonMode) const override
{
const TCHAR* Ptr = AssetFullPath.GetCharArray().GetData();
if (Ptr)
{
// Test each piece of the path name, apart from the first
bool bIsFirst = true;
while (const TCHAR* Delimiter = FCString::Strchr(Ptr, '/'))
{
const int32 Length = Delimiter - Ptr;
if (Length > 0)
{
if (bIsFirst)
{
bIsFirst = false;
}
else
{
if (TextFilterUtils::TestBasicStringExpression(FString(Length, Ptr), InValue, InTextComparisonMode))
{
return true;
}
}
}
Ptr += (Length + 1);
}
if (*Ptr != 0)
{
if (TextFilterUtils::TestBasicStringExpression(Ptr, InValue, InTextComparisonMode))
{
return true;
}
}
}
if (bIncludeClassName)
{
if (TextFilterUtils::TestBasicStringExpression(AssetPtr->AssetClass, InValue, InTextComparisonMode))
{
return true;
}
// Only test this if we're searching the class name too, as the exported text contains the type in the string
if (TextFilterUtils::TestBasicStringExpression(AssetExportTextName, InValue, InTextComparisonMode))
{
return true;
}
}
for (const FName& AssetCollectionName : AssetCollectionNames)
{
if (TextFilterUtils::TestBasicStringExpression(AssetCollectionName, InValue, InTextComparisonMode))
{
return true;
}
}
return false;
}
开发者ID:PickUpSU,项目名称:UnrealEngine4,代码行数:62,代码来源:FrontendFilters.cpp
示例12: check
void FDirectoryWatchRequestWindows::ProcessChange(uint32 Error, uint32 NumBytes)
{
if (Error == ERROR_OPERATION_ABORTED || NumBytes == 0 )
{
// The operation was aborted, likely due to EndWatchRequest canceling it.
// Mark the request for delete so it can be cleaned up next tick.
bPendingDelete = true;
return;
}
bool bValidNotification = (Error != ERROR_OPERATION_ABORTED && Error != ERROR_IO_INCOMPLETE && NumBytes > 0 );
// Copy the change to the backbuffer so we can start a new read as soon as possible
if ( bValidNotification )
{
check(BackBuffer);
FMemory::Memcpy(BackBuffer, Buffer, NumBytes);
}
// Start up another read
const bool bSuccess = !!::ReadDirectoryChangesW(
DirectoryHandle,
Buffer,
BufferLength,
bWatchSubtree,
NotifyFilter,
NULL,
&Overlapped,
&FDirectoryWatchRequestWindows::ChangeNotification);
if ( !bValidNotification )
{
UE_LOG(LogDirectoryWatcher, Warning, TEXT("A directory notification failed for '%s' because it was aborted or there was a buffer overflow."), *Directory);
return;
}
// No need to process the change if we can not execute any delegates
if ( !HasDelegates() )
{
return;
}
// Process the change
uint8* InfoBase = BackBuffer;
do
{
FILE_NOTIFY_INFORMATION* NotifyInfo = (FILE_NOTIFY_INFORMATION*)InfoBase;
// Copy the WCHAR out of the NotifyInfo so we can put a NULL terminator on it and convert it to a FString
const int32 Len = NotifyInfo->FileNameLength / sizeof(WCHAR);
WCHAR* RawFilename = new WCHAR[Len + 1];
FMemory::Memcpy(RawFilename, NotifyInfo->FileName, NotifyInfo->FileNameLength);
RawFilename[Len] = 0;
FFileChangeData::EFileChangeAction Action;
switch(NotifyInfo->Action)
{
case FILE_ACTION_ADDED:
case FILE_ACTION_RENAMED_NEW_NAME:
Action = FFileChangeData::FCA_Added;
break;
case FILE_ACTION_REMOVED:
case FILE_ACTION_RENAMED_OLD_NAME:
Action = FFileChangeData::FCA_Removed;
break;
case FILE_ACTION_MODIFIED:
Action = FFileChangeData::FCA_Modified;
break;
default:
Action = FFileChangeData::FCA_Unknown;
break;
}
// WCHAR to TCHAR conversion. In windows this is probably okay.
const FString Filename = Directory / FString(RawFilename);
new (FileChanges) FFileChangeData(Filename, Action);
// Delete the scratch WCHAR*
delete[] RawFilename;
// If there is not another entry, break the loop
if ( NotifyInfo->NextEntryOffset == 0 )
{
break;
}
// Adjust the offset and update the NotifyInfo pointer
InfoBase += NotifyInfo->NextEntryOffset;
}
while(true);
}
开发者ID:JustDo1989,项目名称:UnrealEngine4.11-HairWorks,代码行数:94,代码来源:DirectoryWatchRequestWindows.cpp
示例13: return
FString UKismetStringLibrary::Conv_ObjectToString(class UObject* InObj)
{
return (InObj != NULL) ? InObj->GetName() : FString(TEXT("None"));
}
开发者ID:kidaa,项目名称:UnrealEngineVR,代码行数:4,代码来源:KismetStringLibrary.cpp
示例14: ifile
int CSVParser::ReadPropertyDataCSV(const char* FileName, Utils::FHashMap<SongDetails>& OutputMap, bool FirstRowDiscarded, char elem_delim, char row_delim)
{
int lineNumber = 0;
std::string line, linetoken;
std::ifstream ifile(FileName);
if (!ifile) { //file can't be opened
return -1;
}
/* before going on I want to point out one thing:
* I HATE std::getline
* and obviously std::getline hates me.
* It is important you remember that
* if you touch std::getline code
* std::getline will take its revenge on you. */
if (FirstRowDiscarded)
{
if (!std::getline(ifile, line, row_delim))
return 0;
}
while (std::getline(ifile, line, row_delim))
{
#ifdef DEBUG_CSV_CONTENT
UE_LOG(LogTemp, Log, TEXT("new line: \n%s\ntokenized as"), *FString(line.c_str()));
//DEBUG(line.c_str())
#endif
std::istringstream str_parser;
bool found = false;
str_parser.str(line);
TArray<FString> SeparatedLine = TArray<FString>();
FString ElementID; //first column is Element ID.
FString DimensionID = ""; //second column is Dimension ID
std::getline(str_parser, linetoken, elem_delim);
ElementID = Utils::CustomUnquote(FString(linetoken.c_str()));
try {
OutputMap.at(ElementID);
found = true;
}
catch (std::out_of_range e) {
found = false;
}
if (found) { //if failed to load line, jump to next line
FSongProperty property;
std::getline(str_parser, linetoken, elem_delim);
DimensionID = Utils::CustomUnquote(FString(linetoken.c_str()));
while (std::getline(str_parser, linetoken, elem_delim)) { //from third element to end of line
SeparatedLine.Add(Utils::CustomUnquote(FString(linetoken.c_str()))); //append
#ifdef DEBUG_CSV_CONTENT
UE_LOG(LogTemp, Log, TEXT("%s"), *Utils::CustomUnquote(FString(linetoken.c_str())));
//DEBUG(linetoken.c_str())
#endif
}
property << SeparatedLine;
if (DimensionID.Len() > 0)
{
OutputMap[ElementID].Properties[DimensionID] = property;
}
lineNumber++;
}
#ifdef DEBUG_CSV_CONTENT
UE_LOG(LogTemp, Log, TEXT(" . . . . . . ."));
#endif
}
ifile.close();
return lineNumber;
}
开发者ID:skeru,项目名称:ambif,代码行数:66,代码来源:CSVParser.cpp
示例15: TEXT
/** Create a tokenized message record from a message containing @@ indicating where each UObject* in the ArgPtr list goes and place it in the MessageLog. */
void FCompilerResultsLog::InternalLogMessage(const EMessageSeverity::Type& Severity, const TCHAR* Message, va_list ArgPtr)
{
UEdGraphNode* OwnerNode = nullptr;
// Create the tokenized message
TSharedRef<FTokenizedMessage> Line = FTokenizedMessage::Create( Severity );
Messages.Add(Line);
const TCHAR* DelimiterStr = TEXT("@@");
int32 DelimLength = FCString::Strlen(DelimiterStr);
const TCHAR* Start = Message;
if (Start && DelimLength)
{
while (const TCHAR* At = FCString::Strstr(Start, DelimiterStr))
{
// Found a delimiter, create a token from the preceding text
Line->AddToken( FTextToken::Create( FText::FromString( FString(At - Start, Start) ) ) );
Start += DelimLength + (At - Start);
// And read the object and add another token for the object
UObject* ObjectArgument = va_arg(ArgPtr, UObject*);
FText ObjText;
if (ObjectArgument)
{
// Remap object references to the source nodes
ObjectArgument = FindSourceObject(ObjectArgument);
if (ObjectArgument)
{
UEdGraphNode* Node = Cast<UEdGraphNode>(ObjectArgument);
const UEdGraphPin* Pin = (Node? nullptr : Cast<UEdGraphPin>(ObjectArgument));
//Get owner node reference, consider the first
if (OwnerNode == nullptr)
{
OwnerNode = (Pin ? Pin->GetOwningNodeUnchecked() : Node);
}
if (ObjectArgument->GetOutermost() == GetTransientPackage())
{
ObjText = LOCTEXT("Transient", "(transient)");
}
else if (Node != NULL)
{
ObjText = Node->GetNodeTitle(ENodeTitleType::ListView);
}
else if (Pin != NULL)
{
ObjText = Pin->GetDisplayName();
}
else
{
ObjText = FText::FromString( ObjectArgument->GetName() );
}
}
else
{
ObjText = LOCTEXT("None", "(none)");
}
}
else
{
ObjText = LOCTEXT("None", "(none)");
}
Line->AddToken( FUObjectToken::Create( ObjectArgument, ObjText ) );
}
Line->AddToken( FTextToken::Create( FText::FromString( Start ) ) );
}
va_end(ArgPtr);
// Register node error/warning.
AnnotateNode(OwnerNode, Line);
if( !bSilentMode && (!bLogInfoOnly || (Severity == EMessageSeverity::Info)) )
{
if(Severity == EMessageSeverity::CriticalError || Severity == EMessageSeverity::Error)
{
UE_LOG(LogBlueprint, Error, TEXT("[compiler] %s"), *Line->ToText().ToString());
}
else if(Severity == EMessageSeverity::Warning || Severity == EMessageSeverity::PerformanceWarning)
{
UE_LOG(LogBlueprint, Warning, TEXT("[compiler] %s"), *Line->ToText().ToString());
}
else
{
UE_LOG(LogBlueprint, Log, TEXT("[compiler] %s"), *Line->ToText().ToString());
}
}
}
开发者ID:Codermay,项目名称:Unreal4,代码行数:95,代码来源:CompilerResultsLog.cpp
示例16: OnScreenResolutionChange
void AKUIInterface::Render( UCanvas* oCanvas )
{
if ( !bShowHUD )
return;
if ( GEngine != NULL && GEngine->GameViewport != NULL )
{
// Update the screen res.
FVector2D v2ScreenResolution = FVector2D::ZeroVector;
GEngine->GameViewport->GetViewportSize( v2ScreenResolution );
if ( !this->v2ScreenResolution.Equals( v2ScreenResolution, 0.5f ) )
OnScreenResolutionChange( this->v2ScreenResolution, v2ScreenResolution );
this->v2ScreenResolution = v2ScreenResolution;
if ( this->v2CursorLocation.X == KUI_INTERFACE_FIRST_CURSOR_UPDATE )
this->v2CursorLocation = FVector2D( floor( this->v2ScreenResolution.X / 2.f ), floor( this->v2ScreenResolution.Y / 2.f ) );
}
if ( !IsTemplate() )
OnRenderBP( Canvas );
#if KUI_INTERFACE_MOUSEOVER_DEBUG
cmDebugMouseOver = NULL;
v2DebugMouseOverLocation = FVector2D::ZeroVector;
v2DebugMouseOverSize = FVector2D::ZeroVector;
#endif // KUI_INTERFACE_MOUSEOVER_DEBUG
if ( IsVisible() )
{
for ( int32 i = 0; i < ctRootContainers.Num(); ++i )
{
if ( ctRootContainers[ i ] == NULL )
continue;
if ( i == EKUIInterfaceRoot::R_Cursor )
continue;
#if KUI_INTERFACE_MOUSEOVER_DEBUG
bDebugMouseOver = arDebugMouseOver[ i ];
#endif // KUI_INTERFACE_MOUSEOVER_DEBUG
ctRootContainers[ i ]->Render( this, oCanvas, FVector2D::ZeroVector );
}
}
if ( IsCursorVisible() )
{
#if KUI_INTERFACE_MOUSEOVER_DEBUG
bDebugMouseOver = arDebugMouseOver[ EKUIInterfaceRoot::R_Cursor ];
#endif // KUI_INTERFACE_MOUSEOVER_DEBUG
ctRootContainers[ EKUIInterfaceRoot::R_Cursor ]->Render( this, oCanvas, v2CursorLocation );
}
#if KUI_INTERFACE_MOUSEOVER_DEBUG
bDebugMouseOver = false;
if ( cmDebugMouseOver.IsValid() )
{
cmDebugMouseOverTestBox->SetLocationStruct( v2DebugMouseOverLocation + FVector2D( 1.f, 1.f ) );
cmDebugMouseOverTestBox->SetSizeStruct( v2DebugMouseOverSize - FVector2D( 1.f, 1.f ) );
cmDebugMouseOverTestBox->Render( this, oCanvas, FVector2D::ZeroVector, NULL );
}
if ( cmDebugMouseOver.Get() != cmDebugMouseOverLastTick.Get() )
{
KUILogUO(
"UI Mouse Over: %s: %s -> %s: %s (%f,%f) -> (%f,%f)",
*( cmDebugMouseOverLastTick.Get() ? ( cmDebugMouseOverLastTick.Get()->GetOuter() ? cmDebugMouseOverLastTick.Get()->GetOuter()->GetName() : "NULL" ) : "NULL" ),
*( cmDebugMouseOverLastTick.Get() ? cmDebugMouseOverLastTick->GetName() : FString( "NULL" ) ),
*( cmDebugMouseOver.Get() ? ( cmDebugMouseOver.Get()->GetOuter() ? cmDebugMouseOver.Get()->GetOuter()->GetName() : "NULL" ) : "NULL" ),
*( cmDebugMouseOver.Get() ? cmDebugMouseOver->GetName() : FString( "NULL" ) ),
ExpandV2( v2DebugMouseOverLocation ),
ExpandV2( v2DebugMouseOverSize )
);
}
cmDebugMouseOverLastTick = cmDebugMouseOver.Get();
#endif // KUI_INTERFACE_MOUSEOVER_DEBUG
}
开发者ID:mrG7,项目名称:KeshUI,代码行数:80,代码来源:KUIInterface.cpp
示例17: CheckExitConditions
/** Called in the idle loop, checks for conditions under which the helper should exit */
void CheckExitConditions()
{
if (!InputFilename.Contains(TEXT("Only")))
{
UE_LOG(LogShaders, Log, TEXT("InputFilename did not contain 'Only', exiting after one job."));
FPlatformMisc::RequestExit(false);
}
#if PLATFORM_MAC || PLATFORM_LINUX
if (!FPlatformMisc::IsDebuggerPresent() && ParentProcessId > 0)
{
// If the parent process is no longer running, exit
if (!FPlatformProcess::IsApplicationRunning(ParentProcessId))
{
FString FilePath = FString(WorkingDirectory) + InputFilename;
checkf(IFileManager::Get().FileSize(*FilePath) == INDEX_NONE, TEXT("Exiting due to the parent process no longer running and the input file is present!"));
UE_LOG(LogShaders, Log, TEXT("Parent process no longer running, exiting"));
FPlatformMisc::RequestExit(false);
}
}
const double CurrentTime = FPlatformTime::Seconds();
// If we have been idle for 20 seconds then exit
if (CurrentTime - LastCompileTime > 20.0)
{
UE_LOG(LogShaders, Log, TEXT("No jobs found for 20 seconds, exiting"));
FPlatformMisc::RequestExit(false);
}
#else
// Don't do these if the debugger is present
//@todo - don't do these if Unreal is being debugged either
if (!IsDebuggerPresent())
{
if (ParentProcessId > 0)
{
FString FilePath = FString(WorkingDirectory) + InputFilename;
bool bParentStillRunning = true;
HANDLE ParentProcessHandle = OpenProcess(SYNCHRONIZE, false, ParentProcessId);
// If we couldn't open the process then it is no longer running, exit
if (ParentProcessHandle == nullptr)
{
checkf(IFileManager::Get().FileSize(*FilePath) == INDEX_NONE, TEXT("Exiting due to OpenProcess(ParentProcessId) failing and the input file is present!"));
UE_LOG(LogShaders, Log, TEXT("Couldn't OpenProcess, Parent process no longer running, exiting"));
FPlatformMisc::RequestExit(false);
}
else
{
// If we did open the process, that doesn't mean it is still running
// The process object stays alive as long as there are handles to it
// We need to check if the process has signaled, which indicates that it has exited
uint32 WaitResult = WaitForSingleObject(ParentProcessHandle, 0);
if (WaitResult != WAIT_TIMEOUT)
{
checkf(IFileManager::Get().FileSize(*FilePath) == INDEX_NONE, TEXT("Exiting due to WaitForSingleObject(ParentProcessHandle) signaling and the input file is present!"));
UE_LOG(LogShaders, Log, TEXT("WaitForSingleObject signaled, Parent process no longer running, exiting"));
FPlatformMisc::RequestExit(false);
}
CloseHandle(ParentProcessHandle);
}
}
const double CurrentTime = FPlatformTime::Seconds();
// If we have been idle for 20 seconds then exit
if (CurrentTime - LastCompileTime > 20.0)
{
UE_LOG(LogShaders, Log, TEXT("No jobs found for 20 seconds, exiting"));
FPlatformMisc::RequestExit(false);
}
}
#endif
}
开发者ID:colwalder,项目名称:unrealengine,代码行数:73,代码来源:ShaderCompileWorker.cpp
示例18: FCultureEnumeratorVistor
void FEditorStyleSettingsDetails::RefreshAvailableCultures()
{
AvailableCultures.Empty();
IPlatformFile& PlatformFile = IPlatformFile::GetPlatformPhysical();
TArray<FString> AllCultureNames;
FInternationalization::GetCultureNames(AllCultureNames);
const TArray<FString> LocalizationPaths = FPaths::GetEditorLocalizationPaths();
for(const auto& LocalizationPath : LocalizationPaths)
{
/* Visitor class used to enumerate directories of culture */
class FCultureEnumeratorVistor : public IPlatformFile::FDirectoryVisitor
{
public:
FCultureEnumeratorVistor( const TArray<FString>& InAllCultureNames, TArray< TSharedPtr<FCulture> >& InAvailableCultures )
: AllCultureNames(InAllCultureNames)
, AvailableCultures(InAvailableCultures)
{
}
virtual bool Visit(const TCHAR* FilenameOrDirectory, bool bIsDirectory) OVERRIDE
{
if(bIsDirectory)
{
for( const auto& CultureName : AllCultureNames )
{
TSharedPtr<FCulture> Culture = FInternationalization::GetCulture(CultureName);
if(Culture.IsValid() && !AvailableCultures.Contains(Culture))
{
// UE localization resource folders use "en-US" style while ICU uses "en_US" style so we replace underscores with dashes here.
const FString UnrealCultureName = FString(TEXT("/")) + CultureName.Replace(TEXT("_"), TEXT("-"));
if(FString(FilenameOrDirectory).EndsWith(UnrealCultureName))
{
AvailableCultures.Add(Culture);
}
else
{
// If the full name doesn't match, see if the base language is present
const FString CultureLanguageName = FString(TEXT("/")) + Culture->GetTwoLetterISOLanguageName();
if(FString(FilenameOrDirectory).EndsWith(CultureLanguageName))
{
AvailableCultures.Add(Culture);
}
}
}
}
}
return true;
}
/** Array of all culture names we can use */
const TArray<FString>& AllCultureNames;
/** Array of cultures that are available */
TArray< TSharedPtr<FCulture> >& AvailableCultures;
};
FCultureEnumeratorVistor CultureEnumeratorVistor(AllCultureNames, AvailableCultures);
PlatformFile.IterateDirectory(*LocalizationPath, CultureEnumeratorVistor);
}
开发者ID:Tigrouzen,项目名称:UnrealEngine-4,代码行数:61,代码来源:EditorStyleSettingsDetails.cpp
示例19: FString
void SCreateBlueprintFromActorDialog::Construct( const FArguments& InArgs, TSharedPtr< SWindow > InParentWindow, bool bInHarvest )
{
USelection::SelectionChangedEvent.AddRaw(this, &SCreateBlueprintFromActorDialog::OnLevelSelectionChanged);
bIsReportingError = false;
PathForActorBlueprint =
|
请发表评论