当前位置: 首页>>代码示例>>C++>>正文


C++ UTF8_TO_TCHAR函数代码示例

本文整理汇总了C++中UTF8_TO_TCHAR函数的典型用法代码示例。如果您正苦于以下问题:C++ UTF8_TO_TCHAR函数的具体用法?C++ UTF8_TO_TCHAR怎么用?C++ UTF8_TO_TCHAR使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了UTF8_TO_TCHAR函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: ue_py_check

PyObject *py_ue_find_actor_by_label(ue_PyUObject * self, PyObject * args)
{

	ue_py_check(self);

	char *name;
	if (!PyArg_ParseTuple(args, "s:find_actor_by_label", &name))
	{
		return NULL;
	}

	UWorld *world = ue_get_uworld(self);
	if (!world)
		return PyErr_Format(PyExc_Exception, "unable to retrieve UWorld from uobject");

	UObject *u_object = nullptr;

	for (TActorIterator<AActor> Itr(world); Itr; ++Itr)
	{
		AActor *u_obj = *Itr;
		if (u_obj->GetActorLabel().Equals(UTF8_TO_TCHAR(name)))
		{
			u_object = u_obj;
			break;
		}
	}

	if (u_object)
	{
		Py_RETURN_UOBJECT(u_object);
	}

	Py_RETURN_NONE;
}
开发者ID:rdsgautier,项目名称:UnrealEnginePython,代码行数:34,代码来源:UEPyActor.cpp

示例2: check

/**
 * ** INTERNAL **
 * Called by an async task after completing an achievement read.
 *
 * @param PlayerId - id of a player we were making read for
 * @param bReadSuccessfully - whether the read completed successfully
 */
void FOnlineAchievementsSteam::UpdateAchievementsForUser(const FUniqueNetIdSteam& PlayerId, bool bReadSuccessfully)
{
	// shouldn't get this far if no achievements are configured
	check(bHaveConfiguredAchievements);

	ISteamUserStats* SteamUserStatsPtr = SteamUserStats();
	check(SteamUserStatsPtr);
	CSteamID SteamUserId = PlayerId;

	// new array
	TArray<FOnlineAchievement> AchievementsForPlayer;
	const int32 AchNum = Achievements.Num();

	for (int32 AchIdx = 0; AchIdx < AchNum; ++AchIdx)
	{
		// get the info
		bool bUnlocked;
		uint32 UnlockUnixTime;
		if (!SteamUserStatsPtr->GetAchievementAndUnlockTime(TCHAR_TO_UTF8(*Achievements[AchIdx].Id), &bUnlocked, &UnlockUnixTime))
		{
			UE_LOG_ONLINE(Warning, TEXT("GetAchievementAndUnlockTime() failed for achievement '%s'"), *Achievements[AchIdx].Id);
			// skip this achievement
			continue;
		}

		FOnlineAchievementSteam NewAch = Achievements[ AchIdx ];
		NewAch.bReadFromSteam = true;
		NewAch.Progress = bUnlocked ? 100.0 : 0.0;	// TODO: we may want to support more fine-grained progress based on associated stat and min/max, 
													// although we can only map it one-way (i.e. when reading, but not when writing)
		NewAch.UnlockTime = FDateTime::FromUnixTimestamp(UnlockUnixTime);

		NewAch.Title = FText::FromString( UTF8_TO_TCHAR( SteamUserStatsPtr->GetAchievementDisplayAttribute(TCHAR_TO_UTF8(*Achievements[AchIdx].Id), "name") ) );
		NewAch.LockedDesc = FText::FromString( UTF8_TO_TCHAR( SteamUserStatsPtr->GetAchievementDisplayAttribute(TCHAR_TO_UTF8(*Achievements[AchIdx].Id), "desc") ) );
		NewAch.UnlockedDesc = NewAch.LockedDesc;

		NewAch.bIsHidden = FCString::Atoi( UTF8_TO_TCHAR( SteamUserStatsPtr->GetAchievementDisplayAttribute(TCHAR_TO_UTF8(*Achievements[AchIdx].Id), "desc") ) ) != 0;

		UE_LOG_ONLINE(Verbose, TEXT("Read achievement %d: %s"), AchIdx, *NewAch.ToDebugString());
		AchievementsForPlayer.Add( NewAch );

		// add mapping (should replace any existing one)
		AchievementDescriptions.Add(NewAch.Id, NewAch);
	}

	// should replace any already existing values
	PlayerAchievements.Add(PlayerId, AchievementsForPlayer);
}
开发者ID:amyvmiwei,项目名称:UnrealEngine4,代码行数:54,代码来源:OnlineAchievementsInterfaceSteam.cpp

