这篇教程C++ Empty函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中Empty函数的典型用法代码示例。如果您正苦于以下问题:C++ Empty函数的具体用法?C++ Empty怎么用?C++ Empty使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了Empty函数的26个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: switchint Panel::ProcessKey(int Key, unsigned int ControlState) { switch (Key) { case VK_F3: if (ControlState == PKF_SHIFT) { return true; } break; case VK_F4: switch (ControlState) { case 0: DlgShutdown(); return true; case PKF_SHIFT: return true; } break; case VK_F6: switch (ControlState) { case 0: if (DlgConnection()) { psi.Control(this, FCTL_UPDATEPANEL, 0, nullptr); psi.Control(this, FCTL_REDRAWPANEL, 0, nullptr); } return true; case PKF_SHIFT: try { m_conn->Open(nullptr); } catch (WinError &e) { farebox_code(e.code(), e.where().c_str()); } psi.Control(this, FCTL_UPDATEPANEL, 0, nullptr); psi.Control(this, FCTL_REDRAWPANEL, 0, nullptr); return true; } break; case VK_F7: switch (ControlState) { case 0: AutoUTF cmd = L"mstsc.exe"; if (!Empty(m_conn->host())) { cmd += L" /v:"; cmd += m_conn->host(); } ExecCMD(cmd); return true; } break; } if ((ControlState == 0 && (Key == VK_F3 || Key == VK_F5 || Key == VK_F8)) || (ControlState == PKF_SHIFT && (Key == VK_F7 || Key == VK_F8))) { FarPnl pInfo(this, FCTL_GETPANELINFO); WinTS::iterator m_cur; if (pInfo.ItemsNumber() && pInfo.CurrentItem() && (m_cur = std::find(m_ts.begin(), m_ts.end(), pInfo[pInfo.CurrentItem()].FindData.nFileSize)) != m_ts.end()) { if (ControlState == 0 && Key == VK_F3) { AutoUTF tmp(TempFile(TempDir())); HANDLE hfile = ::CreateFileW(tmp.c_str(), GENERIC_WRITE, 0, nullptr, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, nullptr); if (hfile != INVALID_HANDLE_VALUE) { FileWrite(hfile, Info(m_cur)); ::CloseHandle(hfile); psi.Viewer(tmp.c_str(), nullptr, 0, 0, -1, -1, VF_DELETEONLYFILEONCLOSE | VF_ENABLE_F6 | VF_DISABLEHISTORY | VF_NONMODAL | VF_IMMEDIATERETURN, CP_AUTODETECT); } return true; } else if (ControlState == 0 && Key == VK_F5) { DlgMessage(m_cur->id()); } else if (ControlState == PKF_SHIFT && Key == VK_F7) { WinTSession::ConnectLocal(m_cur->id()); } else if (ControlState == 0 && Key == VK_F8) { if (farquestion(GetMsg(txtAreYouSure), GetMsg(txtDisconnectSession))) WinTSession::Disconnect(m_cur->id(), m_conn->host()); } else if (ControlState == PKF_SHIFT && Key == VK_F8) { if (farquestion(GetMsg(txtAreYouSure), GetMsg(txtLogoffSession))) WinTSession::LogOff(m_cur->id(), m_conn->host()); } psi.Control(this, FCTL_UPDATEPANEL, 0, nullptr); psi.Control(this, FCTL_REDRAWPANEL, 0, nullptr); return true; } } return false;}
开发者ID:IDA-RE-things,项目名称:andrew-grechkin,代码行数:83,
示例2: ObjectGuidbool ArenaTeam::LoadMembersFromDB(QueryResult* arenaTeamMembersResult){ if (!arenaTeamMembersResult) return false; bool captainPresentInTeam = false; do { Field* fields = arenaTeamMembersResult->Fetch(); // prevent crash if db records are broken, when all members in result are already processed and current team hasn't got any members if (!fields) break; uint32 arenaTeamId = fields[0].GetUInt32(); if (arenaTeamId < m_TeamId) { // there is in table arena_team_member record which doesn't have arenateamid in arena_team table, report error sLog.outErrorDb("ArenaTeam %u does not exist but it has record in arena_team_member table, deleting it!", arenaTeamId); CharacterDatabase.PExecute("DELETE FROM arena_team_member WHERE arenateamid = '%u'", arenaTeamId); continue; } if (arenaTeamId > m_TeamId) // we loaded all members for this arena_team already, break cycle break; ArenaTeamMember newmember; newmember.guid = ObjectGuid(HIGHGUID_PLAYER, fields[1].GetUInt32()); newmember.games_week = fields[2].GetUInt32(); newmember.wins_week = fields[3].GetUInt32(); newmember.games_season = fields[4].GetUInt32(); newmember.wins_season = fields[5].GetUInt32(); newmember.personal_rating = fields[6].GetUInt32(); newmember.name = fields[7].GetCppString(); newmember.Class = fields[8].GetUInt8(); // check if member exists in characters table if (newmember.name.empty()) { sLog.outErrorDb("ArenaTeam %u has member with empty name - probably player %s doesn't exist, deleting him from memberlist!", arenaTeamId, newmember.guid.GetString().c_str()); DelMember(newmember.guid); continue; } // arena team can't be > 2 * arenatype (2 for 2x2, 3 for 3x3, 5 for 5x5) if (GetMembersSize() >= GetMaxMembersSize()) return false; if (newmember.guid == GetCaptainGuid()) captainPresentInTeam = true; m_members.push_back(newmember); } while (arenaTeamMembersResult->NextRow()); if (Empty() || !captainPresentInTeam) { // arena team is empty or captain is not in team, delete from db sLog.outErrorDb("ArenaTeam %u does not have any members or its captain is not in team, disbanding it...", m_TeamId); return false; } return true;}
开发者ID:dazs1on,项目名称:wotlk-core,代码行数:64,
示例3: AddError//.........这里部分代码省略......... pro = xpro; xpro = NULL; Clear( rx->follow ); for( i = 0; i < x->kersize; ++i ) { ry = &x->name.state[i]->redun[at[i]]; if( ry->pro == pro ) { Union( rx->follow, ry->follow ); ++(at[i]); ++ry; } if( ry->pro > xpro ) { xpro = ry->pro; } } UnionAnd( conflict, rx->follow, defined ); Union( defined, rx->follow ); rx->pro = pro; ++rx; } xsym = NULL; for( i = 0; i < x->kersize; ++i ) { at[i] = 0; if( (sym = x->name.state[i]->trans->sym) > xsym ) { xsym = sym; } } tx = trans; while( xsym ) { sym = xsym; xsym = NULL; t = s; for( i = 0; i < x->kersize; ++i ) { ty = &x->name.state[i]->trans[at[i]]; if( ty->sym == sym ) { if( !IsMarked( *ty->state ) ) { Mark( *ty->state ); *t++ = ty->state; } ++(at[i]); ++ty; } if( ty->sym > xsym ) { xsym = ty->sym; } } tx->sym = sym; if( sym->pro ) { ++nvtrans; } else { if( IsBitSet( defined, sym->id ) ) { SetBit( conflict, sym->id ); while( --t >= s ) { Unmark( **t ); } continue; } else { SetBit( defined, sym->id ); } } tx->state = AddErrState( &errsym->enter, s, t ); ++tx; } x->trans = CALLOC( tx - trans + 1, a_shift_action ); memcpy( x->trans, trans, ((char *) tx) - ((char *) trans) ); if( Empty( conflict ) ) { redun->pro = NULL; i = 0; } else { i = 1; } while( --rx > redun ) { AndNot( rx->follow, conflict ); if( Empty( rx->follow ) ) { rx->pro = NULL; } else { ++i; } } x->redun = CALLOC( i + 1, a_reduce_action ); if( i ) { rset = CALLOC( i*wperset, a_word ); rx = redun; while( i > 0 ) { if( rx->pro ) { --i; x->redun[i].pro = rx->pro; x->redun[i].follow = rset; Assign( rset, rx->follow ); rset += wperset; } ++rx; } } } free( trans ); free( redun ); free( conflict ); free( s ); free( at );}
开发者ID:Ukusbobra,项目名称:open-watcom-v2,代码行数:101,
示例4: EmptyHDM::HDM(){ Mnemonic = "HDM"; Empty();}
开发者ID:SammyB428,项目名称:NMEA0183,代码行数:5,
示例5: EmptyVTG::~VTG(){ Mnemonic.Empty(); Empty();}
开发者ID:AluOne,项目名称:OpenCPN,代码行数:5,
示例6: peekint peek(Stack* stack){ if (Empty(stack)) return INT_MIN; return stack->array[stack->top];}
开发者ID:rahul-1903,项目名称:Algo_Ds_Notes,代码行数:6,
示例7: EmptyEmpty ReturnsEmpty::getEmpty(){ return Empty();}
开发者ID:farawayzheng,项目名称:CppSharp,代码行数:4,
示例8: EmptyCFX_ListCtrl::~CFX_ListCtrl() { Empty();}
开发者ID:MIPS,项目名称:external-pdfium,代码行数:3,
示例9: Front ValueType Front(void) { assert(!Empty()); return Element(_context, _current); }
开发者ID:AdamSimpson,项目名称:oglplus,代码行数:5,
示例10: CalculateBlobOrdervoid ResultIterator::CalculateBlobOrder( GenericVector<int> *blob_indices) const { bool context_is_ltr = current_paragraph_is_ltr_ ^ in_minor_direction_; blob_indices->clear(); if (Empty(RIL_WORD)) return; if (context_is_ltr || it_->word()->UnicharsInReadingOrder()) { // Easy! just return the blobs in order; for (int i = 0; i < word_length_; i++) blob_indices->push_back(i); return; } // The blobs are in left-to-right order, but the current reading context // is right-to-left. const int U_LTR = UNICHARSET::U_LEFT_TO_RIGHT; const int U_RTL = UNICHARSET::U_RIGHT_TO_LEFT; const int U_EURO_NUM = UNICHARSET::U_EUROPEAN_NUMBER; const int U_EURO_NUM_SEP = UNICHARSET::U_EUROPEAN_NUMBER_SEPARATOR; const int U_EURO_NUM_TERM = UNICHARSET::U_EUROPEAN_NUMBER_TERMINATOR; const int U_COMMON_NUM_SEP = UNICHARSET::U_COMMON_NUMBER_SEPARATOR; const int U_OTHER_NEUTRAL = UNICHARSET::U_OTHER_NEUTRAL; // Step 1: Scan for and mark European Number sequences // [:ET:]*[:EN:]+(([:ES:]|[:CS:])?[:EN:]+)*[:ET:]* GenericVector<int> letter_types; for (int i = 0; i < word_length_; i++) { letter_types.push_back(it_->word()->SymbolDirection(i)); } // Convert a single separtor sandwiched between two EN's into an EN. for (int i = 0; i + 2 < word_length_; i++) { if (letter_types[i] == U_EURO_NUM && letter_types[i + 2] == U_EURO_NUM && (letter_types[i + 1] == U_EURO_NUM_SEP || letter_types[i + 1] == U_COMMON_NUM_SEP)) { letter_types[i + 1] = U_EURO_NUM; } } // Scan for sequences of European Number Terminators around ENs and convert // them to ENs. for (int i = 0; i < word_length_; i++) { if (letter_types[i] == U_EURO_NUM_TERM) { int j = i + 1; while (j < word_length_ && letter_types[j] == U_EURO_NUM_TERM) { j++; } if (j < word_length_ && letter_types[j] == U_EURO_NUM) { // The sequence [i..j] should be converted to all European Numbers. for (int k = i; k < j; k++) letter_types[k] = U_EURO_NUM; } j = i - 1; while (j > -1 && letter_types[j] == U_EURO_NUM_TERM) { j--; } if (j > -1 && letter_types[j] == U_EURO_NUM) { // The sequence [j..i] should be converted to all European Numbers. for (int k = j; k <= i; k++) letter_types[k] = U_EURO_NUM; } } } // Step 2: Convert all remaining types to either L or R. // Sequences ([:L:]|[:EN:])+ (([:CS:]|[:ON:])+ ([:L:]|[:EN:])+)* -> L. // All other are R. for (int i = 0; i < word_length_;) { int ti = letter_types[i]; if (ti == U_LTR || ti == U_EURO_NUM) { // Left to right sequence; scan to the end of it. int last_good = i; for (int j = i + 1; j < word_length_; j++) { int tj = letter_types[j]; if (tj == U_LTR || tj == U_EURO_NUM) { last_good = j; } else if (tj == U_COMMON_NUM_SEP || tj == U_OTHER_NEUTRAL) { // do nothing. } else { break; } } // [i..last_good] is the L sequence for (int k = i; k <= last_good; k++) letter_types[k] = U_LTR; i = last_good + 1; } else { letter_types[i] = U_RTL; i++; } } // At this point, letter_types is entirely U_LTR or U_RTL. for (int i = word_length_ - 1; i >= 0;) { if (letter_types[i] == U_RTL) { blob_indices->push_back(i); i--; } else { // left to right sequence. scan to the beginning. int j = i - 1; for (; j >= 0 && letter_types[j] != U_RTL; j--) { } // pass // Now (j, i] is LTR for (int k = j + 1; k <= i; k++) blob_indices->push_back(k); i = j; } } ASSERT_HOST(blob_indices->size() == word_length_);}
开发者ID:koth,项目名称:yocr,代码行数:97,
示例11: Next void Next(void) { assert(!Empty()); ++_current; }
开发者ID:AdamSimpson,项目名称:oglplus,代码行数:5,
示例12: EmptyGraphType::~GraphType(){ Empty();}
开发者ID:matthewpanzner,项目名称:Cplusplus-DataStructures,代码行数:4,
示例13: EmptySATELLITE_DATA::~SATELLITE_DATA(){ Empty();}
开发者ID:SammyB428,项目名称:NMEA0183,代码行数:4,
示例14: _TVTG::VTG(){ Mnemonic = _T("VTG"); Empty();}
开发者ID:AluOne,项目名称:OpenCPN,代码行数:5,
示例15: IsOneTokenbool TokenSection::IsOneToken() const{ return !Empty() && Begin->next() == End;}
开发者ID:hxofgithub,项目名称:TscanCode,代码行数:4,
示例16: popint pop(Stack* stack){ if (Empty(stack)) return INT_MIN; return stack->array[stack->top--];}
开发者ID:rahul-1903,项目名称:Algo_Ds_Notes,代码行数:6,
示例17: EmptyInput::Input(){ Empty();}
开发者ID:Jancehk,项目名称:CTwDan,代码行数:4,
示例18: EmptyCVarDefMap::~CVarDefMap(){ Empty();}
开发者ID:roberpot,项目名称:Source,代码行数:4,
示例19: m_bufCDoubleZeroString::CDoubleZeroString(): m_buf(NULL){ m_ar.SetSize(0, 16); Empty();}
开发者ID:iskwa,项目名称:mm_STEP_M,代码行数:6,
示例20: EmptyCPointerList::~CPointerList(){ Empty();}
开发者ID:nilesflow,项目名称:BkImapFilter,代码行数:4,
示例21: EmptyCDoubleZeroString::~CDoubleZeroString(){ Empty();}
开发者ID:iskwa,项目名称:mm_STEP_M,代码行数:4,
示例22: const Node& List::front() { if (isEmpty()) throw Empty(); return *head;}
开发者ID:jakwuh,项目名称:bsu,代码行数:4,
示例23: EmptyCUPnpNatMappingKey::CUPnpNatMappingKey(void){ Empty();}
开发者ID:kevinzhwl,项目名称:easyMuleVeryCD,代码行数:4,
示例24: pop_frontvoid List::pop_front() { if (isEmpty()) throw Empty(); Node *tmp = head->next; delete head; head = tmp;}
开发者ID:jakwuh,项目名称:bsu,代码行数:6,
示例25: EmptyCUT_NNTPArticleList::~CUT_NNTPArticleList(){ Empty(); // Clear article list}
开发者ID:Omgan,项目名称:RealFTP.net,代码行数:4,
示例26: EmptyPriorityQueue::~PriorityQueue(){ Empty();}
开发者ID:Kartonschachtel,项目名称:public,代码行数:3,
注:本文中的Empty函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ EmptyCString函数代码示例 C++ Empires函数代码示例 |