strresult_t StringRemove(string_t * ap_this, u32_t a_begin, u32_t a_end) { strresult_t l_code = STRING_NOSTRING; if (ap_this) { if (a_begin >= ap_this->size && a_begin > a_end) { l_code = STRING_UNMODIFIED; } else { if (a_end >= ap_this->size) { l_code = StringCut(ap_this,a_begin); } else { string_t * lp_tmp = StringSubStr(ap_this,a_end+1,ap_this->size); if (lp_tmp) { l_code = StringCut(ap_this,a_begin); if (l_code) { l_code = StringStrAppend(ap_this,lp_tmp->str); } DelString(lp_tmp); } else { l_code = STRING_ALLOCERROR; } } } } return l_code; }
/** Remove in the configuration a parameter of the type STRING \retval EIMDW_NOT_OK exception; when section is not found \retval EIDMW_ERR_PARAM_BAD exception; when parameter could not be modified \sa SetString(), GetString(), SetLong(), GetLong(), DelLong() *************************************************************************************/ void CConfig::DelString( tLocation location, /**< In: tells to use the SYSTEM or USER configuration = CConfig::SYSTEM or CConfig::USER*/ const struct Param_Str param /**< In: parameter struct */ ) { return(DelString(location,param.csParam,param.csSection)); }
strresult_t StringStrInsert(string_t * ap_this, u32_t a_at, char const * ap_str) { strresult_t l_code = STRING_NOSTRING; if (ap_this) { if (ap_str && ap_str[0] != '\0') { if (a_at >= ap_this->size) { l_code = StringStrAppend(ap_this,ap_str); } else { string_t * lp_tmp = StringSubStr(ap_this,a_at,ap_this->size); if (lp_tmp) { l_code = StringCut(ap_this,a_at); if (l_code > 0) { l_code = StringStrAppend(ap_this,ap_str); if (l_code > 0) { l_code = StringStrAppend(ap_this,lp_tmp->str); } } DelString(lp_tmp); } } } else { l_code = STRING_UNMODIFIED; } } return l_code; }
void CConfig::DelLong( tLocation location, /**< In: tells to use the SYSTEM or USER configuration = CConfig::SYSTEM or CConfig::USER*/ const std::wstring &csName, /**< In: parameter name */ const std::wstring &czSection /**< In: the configuration-section where you can find above specified parameter */ ) { DelString(location, csName, czSection); }
INT32 CNetData::DelTString(TCHAR *pszOut, INT32 iSize) { //去掉libiconv库的依赖,避免iphone可能的移植问题,要发送的字符串内容全是utf8或者单字节字符集 /* #ifdef UNICODE return DelWString(pszOut,iSize); #else return DelString(pszOut,iSize); #endif */ return DelString(pszOut,iSize); }
bool AflStringHistory::AddString(LPCSTR pString) { if(!m_ppString) return false; int iIndex; iIndex = GetStringIndex(pString); if(iIndex == -1) { DelString(0); m_ppString[m_iCount-1] = new std::string; *m_ppString[m_iCount-1] = pString; } else { MoveLast(iIndex); } return true; }
//опис деструктора String::~String() { DelString(); }
DataEditorControl::DataEditorControl(Ui::MainWindow *ui) { //设置视图模型 mSoldierTableModule = new SoldierTableModule(this); mSoldierTableView = ui->soldierTableView; mSoldierTableView->setModel(mSoldierTableModule); mHorseTableModule = new HorseTableModule(this); mHorseTableView = ui->horseTableView; mHorseTableView->setModel(mHorseTableModule); mPWeaponTableModule = new PWeaponTableModule(this); mPWeaponTableView = ui->pweaponTableView; mPWeaponTableView->setModel(mPWeaponTableModule); mSWeaponTableModule = new SWeaponTableModule(this); mSWeaponTableView = ui->sweaponTableView; mSWeaponTableView->setModel(mSWeaponTableModule); mArmorTableModule = new ArmorTableModule(this); mArmorTableView = ui->armorTableView; mArmorTableView->setModel(mArmorTableModule); mShieldTableModule = new ShieldTableModule(this); mShieldTableView = ui->shieldTableView; mShieldTableView->setModel(mShieldTableModule); mSkillTableModule = new SkillTableModule(this); mSkillTableView = ui->skillTableView; mSkillTableView->setModel(mSkillTableModule); mEffectTableModule = new EffectTableModule(this); mEffectTableView = ui->effectTableView; mEffectTableView->setModel(mEffectTableModule); mSquadTableModule = new SquadTableModule(this); mSquadTableView = ui->squadTableView; mSquadTableView->setModel(mSquadTableModule); mSquadSkillTableModule = new SquadSkillTableModule(this); mSquadSkillTableView = ui->squadSkillTableView; mSquadSkillTableView->setModel(mSquadSkillTableModule); mStringTableModule = new StringTableModule(this); mStringTableView = ui->stringTableView; mStringTableView->setModel(mStringTableModule); mModBox = ui->modBox; mLangBox = ui->langBox; RefreshModList(); //连接消息 connect(ui->addMod,SIGNAL(clicked()),this,SLOT(AddMod())); connect(ui->addLang,SIGNAL(clicked()),this,SLOT(AddLang())); connect(ui->addSoldier,SIGNAL(clicked()),this,SLOT(AddSoldier())); connect(ui->delSoldier,SIGNAL(clicked()),this,SLOT(DelSoldier())); connect(ui->addHorse,SIGNAL(clicked()),this,SLOT(AddHorse())); connect(ui->delHorse,SIGNAL(clicked()),this,SLOT(DelHorse())); connect(ui->addPWeapon,SIGNAL(clicked()),this,SLOT(AddPWeapon())); connect(ui->delPWeapon,SIGNAL(clicked()),this,SLOT(DelPWeapon())); connect(ui->addSWeapon,SIGNAL(clicked()),this,SLOT(AddSWeapon())); connect(ui->delSWeapon,SIGNAL(clicked()),this,SLOT(DelSWeapon())); connect(ui->addArmor,SIGNAL(clicked()),this,SLOT(AddArmor())); connect(ui->delArmor,SIGNAL(clicked()),this,SLOT(DelArmor())); connect(ui->addShield,SIGNAL(clicked()),this,SLOT(AddShield())); connect(ui->delShield,SIGNAL(clicked()),this,SLOT(DelShield())); connect(ui->addSkill,SIGNAL(clicked()),this,SLOT(AddSkill())); connect(ui->delSkill,SIGNAL(clicked()),this,SLOT(DelSkill())); connect(ui->addEffect,SIGNAL(clicked()),this,SLOT(AddEffect())); connect(ui->delEffect,SIGNAL(clicked()),this,SLOT(DelEffect())); connect(ui->addSquad,SIGNAL(clicked()),this,SLOT(AddSquad())); connect(ui->delSquad,SIGNAL(clicked()),this,SLOT(DelSquad())); connect(ui->addSquadSkill,SIGNAL(clicked()),this,SLOT(AddSquadSkill())); connect(ui->delSquadSkill,SIGNAL(clicked()),this,SLOT(DelSquadSkill())); connect(ui->addString,SIGNAL(clicked()),this,SLOT(AddString())); connect(ui->delString,SIGNAL(clicked()),this,SLOT(DelString())); connect(ui->squadTableView,SIGNAL(clicked(const QModelIndex &)),this,SLOT(SelectSquad(const QModelIndex &))); }