示例3: UTF8_TO_TCHAR

void FXmppPresenceJingle::ConvertToPresence(FXmppUserPresence& OutPresence, const buzz::PresenceStatus& InStatus, const FXmppUserJid& InJid)
{
	OutPresence.UserJid = InJid;
	OutPresence.bIsAvailable = InStatus.available();
	OutPresence.StatusStr = UTF8_TO_TCHAR(InStatus.status().c_str());
	if (!InStatus.sent_time().empty())
	{
		//@todo samz - fix legacy time usage
		FString SentTime = UTF8_TO_TCHAR(InStatus.sent_time().c_str());
		// convert from "20141115T19:43:17" time to "2014-11-15T19:43:17" Iso8601 compatible format
		if (!SentTime.Contains(TEXT("-")) && SentTime.Len() >= 8)
		{
			SentTime.InsertAt(6, TEXT("-"));
			SentTime.InsertAt(4, TEXT("-"));
		}
		FDateTime::ParseIso8601(*SentTime, OutPresence.SentTime);
	}
	
	OutPresence.Status = EXmppPresenceStatus::Offline;
	if (InStatus.available())
	{
		switch (InStatus.show())
		{
		case buzz::PresenceStatus::SHOW_ONLINE:
			OutPresence.Status = EXmppPresenceStatus::Online;
			break;
		case buzz::PresenceStatus::SHOW_NONE:
		case buzz::PresenceStatus::SHOW_OFFLINE:
			OutPresence.Status = EXmppPresenceStatus::Offline;
			break;
		case buzz::PresenceStatus::SHOW_AWAY:
			OutPresence.Status = EXmppPresenceStatus::Away;
			break;
		case buzz::PresenceStatus::SHOW_XA:
			OutPresence.Status = EXmppPresenceStatus::ExtendedAway;
			break;
		case buzz::PresenceStatus::SHOW_DND:
			OutPresence.Status = EXmppPresenceStatus::DoNotDisturb;
			break;
		case buzz::PresenceStatus::SHOW_CHAT:
			OutPresence.Status = EXmppPresenceStatus::Chat;
			break;
		}
	}
	
	InJid.ParseResource(OutPresence.AppId, OutPresence.Platform);
}
开发者ID:WasPedro,项目名称:UnrealEngine4.11-HairWorks,代码行数:47,代码来源:XmppPresenceJingle.cpp

示例4: ue_py_check

PyObject *py_ue_skeleton_add_bone(ue_PyUObject *self, PyObject * args)
{

	ue_py_check(self);

	char *name;
	int parent_index;
	PyObject *py_transform;
	if (!PyArg_ParseTuple(args, "siO:skeleton_add_bone", &name, &parent_index, &py_transform))
		return nullptr;

	USkeleton *skeleton = ue_py_check_type<USkeleton>(self);
	if (!skeleton)
		return PyErr_Format(PyExc_Exception, "uobject is not a USkeleton");

	ue_PyFTransform *transform = py_ue_is_ftransform(py_transform);
	if (!transform)
		return PyErr_Format(PyExc_Exception, "argument is not a FTransform");

	if (skeleton->GetReferenceSkeleton().FindBoneIndex(FName(UTF8_TO_TCHAR(name))) > -1)
	{
		return PyErr_Format(PyExc_Exception, "bone %s already exists", name);
	}

#if WITH_EDITOR
	skeleton->PreEditChange(nullptr);
#endif

	{
		const FReferenceSkeleton &ref = skeleton->GetReferenceSkeleton();
		// horrible hack to modify the skeleton in place
		FReferenceSkeletonModifier modifier((FReferenceSkeleton &)ref, skeleton);

		TCHAR *bone_name = UTF8_TO_TCHAR(name);

		modifier.Add(FMeshBoneInfo(FName(bone_name), FString(bone_name), parent_index), transform->transform);
	}


#if WITH_EDITOR
	skeleton->PostEditChange();
#endif
	skeleton->MarkPackageDirty();

	return PyLong_FromLong(skeleton->GetReferenceSkeleton().FindBoneIndex(FName(UTF8_TO_TCHAR(name))));
}
开发者ID:rdsgautier,项目名称:UnrealEnginePython,代码行数:46,代码来源:UEPySkeletal.cpp

示例5: FString

