本文整理汇总了C++中LLSD::asString方法的典型用法代码示例。如果您正苦于以下问题:C++ LLSD::asString方法的具体用法?C++ LLSD::asString怎么用?C++ LLSD::asString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLSD
的用法示例。
在下文中一共展示了LLSD::asString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: expected
void sd_object::test<12>()
{
std::string expected("mytest\\");
std::stringstream str;
str << "'" << LLSDNotationFormatter::escapeString(expected) << "'";
LLSD sd;
S32 count = LLSDSerialize::fromNotation(sd, str);
ensure_equals("parse count", count, 1);
ensure_equals("string value", sd.asString(), expected);
}
示例2:
std::string convert_from_llsd<std::string>(const LLSD& sd, eControlType type, const std::string& control_name)
{
if (type == TYPE_STRING)
return sd.asString();
else
{
CONTROL_ERRS << "Invalid string value for " << control_name << ": " << sd << llendl;
return LLStringUtil::null;
}
}
示例3: onMessage
bool LLMainLoopRepeater::onMessage(LLSD const & event)
{
try {
mQueue->pushFront(event);
} catch(LLThreadSafeQueueError & e) {
LL_WARNS() << "could not repeat message (" << e.what() << ")" <<
event.asString() << LL_ENDL;
}
return false;
}
示例4: onCommitLine
void JCFloaterAreaSearch::onCommitLine(LLUICtrl* caller, const LLSD& value, OBJECT_COLUMN_ORDER type)
{
std::string text = value.asString();
LLStringUtil::toLower(text);
caller->setValue(text);
mFilterStrings[type] = text;
//llinfos << "loaded " << name << " with "<< text << llendl;
checkRegion();
results();
}
示例5: onOpen
// virtual
void LLFloaterWorldMap::onOpen(const LLSD& key)
{
//MK
if (gRRenabled && (
gAgent.mRRInterface.mContainsShowworldmap
|| gAgent.mRRInterface.mContainsShowloc))
{
// return;
}
//mk
bool center_on_target = (key.asString() == "center");
mIsClosing = FALSE;
LLWorldMapView* map_panel;
map_panel = (LLWorldMapView*)gFloaterWorldMap->mPanel;
map_panel->clearLastClick();
{
// reset pan on show, so it centers on you again
if (!center_on_target)
{
LLWorldMapView::setPan(0, 0, TRUE);
}
map_panel->updateVisibleBlocks();
// Reload items as they may have changed
LLWorldMap::getInstance()->reloadItems();
// We may already have a bounding box for the regions of the world,
// so use that to adjust the view.
adjustZoomSliderBounds();
// Could be first show
//LLFirstUse::useMap();
// Start speculative download of landmarks
const LLUUID landmark_folder_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_LANDMARK);
LLInventoryModelBackgroundFetch::instance().start(landmark_folder_id);
getChild<LLUICtrl>("location")->setFocus( TRUE);
gFocusMgr.triggerFocusFlash();
buildAvatarIDList();
buildLandmarkIDLists();
// If nothing is being tracked, set flag so the user position will be found
mSetToUserPosition = ( LLTracker::getTrackingStatus() == LLTracker::TRACKING_NOTHING );
}
if (center_on_target)
{
centerOnTarget(FALSE);
}
}
示例6: onAddAction
void LLLandmarksPanel::onAddAction(const LLSD& userdata) const
{
LLFolderViewModelItemInventory* view_model = getCurSelectedViewModelItem();
LLFolderViewItem* item = getCurSelectedItem();
std::string command_name = userdata.asString();
if("add_landmark" == command_name)
{
LLViewerInventoryItem* landmark = LLLandmarkActions::findLandmarkForAgentPos();
if(landmark)
{
LLNotificationsUtil::add("LandmarkAlreadyExists");
}
else
{
LLFloaterSidePanelContainer::showPanel("places", LLSD().with("type", "create_landmark"));
}
}
else if ("category" == command_name)
{
if (item && mCurrentSelectedList == mLandmarksInventoryPanel)
{
LLFolderViewModelItem* folder_bridge = NULL;
if (view_model->getInventoryType()
== LLInventoryType::IT_LANDMARK)
{
// for a landmark get parent folder bridge
folder_bridge = item->getParentFolder()->getViewModelItem();
}
else if (view_model->getInventoryType()
== LLInventoryType::IT_CATEGORY)
{
// for a folder get its own bridge
folder_bridge = view_model;
}
menu_create_inventory_item(mCurrentSelectedList,
dynamic_cast<LLFolderBridge*> (folder_bridge), LLSD(
"category"), gInventory.findCategoryUUIDForType(
LLFolderType::FT_LANDMARK));
}
else
{
//in case My Landmarks tab is completely empty (thus cannot be determined as being selected)
menu_create_inventory_item(mLandmarksInventoryPanel, NULL, LLSD("category"),
gInventory.findCategoryUUIDForType(LLFolderType::FT_LANDMARK));
if (mMyLandmarksAccordionTab)
{
mMyLandmarksAccordionTab->changeOpenClose(false);
}
}
}
}
示例7: setValue
// virtual
void LLIconCtrl::setValue(const LLSD& value )
{
if (value.isUUID())
{
setImage(value.asUUID());
}
else
{
setImage(value.asString());
}
}
示例8: onContextMenuItemEnable
bool LLGroupList::onContextMenuItemEnable(const LLSD& userdata)
{
LLUUID selected_group_id = getSelectedUUID();
bool real_group_selected = selected_group_id.notNull(); // a "real" (not "none") group is selected
// each group including "none" can be activated
// if (userdata.asString() == "activate")
// return gAgent.getGroupID() != selected_group_id;
// [RLVa:KB] - Checked: 2011-03-28 (RLVa-1.4.1a) | Added: RLVa-1.3.0f
if (userdata.asString() == "activate")
return (gAgent.getGroupID() != selected_group_id) && (!gRlvHandler.hasBehaviour(RLV_BHVR_SETGROUP));
else if (userdata.asString() == "leave")
return (real_group_selected) && ((gAgent.getGroupID() != selected_group_id) || (!gRlvHandler.hasBehaviour(RLV_BHVR_SETGROUP)));
// [/RLVa:KB]
if (userdata.asString() == "call")
return real_group_selected && LLVoiceClient::getInstance()->voiceEnabled() && LLVoiceClient::getInstance()->isVoiceWorking();
return real_group_selected;
}
示例9: onCreate
void onCreate(const LLSD& data)
{
LLWearableType::EType type = LLWearableType::typeNameToType(data.asString());
if (type == LLWearableType::WT_NONE)
{
llwarns << "Invalid wearable type" << llendl;
return;
}
LLAgentWearables::createWearable(type, true);
}
示例10: isActionEnabled
bool LLPanelPicks::isActionEnabled(const LLSD& userdata) const
{
std::string command_name = userdata.asString();
if (command_name == "new_pick" && LLAgentPicksInfo::getInstance()->isPickLimitReached())
{
return false;
}
return true;
}
示例11: setValue
// virtual
// value might be a string or a UUID
void LLIconCtrl::setValue(const LLSD& value )
{
LLSD tvalue(value);
if (value.isString() && LLUUID::validate(value.asString()))
{
//RN: support UUIDs masquerading as strings
tvalue = LLSD(LLUUID(value.asString()));
}
LLUICtrl::setValue(tvalue);
if (tvalue.isUUID())
{
mImagep = LLUI::getUIImageByID(tvalue.asUUID(), mPriority);
}
else
{
mImagep = LLUI::getUIImage(tvalue.asString(), mPriority);
}
setIconImageDrawSize();
}
示例12: onDeleteEntry
// called when the Delete Entry button is pressed
void LLFloaterAutoReplaceSettings::onDeleteEntry()
{
LLSD selectedRow = mReplacementsList->getSelectedValue();
if (selectedRow.isDefined())
{
std::string keyword = selectedRow.asString();
mReplacementsList->deleteSelectedItems(); // delete from the control
mSettings.removeEntryFromList(keyword, mSelectedListName); // delete from the local settings copy
disableReplacementEntry(); // no selection active, so turn off the buttons
}
}
示例13: onLocationPrearrange
void LLLocationInputCtrl::onLocationPrearrange(const LLSD& data)
{
std::string filter = data.asString();
rebuildLocationHistory(filter);
//Let's add landmarks to the top of the list if any
if(!filter.empty() )
{
LLInventoryModel::item_array_t landmark_items = LLLandmarkActions::fetchLandmarksByName(filter, TRUE);
for(U32 i=0; i < landmark_items.size(); i++)
{
LLSD value;
//TODO:: DO we need tooltip for Landmark??
value["item_type"] = LANDMARK;
value["AssetUUID"] = landmark_items[i]->getAssetUUID();
add(landmark_items[i]->getName(), value);
}
//Let's add teleport history items
LLTeleportHistory* th = LLTeleportHistory::getInstance();
LLTeleportHistory::slurl_list_t th_items = th->getItems();
std::set<std::string> new_item_titles;// duplicate control
LLTeleportHistory::slurl_list_t::iterator result = std::find_if(
th_items.begin(), th_items.end(), boost::bind(
&LLLocationInputCtrl::findTeleportItemsByTitle, this,
_1, filter));
while (result != th_items.end())
{
//mTitile format - region_name[, parcel_name]
//mFullTitile format - region_name[, parcel_name] (local_x,local_y, local_z)
if (new_item_titles.insert(result->mFullTitle).second)
{
LLSD value;
value["item_type"] = TELEPORT_HISTORY;
value["global_pos"] = result->mGlobalPos.getValue();
std::string region_name = result->mTitle.substr(0, result->mTitle.find(','));
//TODO*: add Surl to teleportitem or parse region name from title
value["tooltip"] = LLSLURL::buildSLURLfromPosGlobal(region_name,
result->mGlobalPos, false);
add(result->getTitle(), value);
}
result = std::find_if(result + 1, th_items.end(), boost::bind(
&LLLocationInputCtrl::findTeleportItemsByTitle, this,
_1, filter));
}
}
sortByName();
mList->mouseOverHighlightNthItem(-1); // Clear highlight on the last selected item.
}
示例14: setSortBy
void LLPanelMainInventory::setSortBy(const LLSD& userdata)
{
std::string sort_field = userdata.asString();
if (sort_field == "name")
{
U32 order = getActivePanel()->getSortOrder();
getActivePanel()->setSortOrder( order & ~LLInventoryFilter::SO_DATE );
gSavedSettings.setBOOL("Inventory.SortByName", TRUE );
gSavedSettings.setBOOL("Inventory.SortByDate", FALSE );
}
else if (sort_field == "date")
{
U32 order = getActivePanel()->getSortOrder();
getActivePanel()->setSortOrder( order | LLInventoryFilter::SO_DATE );
gSavedSettings.setBOOL("Inventory.SortByName", FALSE );
gSavedSettings.setBOOL("Inventory.SortByDate", TRUE );
}
else if (sort_field == "foldersalwaysbyname")
{
U32 order = getActivePanel()->getSortOrder();
if ( order & LLInventoryFilter::SO_FOLDERS_BY_NAME )
{
order &= ~LLInventoryFilter::SO_FOLDERS_BY_NAME;
gSavedSettings.setBOOL("Inventory.FoldersAlwaysByName", FALSE );
}
else
{
order |= LLInventoryFilter::SO_FOLDERS_BY_NAME;
gSavedSettings.setBOOL("Inventory.FoldersAlwaysByName", TRUE );
}
getActivePanel()->setSortOrder( order );
}
else if (sort_field == "systemfolderstotop")
{
U32 order = getActivePanel()->getSortOrder();
if ( order & LLInventoryFilter::SO_SYSTEM_FOLDERS_TO_TOP )
{
order &= ~LLInventoryFilter::SO_SYSTEM_FOLDERS_TO_TOP;
gSavedSettings.setBOOL("Inventory.SystemFoldersToTop", FALSE );
}
else
{
order |= LLInventoryFilter::SO_SYSTEM_FOLDERS_TO_TOP;
gSavedSettings.setBOOL("Inventory.SystemFoldersToTop", TRUE );
}
getActivePanel()->setSortOrder( order );
}
}
示例15: init
bool LLCrashLogger::init()
{
// We assume that all the logs we're looking for reside on the current drive
gDirUtilp->initAppDirs("SecondLife");
// Default to the product name "Second Life" (this is overridden by the -name argument)
mProductName = "Second Life";
mCrashSettings.declareS32(CRASH_BEHAVIOR_SETTING, CRASH_BEHAVIOR_ASK, "Controls behavior when viewer crashes "
"(0 = ask before sending crash report, 1 = always send crash report, 2 = never send crash report)");
llinfos << "Loading crash behavior setting" << llendl;
mCrashBehavior = loadCrashBehaviorSetting();
//Run through command line options
if(getOption("previous").isDefined())
{
llinfos << "Previous execution did not remove SecondLife.exec_marker" << llendl;
mCrashInPreviousExec = TRUE;
}
if(getOption("dialog").isDefined())
{
llinfos << "Show the user dialog" << llendl;
mCrashBehavior = CRASH_BEHAVIOR_ASK;
}
LLSD name = getOption("name");
if(name.isDefined())
{
mProductName = name.asString();
}
// If user doesn't want to send, bail out
if (mCrashBehavior == CRASH_BEHAVIOR_NEVER_SEND)
{
llinfos << "Crash behavior is never_send, quitting" << llendl;
return false;
}
gServicePump = new LLPumpIO(gAPRPoolp);
gServicePump->prime(gAPRPoolp);
LLHTTPClient::setPump(*gServicePump);
//If we've opened the crash logger, assume we can delete the marker file if it exists
if( gDirUtilp )
{
std::string marker_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,"SecondLife.exec_marker");
ll_apr_file_remove( marker_file );
}
return true;
}