本文整理汇总了C++中ANSI_TO_TCHAR函数的典型用法代码示例。如果您正苦于以下问题:C++ ANSI_TO_TCHAR函数的具体用法?C++ ANSI_TO_TCHAR怎么用?C++ ANSI_TO_TCHAR使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ANSI_TO_TCHAR函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: check
void* FLinuxPlatformProcess::GetDllHandle( const TCHAR* Filename )
{
check( Filename );
FString AbsolutePath = FPaths::ConvertRelativePathToFull(Filename);
void *Handle = dlopen( TCHAR_TO_ANSI(*AbsolutePath), RTLD_LAZY | RTLD_LOCAL );
if (!Handle)
{
UE_LOG(LogLinux, Warning, TEXT("dlopen failed: %s"), ANSI_TO_TCHAR(dlerror()) );
}
return Handle;
}
示例2: FString
FString FJavascriptWebSocket::LocalEndPoint()
{
#if !PLATFORM_HTML5
return FString(ANSI_TO_TCHAR(libwebsocket_canonical_hostname(Context)));
#endif
#if PLATFORM_HTML5
return FString(TEXT("TODO:LOCALENDPOINT"));
#endif
}
示例3: getenv
void FIOSPlatformMisc::GetEnvironmentVariable(const TCHAR* VariableName, TCHAR* Result, int32 ResultLength)
{
ANSICHAR *AnsiResult = getenv(TCHAR_TO_ANSI(VariableName));
if (AnsiResult)
{
wcsncpy(Result, ANSI_TO_TCHAR(AnsiResult), ResultLength);
}
else
{
*Result = 0;
}
}
示例4: ANSI_TO_TCHAR
bool UNdiMediaFinder::GetSources(TArray<FNdiMediaSourceId>& OutSources) const
{
if (!FNdi::IsInitialized() || (FindInstance == nullptr))
{
return false;
}
uint32_t NumSources = 0;
const NDIlib_source_t* Sources = FNdi::Lib->NDIlib_find_get_current_sources(FindInstance, &NumSources);
for (uint32_t SourceIndex = 0; SourceIndex < NumSources; ++SourceIndex)
{
const NDIlib_source_t& Source = Sources[SourceIndex];
OutSources.Add(FNdiMediaSourceId(
ANSI_TO_TCHAR(Source.p_ip_address),
ANSI_TO_TCHAR(Source.p_ndi_name)
));
}
return true;
}
示例5: CreateBones
/**
* Create the bones needed to hold the transforms for the destructible chunks associated with an Apex Destructible Asset.
* @param ImportData - SkeletalMesh import data into which we are extracting information
* @param ApexDestructibleAsset - the Apex Destructible Asset
*/
static void CreateBones(FSkeletalMeshImportData &ImportData, const NxDestructibleAsset& ApexDestructibleAsset)
{
// Just need to create ApexDestructibleAsset.getChunkCount() bones, all with identity transform poses
const uint32 ChunkCount = ApexDestructibleAsset.getChunkCount();
if( ChunkCount == 0 )
{
UE_LOG(LogApexDestructibleAssetImport, Warning,TEXT("%s has no chunks"), ANSI_TO_TCHAR(ApexDestructibleAsset.getName()) );
return;
}
const uint32 BoneCount = ChunkCount + 1; // Adding one more bone for the root bone, required by the skeletal mesh
// Format for bone names
uint32 Q = ChunkCount-1;
int32 MaxNumberWidth = 1;
while ((Q /= 10) != 0)
{
++MaxNumberWidth;
}
// Turn parts into bones
for (uint32 BoneIndex=0; BoneIndex<BoneCount; ++BoneIndex)
{
ImportData.RefBonesBinary.Add( VBone() );
// Set bone
VBone& Bone = ImportData.RefBonesBinary[BoneIndex];
if (BoneIndex == 0)
{
// Bone 0 is the required root bone
Bone.Name = TEXT("Root");
Bone.NumChildren = ChunkCount;
Bone.ParentIndex = INDEX_NONE;
}
else
{
// The rest are the parts
Bone.Name = FString::Printf( TEXT("Part%0*d"), MaxNumberWidth, BoneIndex-1);
Bone.NumChildren = 0;
// Creates a simple "flat" hierarchy
Bone.ParentIndex = 0;
}
// Set transform to identity
VJointPos& JointMatrix = Bone.BonePos;
JointMatrix.Orientation = FQuat(0.0f,0.0f,0.0f,1.0f);
JointMatrix.Position = FVector(0.0f,0.0f,0.0f);
JointMatrix.Length = 1.0f;
JointMatrix.XSize = 100.0f;
JointMatrix.YSize = 100.0f;
JointMatrix.ZSize = 100.0f;
}
}
示例6: Buffer
void FLinuxTime::PrintCalibrationLog()
{
// clock selection happens too early to be printed to log, print it now
FString Buffer(ANSI_TO_TCHAR(CalibrationLog));
TArray<FString> Lines;
Buffer.ParseIntoArrayLines(Lines);
for(const FString& Line : Lines)
{
UE_LOG(LogLinux, Log, TEXT("%s"), *Line);
}
}
示例7: TEXT
bool FSandboxPlatformFile::ShouldBeUsed(IPlatformFile* Inner, const TCHAR* CmdLine) const
{
FString SandboxDir;
bool bResult = FParse::Value( CmdLine, TEXT("-Sandbox="), SandboxDir );
#if PLATFORM_DESKTOP && (UE_GAME || UE_SERVER)
if (FPlatformProperties::RequiresCookedData() && SandboxDir.IsEmpty() && Inner == &FPlatformFileManager::Get().GetPlatformFile() && bEntireEngineWillUseThisSandbox)
{
FString SandboxName = FString(TEXT("Cooked-")) + ANSI_TO_TCHAR(FPlatformProperties::PlatformName());
SandboxDir = FPaths::Combine(*(FPaths::GameDir()), TEXT("Saved"), TEXT("Sandboxes"), *SandboxDir);
bResult = FPlatformFileManager::Get().GetPlatformFile().DirectoryExists(*SandboxDir);
}
#endif
return bResult;
}
示例8: Super
UOnlineHotfixManager::UOnlineHotfixManager() :
Super(),
TotalFiles(0),
NumDownloaded(0),
TotalBytes(0),
NumBytes(0)
{
OnEnumerateFilesCompleteDelegate = FOnEnumerateFilesCompleteDelegate::CreateUObject(this, &UOnlineHotfixManager::OnEnumerateFilesComplete);
OnReadFileProgressDelegate = FOnReadFileProgressDelegate::CreateUObject(this, &UOnlineHotfixManager::OnReadFileProgress);
OnReadFileCompleteDelegate = FOnReadFileCompleteDelegate::CreateUObject(this, &UOnlineHotfixManager::OnReadFileComplete);
// So we only try to apply files for this platform
PlatformPrefix = ANSI_TO_TCHAR(FPlatformProperties::PlatformName());
PlatformPrefix += TEXT("_");
}
示例9: TEXT
const TCHAR* FLinuxPlatformProcess::UserDir()
{
// The UserDir is where user visible files (such as game projects) live.
// On Linux (just like on Mac) this corresponds to $HOME/Documents.
// To accomodate localization requirement we use xdg-user-dir command,
// and fall back to $HOME/Documents if setting not found.
static TCHAR Result[MAX_PATH] = TEXT("");
if (!Result[0])
{
char DocPath[MAX_PATH];
FILE* FilePtr = popen("xdg-user-dir DOCUMENTS", "r");
if(fgets(DocPath, MAX_PATH, FilePtr) == NULL)
{
char* Home = secure_getenv("HOME");
if (!Home)
{
UE_LOG(LogHAL, Warning, TEXT("Unable to read the $HOME environment variable"));
}
else
{
FCString::Strcpy(Result, ANSI_TO_TCHAR(Home));
FCString::Strcat(Result, TEXT("/Documents/"));
}
}
else
{
size_t DocLen = strlen(DocPath) - 1;
DocPath[DocLen] = '\0';
FCString::Strcpy(Result, ANSI_TO_TCHAR(DocPath));
FCString::Strcat(Result, TEXT("/"));
}
pclose(FilePtr);
}
return Result;
}
示例10: check
bool FProcState::IsRunning()
{
if (bIsRunning)
{
check(!bHasBeenWaitedFor); // check for the sake of internal consistency
// check if actually running
int KillResult = kill(GetProcessId(), 0); // no actual signal is sent
check(KillResult != -1 || errno != EINVAL);
bIsRunning = (KillResult == 0 || (KillResult == -1 && errno == EPERM));
// additional check if it's a zombie
if (bIsRunning)
{
for(;;) // infinite loop in case we get EINTR and have to repeat
{
siginfo_t SignalInfo;
SignalInfo.si_pid = 0; // if remains 0, treat as child was not waitable (i.e. was running)
if (waitid(P_PID, GetProcessId(), &SignalInfo, WEXITED | WNOHANG | WNOWAIT))
{
if (errno != EINTR)
{
int ErrNo = errno;
UE_LOG(LogHAL, Fatal, TEXT("FLinuxPlatformProcess::WaitForProc: waitid for pid %d failed (errno=%d, %s)"),
static_cast< int32 >(GetProcessId()), ErrNo, ANSI_TO_TCHAR(strerror(ErrNo)));
break; // exit the loop if for some reason Fatal log (above) returns
}
}
else
{
bIsRunning = ( SignalInfo.si_pid != GetProcessId() );
break;
}
}
}
// If child is a zombie, wait() immediately to free up kernel resources. Higher level code
// (e.g. shader compiling manager) can hold on to handle of no longer running process for longer,
// which is a dubious, but valid behavior. We don't want to keep zombie around though.
if (!bIsRunning)
{
UE_LOG(LogHAL, Log, TEXT("Child %d is no more running (zombie), Wait()ing immediately."), GetProcessId() );
Wait();
}
}
return bIsRunning;
}
示例11: switch
JNIEXPORT void JNICALL Java_com_ers_bluetones_BlueService_receiveData
(JNIEnv * env, jclass clazz, jstring device, jobject data){
const char* devi = env->GetStringUTFChars(device, JNI_FALSE);
jbyte *buffy = (jbyte*)(env->GetDirectBufferAddress(data));
switch(buffy[0]) {
case 0:
UCPPRelay::players.Add(FString(devi), buffy[1]);
break;
case 1:
UE_LOG(LogTemp, Warning, TEXT("%s mov %d"), ANSI_TO_TCHAR(devi), buffy[1])
UCPPRelay::movement.Add(FString(devi), buffy[1]);
break;
}
env->ReleaseStringUTFChars(device, devi);
}
示例12: Close
FLibvlcMedia* FVlcMediaSource::OpenUrl(const FString& Url)
{
Close();
Media = FVlc::MediaNewLocation(VlcInstance, TCHAR_TO_ANSI(*Url));
if (Media == nullptr)
{
UE_LOG(LogVlcMedia, Warning, TEXT("Failed to open media %s: %s"), *Url, ANSI_TO_TCHAR(FVlc::Errmsg()));
}
CurrentUrl = Url;
return Media;
}
示例13: switch
bool FVulkanDevice::QueryGPU(int32 DeviceIndex)
{
bool bDiscrete = false;
VulkanRHI::vkGetPhysicalDeviceProperties(Gpu, &GpuProps);
auto GetDeviceTypeString = [&]()
{
FString Info;
switch (GpuProps.deviceType)
{
case VK_PHYSICAL_DEVICE_TYPE_OTHER:
Info = TEXT("Other");
break;
case VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU:
Info = TEXT("Integrated GPU");
break;
case VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU:
Info = TEXT("Discrete GPU");
bDiscrete = true;
break;
case VK_PHYSICAL_DEVICE_TYPE_VIRTUAL_GPU:
Info = TEXT("Virtual GPU");
break;
case VK_PHYSICAL_DEVICE_TYPE_CPU:
Info = TEXT("CPU");
break;
default:
Info = TEXT("Unknown");
break;
}
return Info;
};
UE_LOG(LogVulkanRHI, Display, TEXT("Initializing Device %d"), DeviceIndex);
UE_LOG(LogVulkanRHI, Display, TEXT("API 0x%x Driver 0x%x VendorId 0x%x"), GpuProps.apiVersion, GpuProps.driverVersion, GpuProps.vendorID);
UE_LOG(LogVulkanRHI, Display, TEXT("Name %s Device 0x%x Type %s"), ANSI_TO_TCHAR(GpuProps.deviceName), GpuProps.deviceID, *GetDeviceTypeString());
UE_LOG(LogVulkanRHI, Display, TEXT("Max Descriptor Sets Bound %d Timestamps %d"), GpuProps.limits.maxBoundDescriptorSets, GpuProps.limits.timestampComputeAndGraphics);
uint32 QueueCount = 0;
VulkanRHI::vkGetPhysicalDeviceQueueFamilyProperties(Gpu, &QueueCount, nullptr);
check(QueueCount >= 1);
QueueFamilyProps.AddUninitialized(QueueCount);
VulkanRHI::vkGetPhysicalDeviceQueueFamilyProperties(Gpu, &QueueCount, QueueFamilyProps.GetData());
return bDiscrete;
}
示例14: FString
void FMacroCallback::MacroDefined(const clang::Token &MacroNameTok, const clang::MacroDirective *MD)
{
auto MacroName = MacroNameTok.getIdentifierInfo()->getName();
if (IsMacroDefinedInCommandLine(MacroName) || IsBuiltInMacro(MD) || IsPredefinedMacro(MacroName))
{
return;
}
auto MacroDefinitionFile = FString(SourceManager.getFilename(MacroNameTok.getLocation()).data());
MacroDefinitionFile.ReplaceInline(TEXT("\\"), TEXT("/"));
if (MacroDefinitionFile.IsEmpty())
{
OutputFileContents.Logf(TEXT("Found unexpected definition of macro %s."), ANSI_TO_TCHAR(MacroName.data()));
}
MacroDefinitionToFile.Add(MacroName.data(), MacroDefinitionFile);
}
示例15: ANSI_TO_TCHAR
void FLinuxCrashContext::CaptureStackTrace()
{
// Only do work the first time this function is called - this is mainly a carry over from Windows where it can be called multiple times, left intact for extra safety.
if (!bCapturedBacktrace)
{
const SIZE_T StackTraceSize = 65535;
ANSICHAR* StackTrace = (ANSICHAR*) FMemory::Malloc( StackTraceSize );
StackTrace[0] = 0;
// Walk the stack and dump it to the allocated memory (ignore first 2 callstack lines as those are in stack walking code)
FPlatformStackWalk::StackWalkAndDump( StackTrace, StackTraceSize, 2, this);
FCString::Strncat( GErrorHist, ANSI_TO_TCHAR(StackTrace), ARRAY_COUNT(GErrorHist) - 1 );
CreateExceptionInfoString(Signal, Info);
FMemory::Free( StackTrace );
bCapturedBacktrace = true;
}
}