本文整理汇总了C++中LLString::length方法的典型用法代码示例。如果您正苦于以下问题:C++ LLString::length方法的具体用法?C++ LLString::length怎么用?C++ LLString::length使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLString
的用法示例。
在下文中一共展示了LLString::length方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: performQuery
// virtual
void LLPanelDirPlaces::performQuery()
{
LLString name = childGetValue("name").asString();
if (name.length() < mMinSearchChars)
{
return;
}
LLString catstring = childGetValue("Category").asString();
// Because LLParcel::C_ANY is -1, must do special check
S32 category = 0;
if (catstring == "any")
{
category = LLParcel::C_ANY;
}
else
{
category = LLParcel::getCategoryFromString(catstring.c_str());
}
U32 flags = 0x0;
bool adult_enabled = gAgent.canAccessAdult();
bool mature_enabled = gAgent.canAccessMature();
if (gSavedSettings.getBOOL("ShowPGSims") ||
(!adult_enabled && !mature_enabled)) // if they can't have either of the others checked, force this one true
{
flags |= DFQ_INC_PG;
}
if( gSavedSettings.getBOOL("ShowMatureSims") && mature_enabled)
{
flags |= DFQ_INC_MATURE;
}
if( gSavedSettings.getBOOL("ShowAdultSims") && adult_enabled)
{
flags |= DFQ_INC_ADULT;
}
// Pack old query flag in case we are talking to an old server
if ( ((flags & DFQ_INC_PG) == DFQ_INC_PG) && !((flags & DFQ_INC_MATURE) == DFQ_INC_MATURE) )
{
flags |= DFQ_PG_PARCELS_ONLY;
}
if (0x0 == flags)
{
LLNotifyBox::showXml("NoContentToSearch");
return;
}
queryCore(name, category, flags);
}
示例2: process_secondlife_url
BOOL process_secondlife_url(LLString url)
{
S32 strpos, strpos2;
LLString slurlID = "slurl.com/secondlife/";
strpos = url.find(slurlID);
if (strpos < 0)
{
slurlID="secondlife://";
strpos = url.find(slurlID);
}
if (strpos >= 0)
{
LLString simname;
strpos+=slurlID.length();
strpos2=url.find("/",strpos);
if (strpos2 < strpos) strpos2=url.length();
simname="secondlife://" + url.substr(strpos,url.length() - strpos);
LLURLSimString::setString( simname );
LLURLSimString::parse();
// if there is a world map
if ( gFloaterWorldMap )
{
// mark where the destination is
gFloaterWorldMap->trackURL( LLURLSimString::sInstance.mSimName.c_str(),
LLURLSimString::sInstance.mX,
LLURLSimString::sInstance.mY,
LLURLSimString::sInstance.mZ );
// display map
LLFloaterWorldMap::show( NULL, TRUE );
};
return TRUE;
}
return FALSE;
}
示例3: saveIfNeeded
bool LLPreviewNotecard::saveIfNeeded(LLInventoryItem* copyitem)
{
if(!gAssetStorage)
{
llwarns << "Not connected to an asset storage system." << llendl;
return false;
}
LLViewerTextEditor* editor = LLViewerUICtrlFactory::getViewerTextEditorByName(this, "Notecard Editor");
if(!editor->isPristine())
{
// We need to update the asset information
LLTransactionID tid;
LLAssetID asset_id;
tid.generate();
asset_id = tid.makeAssetID(gAgent.getSecureSessionID());
LLVFile file(gVFS, asset_id, LLAssetType::AT_NOTECARD, LLVFile::APPEND);
LLString buffer;
if (!editor->exportBuffer(buffer))
{
return false;
}
editor->makePristine();
S32 size = buffer.length() + 1;
file.setMaxSize(size);
file.write((U8*)buffer.c_str(), size);
const LLInventoryItem* item = getItem();
// save it out to database
if (item)
{
std::string agent_url = gAgent.getRegion()->getCapability("UpdateNotecardAgentInventory");
std::string task_url = gAgent.getRegion()->getCapability("UpdateNotecardTaskInventory");
if (mObjectUUID.isNull() && !agent_url.empty())
{
// Saving into agent inventory
mAssetStatus = PREVIEW_ASSET_LOADING;
setEnabled(FALSE);
LLSD body;
body["item_id"] = mItemUUID;
llinfos << "Saving notecard " << mItemUUID
<< " into agent inventory via " << agent_url << llendl;
LLHTTPClient::post(agent_url, body,
new LLUpdateAgentInventoryResponder(body, asset_id, LLAssetType::AT_NOTECARD));
}
else if (!mObjectUUID.isNull() && !task_url.empty())
{
// Saving into task inventory
mAssetStatus = PREVIEW_ASSET_LOADING;
setEnabled(FALSE);
LLSD body;
body["task_id"] = mObjectUUID;
body["item_id"] = mItemUUID;
llinfos << "Saving notecard " << mItemUUID << " into task "
<< mObjectUUID << " via " << task_url << llendl;
LLHTTPClient::post(task_url, body,
new LLUpdateTaskInventoryResponder(body, asset_id, LLAssetType::AT_NOTECARD));
}
else if (gAssetStorage)
{
LLSaveNotecardInfo* info = new LLSaveNotecardInfo(this, mItemUUID, mObjectUUID,
tid, copyitem);
gAssetStorage->storeAssetData(tid, LLAssetType::AT_NOTECARD,
&onSaveComplete,
(void*)info,
FALSE);
}
}
}
return true;
}