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; };
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); };
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; }