本文整理汇总了C++中LLNameValue::getString方法的典型用法代码示例。如果您正苦于以下问题:C++ LLNameValue::getString方法的具体用法?C++ LLNameValue::getString怎么用?C++ LLNameValue::getString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLNameValue
的用法示例。
在下文中一共展示了LLNameValue::getString方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: addUsers
void LLPanelGroupInvite::addUsers(std::vector<LLUUID>& agent_ids)
{
std::vector<std::string> names;
for (S32 i = 0; i < (S32)agent_ids.size(); i++)
{
LLUUID agent_id = agent_ids[i];
LLVOAvatar* avatarp = gObjectList.findAvatar(agent_id);
if(avatarp)
{
std::string fullname;
LLSD args;
LLNameValue* nvfirst = avatarp->getNVPair("FirstName");
LLNameValue* nvlast = avatarp->getNVPair("LastName");
if(nvfirst && nvlast)
{
args["FIRST"] = std::string(nvfirst->getString());
args["LAST"] = std::string(nvlast->getString());
fullname = std::string(nvfirst->getString()) + " " + std::string(nvlast->getString());
}
if (!fullname.empty())
{
names.push_back(fullname);
}
else
{
llwarns << "llPanelGroupInvite: Selected avatar has no name: " << avatarp->getID() << llendl;
names.push_back("(Unknown)");
}
}
}
mImplementation->addUsers(names, agent_ids);
}
示例2: addUsers
void LLPanelGroupInvite::addUsers(std::vector<LLUUID>& agent_ids)
{
std::vector<std::string> names;
for (S32 i = 0; i < (S32)agent_ids.size(); i++)
{
LLUUID agent_id = agent_ids[i];
LLViewerObject* dest = gObjectList.findObject(agent_id);
if(dest && dest->isAvatar())
{
std::string fullname;
LLStringUtil::format_map_t args;
LLNameValue* nvfirst = dest->getNVPair("FirstName");
LLNameValue* nvlast = dest->getNVPair("LastName");
if(nvfirst && nvlast)
{
args["[FIRST]"] = nvfirst->getString();
args["[LAST]"] = nvlast->getString();
fullname = nvfirst->getString();
fullname += " ";
fullname += nvlast->getString();
}
if (!fullname.empty())
{
names.push_back(fullname);
}
else
{
llwarns << "llPanelGroupInvite: Selected avatar has no name: " << dest->getID() << llendl;
names.push_back("(Unknown)");
}
}
}
mImplementation->addUsers(names, agent_ids);
}
示例3: addUsers
void LLPanelGroupBulk::addUsers(uuid_vec_t& agent_ids)
{
std::vector<std::string> names;
for (S32 i = 0; i < (S32)agent_ids.size(); i++)
{
std::string fullname;
LLUUID agent_id = agent_ids[i];
LLViewerObject* dest = gObjectList.findObject(agent_id);
if(dest && dest->isAvatar())
{
LLNameValue* nvfirst = dest->getNVPair("FirstName");
LLNameValue* nvlast = dest->getNVPair("LastName");
if(nvfirst && nvlast)
{
fullname = LLCacheName::buildFullName(
nvfirst->getString(), nvlast->getString());
}
if (!fullname.empty())
{
names.push_back(fullname);
}
else
{
llwarns << "llPanelGroupBulk: Selected avatar has no name: " << dest->getID() << llendl;
names.push_back("(Unknown)");
}
}
else
{
//looks like user try to invite offline friend
//for offline avatar_id gObjectList.findObject() will return null
//so we need to do this additional search in avatar tracker, see EXT-4732
//if (LLAvatarTracker::instance().isBuddy(agent_id)) // Singu Note: We may be using this from another avatar list like group profile, disregard friendship status.
{
LLAvatarName av_name;
if (!LLAvatarNameCache::get(agent_id, &av_name))
{
// actually it should happen, just in case
LLAvatarNameCache::get(LLUUID(agent_id), boost::bind(&LLPanelGroupBulk::addUserCallback, this, _1, _2));
// for this special case!
//when there is no cached name we should remove resident from agent_ids list to avoid breaking of sequence
// removed id will be added in callback
agent_ids.erase(agent_ids.begin() + i);
}
else
{
std::string name;
LLAvatarNameCache::getPNSName(av_name, name);
names.push_back(name);
}
}
}
}
mImplementation->mListFullNotificationSent = false;
mImplementation->addUsers(names, agent_ids);
}
示例4: addUsers
void LLPanelGroupInvite::addUsers(std::vector<LLUUID>& agent_ids)
{
std::vector<std::string> names;
for (S32 i = 0; i < (S32)agent_ids.size(); i++)
{
LLUUID agent_id = agent_ids[i];
LLViewerObject* dest = gObjectList.findObject(agent_id);
std::string fullname;
if(dest && dest->isAvatar())
{
LLNameValue* nvfirst = dest->getNVPair("FirstName");
LLNameValue* nvlast = dest->getNVPair("LastName");
if(nvfirst && nvlast)
{
fullname = std::string(nvfirst->getString()) + " " + std::string(nvlast->getString());
}
if (!fullname.empty())
{
names.push_back(fullname);
}
else
{
llwarns << "llPanelGroupInvite: Selected avatar has no name: " << dest->getID() << llendl;
names.push_back("(Unknown)");
}
}
else
{
//looks like user try to invite offline friend
//for offline avatar_id gObjectList.findObject() will return null
//so we need to do this additional search in avatar tracker, see EXT-4732
if (LLAvatarTracker::instance().isBuddy(agent_id))
{
if (!gCacheName->getFullName(agent_id, fullname))
{
// actually it should happen, just in case
gCacheName->get(LLUUID(agent_id), false, boost::bind(
&LLPanelGroupInvite::addUserCallback, this, _1, _2,
_3));
// for this special case!
//when there is no cached name we should remove resident from agent_ids list to avoid breaking of sequence
// removed id will be added in callback
agent_ids.erase(agent_ids.begin() + i);
}
else
{
names.push_back(fullname);
}
}
}
}
mImplementation->addUsers(names, agent_ids);
}
示例5: completechk
void ScriptCounter::completechk()
{
if(invqueries == 0)
{
if(reqObjectID.isNull())
{
if(sstr.str() == "")
{
if(foo->isAvatar())
{
int valid=1;
LLVOAvatar *av=find_avatar_from_object(foo);
LLNameValue *firstname;
LLNameValue *lastname;
if(!av)
valid=0;
else
{
firstname = av->getNVPair("FirstName");
lastname = av->getNVPair("LastName");
if(!firstname || !lastname)
valid=0;
if(valid)
sstr << "Counted scripts from " << objectCount << " attachments on " << firstname->getString() << " " << lastname->getString() << ": ";
}
if(!valid)
sstr << "Counted scripts from " << objectCount << " attachments on avatar: ";
}
else
{
if(doDelete)
sstr << "Deleted scripts in " << objectCount << " objects: ";
else
sstr << "Counted scripts in " << objectCount << " objects: ";
}
F32 throttle = gSavedSettings.getF32("OutBandwidth");
if(throttle != 0.f)
{
gMessageSystem->mPacketRing.setOutBandwidth(throttle);
gMessageSystem->mPacketRing.setUseOutThrottle(TRUE);
}
else
{
gMessageSystem->mPacketRing.setOutBandwidth(0.0);
gMessageSystem->mPacketRing.setUseOutThrottle(FALSE);
}
}
showResult();
}
else
countingDone=true;
}
}
示例6: mID
LLMute::LLMute(const LLUUID& id, const std::string& name, EType type, U32 flags)
: mID(id),
mName(name),
mType(type),
mFlags(flags)
{
// muting is done by root objects only - try to find this objects root
LLViewerObject* mute_object = get_object_to_mute_from_id(id);
if(mute_object && mute_object->getID() != id)
{
mID = mute_object->getID();
LLNameValue* firstname = mute_object->getNVPair("FirstName");
LLNameValue* lastname = mute_object->getNVPair("LastName");
if (firstname && lastname)
{
mName = LLCacheName::buildFullName(
firstname->getString(), lastname->getString());
}
mType = mute_object->isAvatar() ? AGENT : OBJECT;
}
}
示例7: handleTooltipObject
BOOL LLToolPie::handleTooltipObject( LLViewerObject* hover_object, std::string line, std::string tooltip_msg)
{
if ( hover_object->isHUDAttachment() )
{
// no hover tips for HUD elements, since they can obscure
// what the HUD is displaying
return TRUE;
}
if ( hover_object->isAttachment() )
{
// get root of attachment then parent, which is avatar
LLViewerObject* root_edit = hover_object->getRootEdit();
if (!root_edit)
{
// Strange parenting issue, don't show any text
return TRUE;
}
hover_object = (LLViewerObject*)root_edit->getParent();
if (!hover_object)
{
// another strange parenting issue, bail out
return TRUE;
}
}
line.clear();
if (hover_object->isAvatar())
{
// only show tooltip if same inspector not already open
LLFloater* existing_inspector = LLFloaterReg::findInstance("inspect_avatar");
if (!existing_inspector
|| !existing_inspector->getVisible()
|| existing_inspector->getKey()["avatar_id"].asUUID() != hover_object->getID())
{
std::string avatar_name;
LLNameValue* firstname = hover_object->getNVPair("FirstName");
LLNameValue* lastname = hover_object->getNVPair("LastName");
if (firstname && lastname)
{
avatar_name = llformat("%s %s", firstname->getString(), lastname->getString());
}
else
{
avatar_name = LLTrans::getString("TooltipPerson");
}
// *HACK: We may select this object, so pretend it was clicked
mPick = mHoverPick;
LLInspector::Params p;
p.fillFrom(LLUICtrlFactory::instance().getDefaultParams<LLInspector>());
p.message(avatar_name);
p.image.name("Inspector_I");
p.click_callback(boost::bind(showAvatarInspector, hover_object->getID()));
p.visible_time_near(6.f);
p.visible_time_far(3.f);
p.delay_time(0.35f);
p.wrap(false);
LLToolTipMgr::instance().show(p);
}
}
else
{
//
// We have hit a regular object (not an avatar or attachment)
//
//
// Default prefs will suppress display unless the object is interactive
//
bool show_all_object_tips =
(bool)gSavedSettings.getBOOL("ShowAllObjectHoverTip");
LLSelectNode *nodep = LLSelectMgr::getInstance()->getHoverNode();
// only show tooltip if same inspector not already open
LLFloater* existing_inspector = LLFloaterReg::findInstance("inspect_object");
if (nodep &&
(!existing_inspector
|| !existing_inspector->getVisible()
|| existing_inspector->getKey()["object_id"].asUUID() != hover_object->getID()))
{
// Add price to tooltip for items on sale
bool for_sale = for_sale_selection(nodep);
if(for_sale)
{
LLStringUtil::format_map_t args;
S32 price = nodep->mSaleInfo.getSalePrice();
args["[AMOUNT]"] = LLResMgr::getInstance()->getMonetaryString(price);
tooltip_msg.append(LLTrans::getString("TooltipPrice", args) );
}
if (nodep->mName.empty())
{
tooltip_msg.append(LLTrans::getString("TooltipNoName"));
}
else
{
tooltip_msg.append( nodep->mName );
//.........这里部分代码省略.........
示例8: getObjectInfo
void LLFloaterReporter::getObjectInfo(const LLUUID& object_id)
{
// TODO --
// 1 need to send to correct simulator if object is not
// in same simulator as agent
// 2 display info in widget window that gives feedback that
// we have recorded the object info
// 3 can pick avatar ==> might want to indicate when a picked
// object is an avatar, attachment, or other category
mObjectID = object_id;
if (LLUUID::null != mObjectID)
{
// get object info for the user's benefit
LLViewerObject* objectp = NULL;
objectp = gObjectList.findObject( mObjectID );
if (objectp)
{
if ( objectp->isAttachment() )
{
objectp = (LLViewerObject*)objectp->getRoot();
mObjectID = objectp->getID();
}
// correct the region and position information
LLViewerRegion *regionp = objectp->getRegion();
if (regionp)
{
getChild<LLUICtrl>("sim_field")->setValue(regionp->getName());
LLVector3d global_pos;
global_pos.setVec(objectp->getPositionRegion());
setPosBox(global_pos);
}
if (objectp->isAvatar())
{
// we have the information we need
std::string object_owner;
LLNameValue* firstname = objectp->getNVPair("FirstName");
LLNameValue* lastname = objectp->getNVPair("LastName");
if (firstname && lastname)
{
object_owner.append(firstname->getString());
object_owner.append(1, ' ');
object_owner.append(lastname->getString());
}
else
{
object_owner.append("Unknown");
}
setFromAvatar(mObjectID, object_owner);
}
else
{
// we have to query the simulator for information
// about this object
LLMessageSystem* msg = gMessageSystem;
U32 request_flags = COMPLAINT_REPORT_REQUEST;
msg->newMessageFast(_PREHASH_RequestObjectPropertiesFamily);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg->nextBlockFast(_PREHASH_ObjectData);
msg->addU32Fast(_PREHASH_RequestFlags, request_flags );
msg->addUUIDFast(_PREHASH_ObjectID, mObjectID);
LLViewerRegion* regionp = objectp->getRegion();
msg->sendReliable( regionp->getHost() );
}
}
}
}
示例9: getObjectInfo
void LLFloaterReporter::getObjectInfo(const LLUUID& object_id)
{
// TODO --
// 1 need to send to correct simulator if object is not
// in same simulator as agent
// 2 display info in widget window that gives feedback that
// we have recorded the object info
// 3 can pick avatar ==> might want to indicate when a picked
// object is an avatar, attachment, or other category
mObjectID = object_id;
if (LLUUID::null != mObjectID)
{
// get object info for the user's benefit
LLViewerObject* objectp = NULL;
objectp = gObjectList.findObject( mObjectID );
if (objectp)
{
if ( objectp->isAttachment() )
{
objectp = (LLViewerObject*)objectp->getRoot();
}
// correct the region and position information
LLViewerRegion *regionp = objectp->getRegion();
if (regionp)
{
childSetText("sim_field", regionp->getName());
// [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a)
if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) )
{
childSetText("sim_field", RlvStrings::getString(RLV_STRING_HIDDEN_REGION));
}
// [/RLVa:KB]
LLVector3d global_pos;
global_pos.setVec(objectp->getPositionRegion());
setPosBox(global_pos);
}
if (objectp->isAvatar())
{
// we have the information we need
std::string object_owner;
LLNameValue* firstname = objectp->getNVPair("FirstName");
LLNameValue* lastname = objectp->getNVPair("LastName");
if (firstname && lastname)
{
object_owner.append(firstname->getString());
object_owner.append(1, ' ');
object_owner.append(lastname->getString());
}
else
{
object_owner.append("Unknown");
}
childSetText("object_name", object_owner);
// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) | Added: RVLa-1.0.0e
if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))
{
childSetVisible("object_name", false); // Hide the object name if the picked object represents an avataz
}
// [/RLVa:KB]
childSetText("owner_name", object_owner);
childSetText("abuser_name_edit", object_owner);
mAbuserID = object_id;
}
else
{
// we have to query the simulator for information
// about this object
LLSelectMgr::registerObjectPropertiesFamilyRequest(mObjectID);
LLMessageSystem* msg = gMessageSystem;
U32 request_flags = (mReportType == BUG_REPORT) ? BUG_REPORT_REQUEST : COMPLAINT_REPORT_REQUEST;
msg->newMessageFast(_PREHASH_RequestObjectPropertiesFamily);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg->nextBlockFast(_PREHASH_ObjectData);
msg->addU32Fast(_PREHASH_RequestFlags, request_flags );
msg->addUUIDFast(_PREHASH_ObjectID, mObjectID);
LLViewerRegion* regionp = objectp->getRegion();
msg->sendReliable( regionp->getHost() );
}
}
}
}
示例10: updateText
void LLHoverView::updateText()
{
LLViewerObject* hit_object = getLastHoverObject();
std::string line;
mText.clear();
if ( hit_object )
{
if ( hit_object->isHUDAttachment() )
{
// no hover tips for HUD elements, since they can obscure
// what the HUD is displaying
return;
}
if ( hit_object->isAttachment() )
{
// get root of attachment then parent, which is avatar
LLViewerObject* root_edit = hit_object->getRootEdit();
if (!root_edit)
{
// Strange parenting issue, don't show any text
return;
}
hit_object = (LLViewerObject*)root_edit->getParent();
if (!hit_object)
{
// another strange parenting issue, bail out
return;
}
}
line.clear();
if (hit_object->isAvatar())
{
LLNameValue* title = hit_object->getNVPair("Title");
LLNameValue* firstname = hit_object->getNVPair("FirstName");
LLNameValue* lastname = hit_object->getNVPair("LastName");
if (firstname && lastname)
{
// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e)
if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))
{
line = RlvStrings::getAnonym(line.append(firstname->getString()).append(1, ' ').append(lastname->getString()));
}
else
{
// [/RLVa:KB]
if (title)
{
line.append(title->getString());
line.append(1, ' ');
}
line.append(firstname->getString());
line.append(1, ' ');
line.append(lastname->getString());
// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e)
}
// [/RLVa:KB]
}
else
{
line.append(LLTrans::getString("TooltipPerson"));
}
mText.push_back(line);
}
else
{
//
// We have hit a regular object (not an avatar or attachment)
//
//
// Default prefs will suppress display unless the object is interactive
//
BOOL suppressObjectHoverDisplay = !gSavedSettings.getBOOL("ShowAllObjectHoverTip");
LLSelectNode *nodep = LLSelectMgr::getInstance()->getHoverNode();;
if (nodep)
{
line.clear();
if (nodep->mName.empty())
{
line.append(LLTrans::getString("TooltipNoName"));
}
else
{
line.append( nodep->mName );
}
mText.push_back(line);
if (!nodep->mDescription.empty()
&& nodep->mDescription != DEFAULT_DESC)
{
mText.push_back( nodep->mDescription );
}
// Line: "Owner: James Linden"
line.clear();
line.append(LLTrans::getString("TooltipOwner") + " ");
//.........这里部分代码省略.........
示例11: updateText
void LLHoverView::updateText()
{
LLViewerObject* hit_object = getLastHoverObject();
std::string line;
//<singu>
if (hit_object == mLastTextHoverObject &&
!(mLastTextHoverObjectTimer.getStarted() && mLastTextHoverObjectTimer.hasExpired()))
{
// mText is already up to date.
return;
}
mLastTextHoverObject = hit_object;
mLastTextHoverObjectTimer.stop();
bool retrieving_data = false;
//</singu>
mText.clear();
if ( hit_object )
{
if ( hit_object->isHUDAttachment() )
{
// no hover tips for HUD elements, since they can obscure
// what the HUD is displaying
return;
}
if ( hit_object->isAttachment() )
{
// get root of attachment then parent, which is avatar
LLViewerObject* root_edit = hit_object->getRootEdit();
if (!root_edit)
{
// Strange parenting issue, don't show any text
return;
}
hit_object = (LLViewerObject*)root_edit->getParent();
if (!hit_object)
{
// another strange parenting issue, bail out
return;
}
}
line.clear();
if (hit_object->isAvatar())
{
LLNameValue* title = hit_object->getNVPair("Title");
LLNameValue* firstname = hit_object->getNVPair("FirstName");
LLNameValue* lastname = hit_object->getNVPair("LastName");
if (firstname && lastname)
{
// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e)
if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))
{
line = RlvStrings::getAnonym(line.append(firstname->getString()).append(1, ' ').append(lastname->getString()));
}
else
{
// [/RLVa:KB]
std::string complete_name;
if (!LLAvatarNameCache::getNSName(hit_object->getID(), complete_name))
complete_name = firstname->getString() + std::string(" ") + lastname->getString();
if (title)
{
line.append(title->getString());
line.append(1, ' ');
}
line += complete_name;
// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e)
}
// [/RLVa:KB]
}
else
{
line.append(LLTrans::getString("TooltipPerson"));
}
mText.push_back(line);
}
else
{
//
// We have hit a regular object (not an avatar or attachment)
//
//
// Default prefs will suppress display unless the object is interactive
//
BOOL suppressObjectHoverDisplay = !gSavedSettings.getBOOL("ShowAllObjectHoverTip");
LLSelectNode *nodep = LLSelectMgr::getInstance()->getHoverNode();
if (nodep)
{
line.clear();
bool for_copy = nodep->mValid && nodep->mPermissions->getMaskEveryone() & PERM_COPY && hit_object && hit_object->permCopy();
bool for_sale = nodep->mValid && for_sale_selection(nodep);
//.........这里部分代码省略.........
示例12: completechk
void ScriptCounter::completechk()
{
std::string user_msg;
llinfos << "Completechk called." << llendl;
if(invqueries == 0)
{
llinfos << "InvQueries = 0..." << llendl;
if(reqObjectID.isNull())
{
llinfos << "reqObjectId is null..." << llendl;
if(foo->isAvatar())
{
int valid=1;
LLVOAvatar *av=find_avatar_from_object(foo);
LLNameValue *firstname;
LLNameValue *lastname;
if(!av)
valid=0;
else
{
firstname = av->getNVPair("FirstName");
lastname = av->getNVPair("LastName");
if(!firstname || !lastname)
valid=0;
if(valid)
{
user_msg = llformat("Counted %u scripts in %u attachments on %s %s.", scriptcount, objectCount, firstname->getString() , lastname->getString());
//sstr << "Counted scripts from " << << " attachments on " << firstname->getString() << " " << lastname->getString() << ": ";
}
}
if(!valid)
{
user_msg = llformat("Counted %u scripts in %u attachments on selected avatar.", scriptcount, objectCount);
//sstr << "Counted scripts from " << objectCount << " attachments on avatar: ";
}
}
else
{
if(doDelete)
{
user_msg = llformat("Deleted %u scripts in %u objects.", scriptcount, objectCount);
//sstr << "Deleted scripts in " << objectCount << " objects: ";
}
else
{
user_msg = llformat("Counted %u scripts in %u objects.", scriptcount, objectCount);
//sstr << "Counted scripts in " << objectCount << " objects: ";
}
}
F32 throttle = gSavedSettings.getF32("OutBandwidth");
if(throttle != 0.f)
{
gMessageSystem->mPacketRing.setOutBandwidth(throttle);
gMessageSystem->mPacketRing.setUseOutThrottle(TRUE);
}
else
{
gMessageSystem->mPacketRing.setOutBandwidth(0.0);
gMessageSystem->mPacketRing.setUseOutThrottle(FALSE);
}
llinfos << "Sending readout to chat..." << llendl;
showResult(user_msg);
}
else
countingDone=true;
}
}