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


C++ PSPWCharPointer::IsValid方法代码示例

本文整理汇总了C++中PSPWCharPointer::IsValid方法的典型用法代码示例。如果您正苦于以下问题:C++ PSPWCharPointer::IsValid方法的具体用法?C++ PSPWCharPointer::IsValid怎么用?C++ PSPWCharPointer::IsValid使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PSPWCharPointer的用法示例。


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

示例1: sceCccSJIStoUTF16

int sceCccSJIStoUTF16(u32 dstAddr, int dstSize, u32 srcAddr)
{
	PSPCharPointer src;
	PSPWCharPointer dst;
	dst = dstAddr;
	src = srcAddr;

	if (!dst.IsValid() || !src.IsValid())
	{
		ERROR_LOG(HLE, "sceCccSJIStoUTF16(%08x, %d, %08x): invalid pointers", dstAddr, dstSize, srcAddr);
		return 0;
	}
	if (!jis2ucsTable.IsValid())
	{
		ERROR_LOG(HLE, "sceCccSJIStoUTF16(%08x, %d, %08x): table not loaded", dstAddr, dstSize, srcAddr);
		return 0;
	}

	DEBUG_LOG(HLE, "sceCccSJIStoUTF16(%08x, %d, %08x)", dstAddr, dstSize, srcAddr);
	ShiftJIS sjis(src);
	int n = 0;
	while (u32 c = sjis.next())
	{
		dst += UTF16LE::encode(dst, __CccJIStoUCS(c, errorUTF16));
		n++;
	}
	return n;
}
开发者ID:BogsyP,项目名称:ppsspp,代码行数:28,代码来源:sceCcc.cpp

示例2: sceCccUTF16toSJIS

int sceCccUTF16toSJIS(u32 dstAddr, int dstSize, u32 srcAddr)
{
	PSPWCharPointer src;
	PSPCharPointer dst;
	dst = dstAddr;
	src = srcAddr;

	if (!dst.IsValid() || !src.IsValid())
	{
		ERROR_LOG(HLE, "sceCccUTF16toSJIS(%08x, %d, %08x): invalid pointers", dstAddr, dstSize, srcAddr);
		return 0;
	}
	if (!ucs2jisTable.IsValid())
	{
		ERROR_LOG(HLE, "sceCccUTF16toSJIS(%08x, %d, %08x): table not loaded", dstAddr, dstSize, srcAddr);
		return 0;
	}

	DEBUG_LOG(HLE, "sceCccUTF16toSJIS(%08x, %d, %08x)", dstAddr, dstSize, srcAddr);
	UTF16LE utf(src);
	int n = 0;
	while (u32 c = utf.next())
	{
		dst += ShiftJIS::encode(dst, __CccUCStoJIS(c, errorSJIS));
		n++;
	}
	return n;
}
开发者ID:BogsyP,项目名称:ppsspp,代码行数:28,代码来源:sceCcc.cpp

示例3: sceCccSJIStoUTF16

int sceCccSJIStoUTF16(u32 dstAddr, u32 dstSize, u32 srcAddr)
{
	const auto src = PSPConstCharPointer::Create(srcAddr);
	auto dst = PSPWCharPointer::Create(dstAddr);
	if (!dst.IsValid() || !src.IsValid())
	{
		ERROR_LOG(HLE, "sceCccSJIStoUTF16(%08x, %d, %08x): invalid pointers", dstAddr, dstSize, srcAddr);
		return 0;
	}
	if (!jis2ucsTable.IsValid())
	{
		ERROR_LOG(HLE, "sceCccSJIStoUTF16(%08x, %d, %08x): table not loaded", dstAddr, dstSize, srcAddr);
		return 0;
	}

	const auto dstEnd = PSPWCharPointer::Create(dstAddr + (dstSize & ~1));

	DEBUG_LOG(HLE, "sceCccSJIStoUTF16(%08x, %d, %08x)", dstAddr, dstSize, srcAddr);
	ShiftJIS sjis(src);
	int n = 0;
	while (u32 c = sjis.next())
	{
		if (dst + UTF16LE::encodeUnits(c) >= dstEnd)
			break;
		dst += UTF16LE::encode(dst, __CccJIStoUCS(c, errorUTF16));
		n++;
	}

	if (dst < dstEnd)
		*dst++ = 0;

	CBreakPoints::ExecMemCheck(srcAddr, false, sjis.byteIndex(), currentMIPS->pc);
	CBreakPoints::ExecMemCheck(dstAddr, true, dst.ptr - dstAddr, currentMIPS->pc);
	return n;
}
开发者ID:ANR2ME,项目名称:ppsspp,代码行数:35,代码来源:sceCcc.cpp