void UWebsocketClient_impl::OnMessageReceived(FWebsocketConnectionHandle connectionHandle, FWebsocketClientMessagePtr msg)
{
	if (msg->get_payload().size() > 0)
	{
		auto msgStr = msg->get_payload().c_str();
		m_IncomingMessages.Add( FString(UTF8_TO_TCHAR(msg->get_payload().c_str())) );
	}
}
开发者ID:DigitalKarnage,项目名称:EMOS,代码行数:8,代码来源:UWebsocketClient_impl.cpp

示例6: FString

FString FOnlineIdentitySteam::GetPlayerNickname(const FUniqueNetId& UserId) const
{
	if (SteamFriendsPtr != NULL)
	{
		const char* PersonaName = SteamFriendsPtr->GetPersonaName();
		return FString(UTF8_TO_TCHAR(PersonaName));
	}
	return FString(TEXT(""));
}
开发者ID:amyvmiwei,项目名称:UnrealEngine4,代码行数:9,代码来源:OnlineIdentityInterfaceSteam.cpp

示例7: UE_LOG_ONLINE

bool FOnlineUserCloudOculus::ReadUserFile(const FUniqueNetId& UserId, const FString& FileName)
{
	auto LoggedInPlayerId = OculusSubsystem.GetIdentityInterface()->GetUniquePlayerId(0);
	if (!LoggedInPlayerId.IsValid() || UserId != *LoggedInPlayerId)
	{
		UE_LOG_ONLINE(Warning, TEXT("Can only read data for logged in player"));
		return false;
	}

	FString BucketName;
	FString Key;
	if (!(FileName.Split(SEPARATOR, &BucketName, &Key)))
	{
		BucketName = DefaultBucket;
		Key = FileName;
	}

	OculusSubsystem.AddRequestDelegate(
		ovr_CloudStorage_Load(TCHAR_TO_UTF8(*BucketName), TCHAR_TO_UTF8(*Key)),
		FOculusMessageOnCompleteDelegate::CreateLambda([this, BucketName, Key, LoggedInPlayerId, FileName](ovrMessageHandle Message, bool bIsError)
	{
		ovrCloudStorageDataHandle response = ovr_Message_GetCloudStorageData(Message);
		check(BucketName == UTF8_TO_TCHAR(ovr_CloudStorageData_GetBucket(response)));
		check(Key == UTF8_TO_TCHAR(ovr_CloudStorageData_GetKey(response)));

		if (bIsError)
		{
			UE_LOG_ONLINE(Warning, TEXT("Failed to Load: %s%s%s"), *BucketName, *SEPARATOR, *Key);
		}
		else
		{
			int64 BlobSize = ovr_CloudStorageData_GetDataSize(response);
			const void* RawBlob = ovr_CloudStorageData_GetData(response);

			TArray<uint8> Blob;
			Blob.Insert(static_cast<const uint8 *>(RawBlob), BlobSize, 0);

			ReadCache.Add(FileName, MoveTemp(Blob));
		}
		TriggerOnReadUserFileCompleteDelegates(!bIsError, *LoggedInPlayerId, FileName);
	}));

	return true;
}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:44,代码来源:OnlineUserCloudOculus.cpp

示例8: SteamId

void FOnlineAsyncTaskSteamEnumerateUserFiles::Tick()
{
	bIsComplete = true;
	bWasSuccessful = false;

	if (SteamRemoteStorage())
	{
		CSteamID SteamId(*(uint64*)UserId.GetBytes());
		if (SteamUser()->BLoggedOn() && SteamUser()->GetSteamID() == SteamId)
		{
			//SteamSubsystem->GetUserCloudInterface()->DumpCloudState(UserId);

			FScopeLock ScopeLock(&Subsystem->UserCloudDataLock);

			// Get or create the user metadata entry and empty it
			FSteamUserCloudData* UserMetadata = Subsystem->GetUserCloudEntry(UserId);

			UserMetadata->CloudMetadata.Empty();

			// Fill in the metadata entries
			const int32 FileCount = (int32) SteamRemoteStorage()->GetFileCount();
			for (int32 FileIdx = 0; FileIdx < FileCount; FileIdx++)
			{
				int32 FileSize = 0;
				const char *FileName = SteamRemoteStorage()->GetFileNameAndSize(FileIdx, &FileSize);
				new (UserMetadata->CloudMetadata) FCloudFileHeader(UTF8_TO_TCHAR(FileName), UTF8_TO_TCHAR(FileName), int32(FileSize));

				//SteamSubsystem->GetUserCloudInterface()->DumpCloudFileState(UserId, FileName);
			}

			bWasSuccessful = true;
		}
		else
		{
			UE_LOG_ONLINE(Warning, TEXT("Can only enumerate cloud files for logged in user."));
		}
	}
	else
	{
		UE_LOG_ONLINE(Warning, TEXT("Steam remote storage API disabled."));
	}
}
开发者ID:RandomDeveloperM,项目名称:UE4_Hairworks,代码行数:42,代码来源:OnlineUserCloudInterfaceSteam.cpp

