本文整理汇总了C++中BString::getDataLength方法的典型用法代码示例。如果您正苦于以下问题:C++ BString::getDataLength方法的具体用法?C++ BString::getDataLength怎么用?C++ BString::getDataLength使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BString
的用法示例。
在下文中一共展示了BString::getDataLength方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: sendAdminFeedback
void ObjectController::sendAdminFeedback(BString reply) const
{
PlayerObject* player = dynamic_cast<PlayerObject*>(mObject);
if ((player) && (player->isConnected()))
{
if (reply.getLength())
{
gLogger->log(LogManager::NOTICE,"Admin (%s): %s", player->getFirstName().getAnsi(), reply.getAnsi());
reply.convert(BSTRType_Unicode16);
gMessageLib->SendSystemMessage(reply.getUnicode16(), player, true);
}
else
{
gLogger->log(LogManager::NOTICE,"Admin (%s):", player->getFirstName().getAnsi());
}
}
else
{
if (reply.getDataLength())
{
gLogger->log(LogManager::NOTICE,"Admin (anon): %s", reply.getAnsi());
}
else
{
gLogger->log(LogManager::NOTICE,"Admin (anon):");
}
}
}
示例2: addString
void MessageFactory::addString(const BString& data)
{
// Make sure we've called StartMessage()
assert(mCurrentMessage && "Must call StartMessage before adding data");
// Adjust start bounds if necessary.
_adjustHeapStartBounds(data.getDataLength());
// Insert our data and move our end pointer.
switch(data.getType())
{
case BSTRType_UTF8:
case BSTRType_ANSI:
{
// First insert the string length
*((uint16*)mCurrentMessageEnd) = data.getLength();
mCurrentMessageEnd += 2;
memcpy(mCurrentMessageEnd, data.getAnsi(), data.getLength());
mCurrentMessageEnd += data.getLength();
}
break;
case BSTRType_Unicode16:
{
// First insert the string length
*((uint32*)mCurrentMessageEnd) = data.getLength();
mCurrentMessageEnd += 4;
memcpy(mCurrentMessageEnd, data.getUnicode16(), data.getLength() * 2);
mCurrentMessageEnd += data.getLength() * 2;
}
break;
}
}
示例3: sendAdminFeedback
void ObjectController::sendAdminFeedback(BString reply) const
{
PlayerObject* player = dynamic_cast<PlayerObject*>(mObject);
if ((player) && (player->isConnected()))
{
if (reply.getLength())
{
reply.convert(BSTRType_Unicode16);
gMessageLib->SendSystemMessage(reply.getUnicode16(), player, true);
}
else
{
DLOG(info) << "Admin :" << player->getFirstName().getAnsi();
}
}
else
{
if (reply.getDataLength())
{
DLOG(info) << "Admin (anon): " << reply.getAnsi();
}
else
{
}
}
}