當前位置: 首頁>>代碼示例>>C++>>正文


C++ ANSI_TO_TCHAR函數代碼示例

本文整理匯總了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;
}
開發者ID:kidaa,項目名稱:UnrealEngineVR,代碼行數:11,代碼來源:LinuxPlatformProcess.cpp

示例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

}
開發者ID:Jeezymang,項目名稱:Unreal.js-core,代碼行數:11,代碼來源:JSWebSocket.cpp

示例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;
	}
}
開發者ID:dineshone,項目名稱:UnrealGameEngine,代碼行數:12,代碼來源:IOSPlatformMisc.cpp

示例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;
}
開發者ID:ue4plugins,項目名稱:NdiMedia,代碼行數:21,代碼來源:NdiMediaFinder.cpp

示例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;
	}
}
開發者ID:Tigrouzen,項目名稱:UnrealEngine-4,代碼行數:57,代碼來源:ApexDestructibleAssetImport.cpp

示例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);
	}
}
開發者ID:zhaoyizheng0930,項目名稱:UnrealEngine,代碼行數:13,代碼來源:LinuxPlatformTime.cpp

示例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;
}
開發者ID:Tigrouzen,項目名稱:UnrealEngine-4,代碼行數:14,代碼來源:IPlatformFileSandboxWrapper.cpp

示例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("_");
}
開發者ID:RandomDeveloperM,項目名稱:UE4_Hairworks,代碼行數:14,代碼來源:OnlineHotfixManager.cpp

示例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;
}
開發者ID:johndpope,項目名稱:UE4,代碼行數:37,代碼來源:LinuxPlatformProcess.cpp

示例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;
}
開發者ID:johndpope,項目名稱:UE4,代碼行數:49,代碼來源:LinuxPlatformProcess.cpp

示例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);
	}
開發者ID:Max9403,項目名稱:animated-ironman,代碼行數:15,代碼來源:com_ers_bluetones_SimpleWrap.cpp

示例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;
}
開發者ID:CyberSys,項目名稱:VlcMedia,代碼行數:15,代碼來源:VlcMediaSource.cpp

示例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;
}
開發者ID:zhaoyizheng0930,項目名稱:UnrealEngine,代碼行數:47,代碼來源:VulkanDevice.cpp

示例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);
	}
開發者ID:RandomDeveloperM,項目名稱:UE4_Hairworks,代碼行數:17,代碼來源:MacroCallback.cpp

示例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;
	}
}
開發者ID:WasPedro,項目名稱:UnrealEngine4.11-HairWorks,代碼行數:18,代碼來源:LinuxPlatformCrashContext.cpp


注:本文中的ANSI_TO_TCHAR函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。