示例9: checkf

FJavaClassMethod FJavaClassObject::GetClassMethod(const char* MethodName, const char* FuncSig)
{
	JNIEnv*	JEnv = FAndroidApplication::GetJavaEnv();
	FJavaClassMethod Method;
	Method.Method = JEnv->GetMethodID(Class, MethodName, FuncSig);
	Method.Name = MethodName;
	Method.Signature = FuncSig;
	// Is method valid?
	checkf(Method.Method, TEXT("Unable to find Java Method %s with Signature %s"), UTF8_TO_TCHAR(MethodName), UTF8_TO_TCHAR(FuncSig));
	return Method;
}
开发者ID:RandomDeveloperM,项目名称:UE4_Hairworks,代码行数:11,代码来源:AndroidJava.cpp

示例10: SteamworksWarningMessageHook

/** 
 * Callback function into Steam error messaging system
 * @param Severity - error level
 * @param Message - message from Steam
 */
static void __cdecl SteamworksWarningMessageHook(int Severity, const char *Message)
{
	const TCHAR *MessageType;
	switch (Severity)
	{
		case 0: MessageType = TEXT("message"); break;
		case 1: MessageType = TEXT("warning"); break;
		default: MessageType = TEXT("notification"); break;  // Unknown severity; new SDK?
	}
	UE_LOG_ONLINE(Warning, TEXT("Steamworks SDK %s: %s"), MessageType, UTF8_TO_TCHAR(Message));
}
开发者ID:WasPedro,项目名称:UnrealEngine4.11-HairWorks,代码行数:16,代码来源:OnlineSubsystemSteam.cpp

示例11:

static PyObject *py_ue_ftab_spawner_entry_set_display_name(ue_PyFTabSpawnerEntry *self, PyObject * args)
{
	char *name;
	if (!PyArg_ParseTuple(args, "s:set_display_name", &name))
		return NULL;

	self->spawner_entry->SetDisplayName(FText::FromString(UTF8_TO_TCHAR(name)));

	Py_INCREF(self);
	return (PyObject *)self;
}
开发者ID:20tab,项目名称:UnrealEnginePython,代码行数:11,代码来源:UEPyFTabSpawnerEntry.cpp

示例12: py_ue_edgraphpin_set_default_text_value

static int py_ue_edgraphpin_set_default_text_value(ue_PyEdGraphPin *self, PyObject *value, void *closure)
{
	if (value && PyUnicode_Check(value))
	{
		char *str = PyUnicode_AsUTF8(value);
		self->pin->DefaultTextValue = FText::FromString(UTF8_TO_TCHAR(str));
		return 0;
	}
	PyErr_SetString(PyExc_TypeError, "value is not a string");
	return -1;
}
开发者ID:rdsgautier,项目名称:UnrealEnginePython,代码行数:11,代码来源:UEPyEdGraphPin.cpp

示例13: FName

