本文整理汇总了C++中LLViewerTextEditor::getText方法的典型用法代码示例。如果您正苦于以下问题:C++ LLViewerTextEditor::getText方法的具体用法?C++ LLViewerTextEditor::getText怎么用?C++ LLViewerTextEditor::getText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLViewerTextEditor
的用法示例。
在下文中一共展示了LLViewerTextEditor::getText方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onNotecardLoadComplete
void lggAutoCorrectFloater::onNotecardLoadComplete(LLVFS *vfs,const LLUUID& asset_uuid,LLAssetType::EType type,void* user_data, S32 status, LLExtStat ext_status)
{
if(status == LL_ERR_NOERR)
{
S32 size = vfs->getSize(asset_uuid, type);
U8* buffer = new U8[size];
vfs->getData(asset_uuid, type, buffer, 0, size);
if(type == LLAssetType::AT_NOTECARD)
{
LLViewerTextEditor* edit = new LLViewerTextEditor("",LLRect(0,0,0,0),S32_MAX,"");
if(edit->importBuffer((char*)buffer, (S32)size))
{
llinfos << "decode success" << llendl;
std::string card = edit->getText();
edit->die();
LLSD info;
std::istringstream ins; // Declare an input string stream.
ins.str(card); // Specify string to read.
LLSDSerialize::fromXML(info,ins);
LGGAutoCorrect::getInstance()->addCorrectionList(info);
llinfos << "read success" << llendl;
sInstance->updateEnabledStuff();
}
else
{
llinfos << "decode error" << llendl;
}
}
}
else
{
llinfos << "read error" << llendl;
}
}
示例2: onNotecardLoadComplete
void LLFloaterAO::onNotecardLoadComplete(LLVFS *vfs,const LLUUID& asset_uuid,LLAssetType::EType type,void* user_data, S32 status, LLExtStat ext_status)
{
if(status == LL_ERR_NOERR)
{
S32 size = vfs->getSize(asset_uuid, type);
U8* buffer = new U8[size];
vfs->getData(asset_uuid, type, buffer, 0, size);
if(type == LLAssetType::AT_NOTECARD)
{
LLViewerTextEditor* edit = new LLViewerTextEditor("",LLRect(0,0,0,0),S32_MAX,"");
if(edit->importBuffer((char*)buffer, (S32)size))
{
llinfos << "ao nc decode success" << llendl;
std::string card = edit->getText();
edit->die();
LUA_CALL("OnAONotecardRead") << card << LUA_END;
mAOAllAnims.clear();
mAOStands.clear();
//mAODefaultAnims.clear();
struct_stands standsloader;
struct_all_anims all_anims_loader;
typedef boost::tokenizer<boost::char_separator<char> > tokenizer;
boost::char_separator<char> sep("\n");
tokenizer tokline(card, sep);
for (tokenizer::iterator line = tokline.begin(); line != tokline.end(); ++line)
{
std::string strline(*line);
boost::regex type("^(\\s*)(\\[ )(.*)( \\])");
boost::smatch what;
if (boost::regex_search(strline, what, type))
{
boost::char_separator<char> sep("|,");
std::string stranimnames(boost::regex_replace(strline, type, ""));
tokenizer tokanimnames(stranimnames, sep);
for (tokenizer::iterator anim = tokanimnames.begin(); anim != tokanimnames.end(); ++anim)
{
std::string strtoken(what[0]);
std::string stranim(*anim);
int state = GetStateFromToken(strtoken.c_str());
LLUUID animid(getAssetIDByName(stranim));
if (!(animid.notNull()))
{
cmdline_printchat(llformat("Warning: animation '%s' could not be found (Section: %s).",stranim.c_str(),strtoken.c_str()));
}
else
{
all_anims_loader.ao_id = animid; all_anims_loader.anim_name = stranim.c_str(); all_anims_loader.state = state; mAOAllAnims.push_back(all_anims_loader);
if (state == STATE_AGENT_STAND)
{
standsloader.ao_id = animid; standsloader.anim_name = stranim.c_str(); mAOStands.push_back(standsloader);
continue;
}
for (std::vector<struct_default_anims>::iterator iter = mAODefaultAnims.begin(); iter != mAODefaultAnims.end(); ++iter)
{
if (state == iter->state) iter->ao_id = animid;
}
}
}
}
}
llinfos << "ao nc read sucess" << llendl;
loadComboBoxes();
run();
}
else
{
llinfos << "ao nc decode error" << llendl;
}
}
}
else
{
llinfos << "ao nc read error" << llendl;
}
}