示例#1
0
void CPacket::wStr(irr::core::stringc &str)
{
	if((WritePointer + str.size() + 1) > DataLen)
		resize(WritePointer + str.size() + 1);

	for(irr::s32 i = 0; i < str.size(); i++)
		Data[WritePointer++] = str[i];
	Data[WritePointer++] = 0x00;
};
示例#2
0
void CPacket::wStrW(irr::core::stringc &str)
{
	if((WritePointer + (str.size() * 2) + 2) > DataLen)
		resize(WritePointer + (str.size() * 2) + 2);

	for(irr::s32 i = 0; i < str.size(); i++)
		w16(str[i]);
	w16(0x0000);
};
示例#3
0
irr::core::stringc CFileSystem::getFileDir(irr::core::stringc &filename)
{
	irr::core::stringc ret;
 
	// find last forward or backslash
	s32 lastSlash = filename.findLast('/');
	s32 lastBackSlash = filename.findLast('\\');
	lastSlash = lastSlash > lastBackSlash ? lastSlash : lastBackSlash;

	if (lastSlash >= 0 && lastSlash < (s32)filename.size())
		ret = filename.subString(0, lastSlash);
	else
		ret = ".";

	return ret;
}