本文整理汇总了C++中FString::Append方法的典型用法代码示例。如果您正苦于以下问题:C++ FString::Append方法的具体用法?C++ FString::Append怎么用?C++ FString::Append使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FString
的用法示例。
在下文中一共展示了FString::Append方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: InternalLogEvent
void FCompilerResultsLog::InternalLogEvent(const FCompilerEvent& InEvent, int32 InDepth)
{
const int EventTimeMs = (int)((InEvent.FinishTime - InEvent.StartTime) * 1000);
if(EventTimeMs >= EventDisplayThresholdMs)
{
// Skip display of the top-most event since that time has already been logged
if(InDepth > 0)
{
FString EventString = FString::Printf(TEXT("- %s"), *InEvent.Name);
if(InEvent.Counter > 0)
{
EventString.Append(FString::Printf(TEXT(" (%d)"), InEvent.Counter + 1));
}
FFormatNamedArguments Args;
Args.Add(TEXT("EventTimeMs"), EventTimeMs);
EventString.Append(FText::Format(LOCTEXT("PerformanceSummaryEventTime", " [{EventTimeMs} ms]"), Args).ToString());
FString IndentString = FString::Printf(TEXT("%*s"), (InDepth - 1) << 1, TEXT(""));
Note(*FString::Printf(TEXT("%s%s"), *IndentString, *EventString));
}
const int32 NumChildEvents = InEvent.ChildEvents.Num();
for(int32 i = 0; i < NumChildEvents; ++i)
{
InternalLogEvent(InEvent.ChildEvents[i].Get(), InDepth + 1);
}
}
}
示例2: GetCulturesText
FText SLocalizationDashboardTargetRow::GetCulturesText() const
{
FLocalizationTargetSettings* const TargetSettings = GetTargetSettings();
if (TargetSettings)
{
TArray<FString> OrderedCultureNames;
OrderedCultureNames.Add(TargetSettings->NativeCultureStatistics.CultureName);
for (auto& ForeignCultureStatistics : TargetSettings->SupportedCulturesStatistics)
{
OrderedCultureNames.Add(ForeignCultureStatistics.CultureName);
}
FString Result;
for (FString& CultureName : OrderedCultureNames)
{
const FCulturePtr Culture = FInternationalization::Get().GetCulture(CultureName);
if (Culture.IsValid())
{
const FString CultureDisplayName = Culture->GetDisplayName();
if (!Result.IsEmpty())
{
Result.Append(TEXT(", "));
}
Result.Append(CultureDisplayName);
}
}
return FText::FromString(Result);
}
return FText::GetEmpty();
}
示例3: OnLoadConfig
void UCompositionGraphCaptureSettings::OnLoadConfig(FMovieSceneCaptureSettings& InSettings)
{
// Add .{frame} if it doesn't already exist
FString OutputFormat = InSettings.OutputFormat;
if (!OutputFormat.Contains(TEXT("{frame}")))
{
OutputFormat.Append(TEXT(".{frame}"));
InSettings.OutputFormat = OutputFormat;
}
// Add {material} if it doesn't already exist
if (!OutputFormat.Contains(TEXT("{material}")))
{
int32 FramePosition = OutputFormat.Find(TEXT(".{frame}"));
if (FramePosition != INDEX_NONE)
{
OutputFormat.InsertAt(FramePosition, TEXT("{material}"));
}
else
{
OutputFormat.Append(TEXT("{material}"));
}
InSettings.OutputFormat = OutputFormat;
}
Super::OnLoadConfig(InSettings);
}
示例4: GetRemoteStorage
/**
* Create path symbol path.
* Reference: https://msdn.microsoft.com/en-us/library/ms681416%28v=vs.85%29.aspx?f=255&MSPPError=-2147217396
*/
static FString GetRemoteStorage(const FString& DownstreamStorage)
{
TArray<FString> RemoteStorage;
GConfig->GetArray(CrashReporterSettings, TEXT("RemoteStorage"), RemoteStorage, GEditorPerProjectIni);
if (RemoteStorage.Num() > 0)
{
FString SymbolStorage;
for (int StorageIndex = 0; StorageIndex < RemoteStorage.Num(); ++StorageIndex)
{
if (StorageIndex > 0)
{
SymbolStorage.AppendChar(';');
}
SymbolStorage.Append(TEXT("SRV*"));
SymbolStorage.Append(DownstreamStorage);
SymbolStorage.AppendChar('*');
SymbolStorage.Append(RemoteStorage[StorageIndex]);
}
return SymbolStorage;
}
else
{
return FString();
}
}
示例5: GetDialogText
FString AProtherer::GetDialogText(FString* text)
{
FString* retVal = new FString("");
retVal->Append(*this->OrcName);
retVal->Append(*text);
return *retVal;
}
示例6: JoinStringsWithNewlines
FString UStringUtilities::JoinStringsWithNewlines(TArray<FString> strings) {
FString result;
for ( auto Itr(strings.CreateIterator()); Itr; Itr++ ) {
result.Append(*Itr);
if ( Itr + 1 ) {
result.Append("\n");
}
}
return result;
}
示例7: AppendToString
void AppendToString(const FStringFormatArg& Arg, FString& StringToAppendTo)
{
switch(Arg.Type)
{
case FStringFormatArg::Int: StringToAppendTo.Append(LexicalConversion::ToString(Arg.IntValue)); break;
case FStringFormatArg::UInt: StringToAppendTo.Append(LexicalConversion::ToString(Arg.UIntValue)); break;
case FStringFormatArg::Double: StringToAppendTo.Append(LexicalConversion::ToString(Arg.DoubleValue)); break;
case FStringFormatArg::String: StringToAppendTo.AppendChars(*Arg.StringValue, Arg.StringValue.Len()); break;
case FStringFormatArg::StringLiteral: StringToAppendTo += Arg.StringLiteralValue; break;
}
}
示例8: AddPlaylistItem
HRESULT FMediaPlayerVLC_Ex::AddPlaylistItem(const tchar* pFileName, IMediaOptions* pOptions)
{
if (!m_pPlaylist)
return E_FAIL;
USES_CONVERSION;
long pos = 0;
LPSAFEARRAY pSA = SafeArrayCreateVector(VT_VARIANT, 0, 1);
if (pOptions->m_Vout == "")
{
//If GetWindowsVersion() == WindowsVista => "direct3d"
//else "directx";
pOptions->m_Vout = "direct3d";
}
FString StrVout;
StrVout.Format(":vout=%s;", pOptions->m_Vout);
FString Options = StrVout;
m_bHasSubs = TRUE;
if (pOptions->m_SubPath.GetLength() > 0)
{
Options.Append(";:sub-file: ");
Options.Append(pOptions->m_SubPath);
}
Options.Append(";:sub-autodetect-file;:sub-autodetect-fuzzy:3;");
if (pOptions->rtOffset > 0)
{
FString StartTime;
StartTime.Format(";:start-time:%d;", pOptions->rtOffset / 1000);
Options.Append(StartTime);
}
_variant_t var(_bstr_t(T2OLE(Options)));
SafeArrayPutElement(pSA, &pos, (void FAR *)&var);
_variant_t v;
v.parray = pSA;
v.vt = VT_ARRAY;
CComVariant vtName = L"LTV_Video";
BSTR bStrName = SysAllocString(T2OLE(pFileName));
long lId = 0;
m_pPlaylist->get_itemCount(&lId);
return m_pPlaylist->add(bStrName, vtName, v, &lId);
}
示例9: PrintPath
void AProtherer::PrintPath(TArray<AWaypoint*> path)
{
FString* text = new FString("Printing Path with ");
text->AppendInt(path.Num());
text->Append(" hops: ");
for (int i = 0; i < path.Num(); ++i)
{
text->Append(path[i]->Name);
text->Append(", ");
}
sayDialog(text);
}
示例10: GetNextWaypoint
AWaypoint* AProtherer::GetNextWaypoint()
{
AWaypoint* predictedLocation = PredictPlayerPosition();
AWaypoint* nextWaypoint;
FString* text;
if (predictedLocation)
{
//this->sayDialog(new FString("Found Predicted Location."));
if (CanSeePlayer)
{
nextWaypoint = NextWaypointTowards(predictedLocation);
CanSeePlayer = false;
}
else
{
nextWaypoint = NextWaypointTowards(PredictedDestinationFor(predictedLocation));
}
if (nextWaypoint)
return nextWaypoint;
text = new FString("Error Condition: Moving to Predicted Waypoint - ");
text->Append(predictedLocation->Name);
this->sayDialog(text);
return predictedLocation;
}
this->sayDialog(new FString("Error Condition: Moving to default Location."));
return this->CurrentLocation->WalkNeighbors[0];
}
示例11: ConstructQuery
FString USQLiteDatabase::ConstructQuery(TArray<FString> Tables, TArray<FString> Fields,
FSQLiteQueryFinalizedQuery QueryObject, int32 MaxResults, int32 ResultOffset)
{
FString fieldString;
for (int32 i = 0; i < Fields.Num(); i++)
{
fieldString.Append(Fields[i] + (i < Fields.Num() - 1 ? "," : ""));
}
FString tableList = FString::Join(Tables, TEXT(","));
TArray<FString> allQueryParams;
allQueryParams.Add(FString::Printf(TEXT("SELECT %s FROM %s"), *fieldString, *tableList));
if (QueryObject.Query.Len() > 0)
{
allQueryParams.Add(FString::Printf(TEXT("WHERE %s"), *QueryObject.Query));
}
if (MaxResults >= 0)
{
allQueryParams.Add(FString::Printf(TEXT("LIMIT %i"), MaxResults));
}
if (ResultOffset > 0)
{
allQueryParams.Add(FString::Printf(TEXT("OFFSET %i"), ResultOffset));
}
FString finalQuery = FString::Join(allQueryParams, TEXT(" "));
return finalQuery;
}
示例12: AppendTextTo
void FSlateImageRun::AppendTextTo(FString& AppendToText, const FTextRange& PartialRange) const
{
check(Range.BeginIndex <= PartialRange.BeginIndex);
check(Range.EndIndex >= PartialRange.EndIndex);
AppendToText.Append(**Text + PartialRange.BeginIndex, PartialRange.Len());
}
示例13: OpenSourceFiles
bool FQtCreatorSourceCodeAccessor::OpenSourceFiles(const TArray<FString>& AbsoluteSourcePaths)
{
for ( const FString& SourcePath : AbsoluteSourcePaths )
{
FString Editor = FString(TEXT("/usr/bin/qtcreator"));
FString Args = FString(TEXT("-client "));
// Add this to handle spaces in path names.
const FString NewSourcePath = FString::Printf(TEXT("\"%s\""), *SourcePath);
Args.Append(NewSourcePath);
if(!(FLinuxPlatformProcess::CreateProc(*Editor,
*Args,
true,
true,
false,
nullptr,
0,
nullptr,
nullptr).IsValid()))
{
return false;
}
}
return true;
}
示例14: CreateCookerFileOrderString
FString FChunkManifestGenerator::CreateCookerFileOrderString(const TMap<FName, FAssetData*>& InAssetData, const TArray<FName>& InMaps)
{
FString FileOrderString;
TArray<FAssetData*> TopLevelNodes;
for (auto Asset : InAssetData)
{
auto PackageName = Asset.Value->PackageName;
TArray<FName> Referencers;
AssetRegistry.GetReferencers(PackageName, Referencers);
bool bIsTopLevel = true;
bool bIsMap = InMaps.Contains(PackageName);
if (!bIsMap && Referencers.Num() > 0)
{
for (auto ReferencerName : Referencers)
{
if (InAssetData.Contains(ReferencerName))
{
bIsTopLevel = false;
break;
}
}
}
if (bIsTopLevel)
{
if (bIsMap)
{
TopLevelNodes.Insert(Asset.Value, 0);
}
else
{
TopLevelNodes.Insert(Asset.Value, TopLevelNodes.Num());
}
}
}
TArray<FName> FileOrder;
TArray<FName> EncounteredNames;
for (auto Asset : TopLevelNodes)
{
AddAssetToFileOrderRecursive(Asset, FileOrder, EncounteredNames, InAssetData, InMaps);
}
int32 CurrentIndex = 0;
for (auto PackageName : FileOrder)
{
auto Asset = InAssetData[PackageName];
bool bIsMap = InMaps.Contains(Asset->PackageName);
auto Filename = FPackageName::LongPackageNameToFilename(Asset->PackageName.ToString(), bIsMap ? FPackageName::GetMapPackageExtension() : FPackageName::GetAssetPackageExtension());
ConvertFilenameToPakFormat(Filename);
auto Line = FString::Printf(TEXT("\"%s\" %i\n"), *Filename, CurrentIndex++);
FileOrderString.Append(Line);
}
return FileOrderString;
}
示例15: SearchForExport
void UJanusExporterTool::SearchForExport()
{
// If not prompting individual files, prompt the user to select a target directory.
IDesktopPlatform* DesktopPlatform = FDesktopPlatformModule::Get();
void* ParentWindowWindowHandle = NULL;
IMainFrameModule& MainFrameModule = FModuleManager::LoadModuleChecked<IMainFrameModule>(TEXT("MainFrame"));
const TSharedPtr<SWindow>& MainFrameParentWindow = MainFrameModule.GetParentWindow();
if (MainFrameParentWindow.IsValid() && MainFrameParentWindow->GetNativeWindow().IsValid())
{
ParentWindowWindowHandle = MainFrameParentWindow->GetNativeWindow()->GetOSWindowHandle();
}
FString FolderName;
const FString Title = NSLOCTEXT("UnrealEd", "ChooseADirectory", "Choose A Directory").ToString();
const bool bFolderSelected = DesktopPlatform->OpenDirectoryDialog(
ParentWindowWindowHandle,
Title,
ExportPath,
FolderName
);
if (bFolderSelected)
{
ExportPath = FolderName.Append("//");
}
}