示例4: sceCccUTF16toSJIS

int sceCccUTF16toSJIS(u32 dstAddr, u32 dstSize, u32 srcAddr)
{
	const auto src = PSPConstWCharPointer::Create(srcAddr);
	auto dst = PSPCharPointer::Create(dstAddr);
	if (!dst.IsValid() || !src.IsValid())
	{
		ERROR_LOG(HLE, "sceCccUTF16toSJIS(%08x, %d, %08x): invalid pointers", dstAddr, dstSize, srcAddr);
		return 0;
	}
	if (!ucs2jisTable.IsValid())
	{
		ERROR_LOG(HLE, "sceCccUTF16toSJIS(%08x, %d, %08x): table not loaded", dstAddr, dstSize, srcAddr);
		return 0;
	}

	const auto dstEnd = PSPCharPointer::Create(dstAddr + dstSize);

	DEBUG_LOG(HLE, "sceCccUTF16toSJIS(%08x, %d, %08x)", dstAddr, dstSize, srcAddr);
	UTF16LE utf(src);
	int n = 0;
	while (u32 c = utf.next())
	{
		if (dst + ShiftJIS::encodeUnits(c) >= dstEnd)
			break;
		dst += ShiftJIS::encode(dst, __CccUCStoJIS(c, errorSJIS));
		n++;
	}

	if (dst < dstEnd)
		*dst++ = 0;

	CBreakPoints::ExecMemCheck(srcAddr, false, utf.shortIndex() * sizeof(uint16_t), currentMIPS->pc);
	CBreakPoints::ExecMemCheck(dstAddr, true, dst.ptr - dstAddr, currentMIPS->pc);
	return n;
}
开发者ID:ANR2ME,项目名称:ppsspp,代码行数:35,代码来源:sceCcc.cpp

示例5: sceCccJIStoUCS

u32 sceCccJIStoUCS(u32 c, u32 alt)
{
	if (jis2ucsTable.IsValid())
	{
		DEBUG_LOG(HLE, "sceCccUCStoJIS(%08x, %08x)", c, alt);
		return __CccJIStoUCS(c, alt);
	}
	else
	{
		ERROR_LOG(HLE, "sceCccUCStoJIS(%08x, %08x): table not loaded", c, alt);
		return alt;
	}
}
开发者ID:BogsyP,项目名称:ppsspp,代码行数:13,代码来源:sceCcc.cpp

示例6: sceCccStrlenUTF16

int sceCccStrlenUTF16(u32 strAddr)
{
	PSPWCharPointer str;
	str = strAddr;

	if (!str.IsValid())
	{
		ERROR_LOG(HLE, "sceCccStrlenUTF16(%08x): invalid pointer", strAddr);
		return 0;
	}
	DEBUG_LOG(HLE, "sceCccStrlenUTF16(%08x): invalid pointer", strAddr);
	return UTF16LE(str).length();
}
开发者ID:BogsyP,项目名称:ppsspp,代码行数:13,代码来源:sceCcc.cpp

示例7: sceCccUTF8toUTF16

int sceCccUTF8toUTF16(u32 dstAddr, int dstSize, u32 srcAddr)
{
	PSPCharPointer src;
	PSPWCharPointer dst;
	dst = dstAddr;
	src = srcAddr;

	if (!dst.IsValid() || !src.IsValid())
	{
		ERROR_LOG(HLE, "sceCccUTF8toUTF16(%08x, %d, %08x): invalid pointers", dstAddr, dstSize, srcAddr);
		return 0;
	}

	DEBUG_LOG(HLE, "sceCccUTF8toUTF16(%08x, %d, %08x)", dstAddr, dstSize, srcAddr);
	UTF8 utf(src);
	int n = 0;
	while (u32 c = utf.next())
	{
		dst += UTF16LE::encode(dst, c);
		n++;
	}
	return n;
}
开发者ID:BogsyP,项目名称:ppsspp,代码行数:23,代码来源:sceCcc.cpp


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