void UnFbx::FFbxImporter::FillAndVerifyBoneNames(USkeleton* Skeleton, TArray<FbxNode*>& SortedLinks, TArray<FName>& OutRawBoneNames, FString Filename)
{
	int32 TrackNum = SortedLinks.Num();

	OutRawBoneNames.AddUninitialized(TrackNum);
	// copy to the data
	for (int32 BoneIndex = 0; BoneIndex < TrackNum; BoneIndex++)
	{
		OutRawBoneNames[BoneIndex] = FName(*FSkeletalMeshImportData::FixupBoneName( UTF8_TO_TCHAR(MakeName(SortedLinks[BoneIndex]->GetName())) ));
	}

	const FReferenceSkeleton& RefSkeleton = Skeleton->GetReferenceSkeleton();
	const USkeleton::FBoneTreeType& BoneTree = Skeleton->GetBoneTree();

	// make sure at least root bone matches
	if ( OutRawBoneNames[0] != RefSkeleton.GetBoneName(0) )
	{
		AddTokenizedErrorMessage(FTokenizedMessage::Create(EMessageSeverity::Error, FText::Format(LOCTEXT("FBXImport_RootMatchFail", "Root bone name does not match (FBX: {0} | Skeleton: {1})"), FText::FromName(OutRawBoneNames[0]), FText::FromName(RefSkeleton.GetBoneName(0)))), FFbxErrors::Animation_RootTrackMismatch);

		return;
	}

	// ensure there are no duplicated names
	for (int32 I = 0; I < TrackNum; I++)
	{
		for ( int32 J = I+1; J < TrackNum; J++ )
		{
			if (OutRawBoneNames[I] == OutRawBoneNames[J])
			{
				FString RawBoneName = OutRawBoneNames[J].ToString();
				AddTokenizedErrorMessage(FTokenizedMessage::Create(EMessageSeverity::Warning, FText::Format(LOCTEXT("FBXImport_DupeBone", "Could not import {0}.\nDuplicate bone name found ('{1}'). Each bone must have a unique name."), FText::FromString(Filename), FText::FromString(RawBoneName))), FFbxErrors::Animation_DuplicatedBone);
			}
		}
	}

	// make sure all bone names are included, if not warn user
	FString BoneNames;
	for (int32 I = 0; I < TrackNum; ++I)
	{
		FName RawBoneName = OutRawBoneNames[I];
		if ( RefSkeleton.FindBoneIndex(RawBoneName) == INDEX_NONE)
		{
			BoneNames += RawBoneName.ToString();
			BoneNames += TEXT("  \n");
		}
	}

	if (BoneNames.IsEmpty() == false)
	{
		// warn user
		AddTokenizedErrorMessage(FTokenizedMessage::Create(EMessageSeverity::Warning, FText::Format(LOCTEXT("FBXImport_MissingBone", "The following bones exist in the imported animation, but not in the Skeleton asset {0}.  Any animation on these bones will not be imported: \n\n {1}"), FText::FromString(Skeleton->GetName()), FText::FromString(BoneNames) )), FFbxErrors::Animation_MissingBones);
	}
}
开发者ID:colwalder,项目名称:unrealengine,代码行数:53,代码来源:SkeletalMeshEdit.cpp

示例14:

static PyObject *py_ue_swidget_set_tooltip_text(ue_PySWidget *self, PyObject * args)
{
	char *text;
	if (!PyArg_ParseTuple(args, "s:set_tooltip_text", &text))
	{
		return NULL;
	}

	self->Widget->SetToolTipText(FText::FromString(UTF8_TO_TCHAR(text)));

	Py_RETURN_SLATE_SELF;
}
开发者ID:20tab,项目名称:UnrealEnginePython,代码行数:12,代码来源:UEPySWidget.cpp

示例15: AuthHeaderCString

void CloudyWebAPIImpl::GetSaveFileUrl(int32 GameId, FString Username, int32 PlayerControllerId)
{
    CURLcode ret;
    CURL *hnd;
    struct curl_slist *slist1;
    slist1 = NULL;
    std::string readBuffer;

    // Make authorization token header
    FString AuthHeader = "Authorization: Token " + Token;
    std::string AuthHeaderCString(TCHAR_TO_UTF8(*AuthHeader));

    // Make URL for GET request
    FString SaveFileUrl = BaseUrl + SaveDataUrl + "?user=" + Username + "&game=" + FString::FromInt(GameId);
    std::string SaveFileUrlCString(TCHAR_TO_UTF8(*SaveFileUrl));

    MakeRequest(SaveFileUrl, "GET");
    slist1 = curl_slist_append(slist1, AuthHeaderCString.c_str());
    
    hnd = curl_easy_init();
    curl_easy_setopt(hnd, CURLOPT_URL, SaveFileUrlCString.c_str());
    curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, slist1);
    curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
    
    /* Set up string to write response into */
    curl_easy_setopt(hnd, CURLOPT_WRITEFUNCTION, WriteCallback);
    curl_easy_setopt(hnd, CURLOPT_WRITEDATA, &readBuffer);
    
    // Make the GET request
    ret = curl_easy_perform(hnd);
    
    // Cleanup
    curl_easy_cleanup(hnd);
    hnd = NULL;
    curl_slist_free_all(slist1);
    slist1 = NULL;
    
    UE_LOG(CloudyWebAPILog, Warning, TEXT("Response data: %s"), UTF8_TO_TCHAR(readBuffer.c_str()));
    ReadAndStoreSaveFileURL(UTF8_TO_TCHAR(readBuffer.c_str()), PlayerControllerId);
}
开发者ID:9gix,项目名称:CloudyGamePlugin,代码行数:40,代码来源:CloudyWebAPI.cpp


注:本文中的UTF8_TO_TCHAR函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。