当前位置: 首页>>代码示例>>C++>>正文


C++ Cut函数代码示例

本文整理汇总了C++中Cut函数的典型用法代码示例。如果您正苦于以下问题:C++ Cut函数的具体用法?C++ Cut怎么用?C++ Cut使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了Cut函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: Clear

char* PathBuffer::Set( const char* path )
{
	Clear();

	if ( !currentFsParam ) { return p.data(); }

	if ( currentFsParam->server[0] )
	{
		if ( currentFsParam->user[0] )
		{
			Cut( const_cast<char*>( currentFsParam->user ) );
			Cut( "@" );
		}

		Cut( const_cast<char*>( currentFsParam->server ) );
		Cut( "/" );
	}

	if ( path )
	{
		if ( path[0] == '/' ) { path++; }

		Cut( path );
	}

	return p.data();
}
开发者ID:Serguei666,项目名称:WalCommander,代码行数:27,代码来源:vfs-smb.cpp

示例2: v1

void TectonicPlateSimulation::randomCut(int n = 1) {
    for(int i = 0; i < n; i++) {
        if(drand48() < 0.5) {
            b2Vec2 v1(-20, drand48() * 40);
            b2Vec2 v2(20, drand48() * 40);
            Cut(v1, v2);
        } else {
            b2Vec2 v1(drand48() * 40 - 20, 0);
            b2Vec2 v2(drand48() * 40 - 20, 40);
            Cut(v1, v2);
        }
    }
}
开发者ID:bernhardfritz,项目名称:Bachelorarbeit,代码行数:13,代码来源:TectonicPlateSimulation.cpp

示例3: main

int main()
{
    int n, m, op;
    scanf("%d", &n);
    for (int i = 0; i < n; i++) scanf("%d", K + i);
    for (int i = 0; i < n; i++) Link(&T[i], &T[min(i + K[i], n)]);
    scanf("%d", &m);
    while (m--)
    {
        scanf("%d", &op);
        if (op == 1)
        {
            int x;
            scanf("%d", &x);
            makeRoot(&T[n]);
            access(&T[x]), splay(&T[x]);
            printf("%d\n", T[x].ch[0] ? T[x].ch[0]->sz : 0);
        }
        if (op == 2)
        {
            int x, y;
            scanf("%d%d", &x, &y);
            Cut(&T[x], &T[min(x + K[x], n)]);
            K[x] = y;
            Link(&T[x], &T[min(x + K[x], n)]);
        }
    }
    return 0;
}
开发者ID:crazymonkeylyc,项目名称:my_solutions,代码行数:29,代码来源:2002.cpp

示例4: TFile

void SkimFlatCat::Loop()
{

   if (fChain == 0) return;
   

   TFile *skimfile = new TFile("Skim.root","recreate"); 
   fChain->LoadTree(0); 
   
   TTree *newtree = fChain->CloneTree(0);
 
   
   Long64_t nentries = fChain->GetEntriesFast();
   Int_t nselected = 0;
   Long64_t nbytes = 0, nb = 0;
   for (Long64_t jentry=0; jentry<nentries;jentry++) {
     if(!(jentry%10000)) std::cout << jentry << " :  "<<  fChain->GetEntries() << std::endl; 
     Long64_t ientry = LoadTree(jentry);
   
     if (ientry < 0) break;
     nb = fChain->GetEntry(jentry);   nbytes += nb;
     
     if (Cut(ientry) < 0) continue;
     nselected++;
     
     newtree->Fill();
   }
   std::cout << "Selected " << nselected << " out of " << fChain->GetEntries() << std::endl; 
   newtree->Write();
   skimfile->Close();
}
开发者ID:jalmond,项目名称:LQanalyzer,代码行数:31,代码来源:SkimFlatCat.C

示例5: switch

void wxTextCtrl::OnKeyDown(wxKeyEvent& event)
{
    if ( event.GetModifiers() == wxMOD_CONTROL )
    {
        switch( event.GetKeyCode() )
        {
            case 'A':
                SelectAll();
                return;
            case 'C':
                if ( CanCopy() )
                    Copy() ;
                return;
            case 'V':
                if ( CanPaste() )
                    Paste() ;
                return;
            case 'X':
                if ( CanCut() )
                    Cut() ;
                return;
            default:
                break;
        }
    }
    // no, we didn't process it
    event.Skip();
}
开发者ID:CustomCardsOnline,项目名称:wxWidgets,代码行数:28,代码来源:textctrl_osx.cpp

示例6: cut_input

void cut_input (char *DICT_PATH, char *HMM_PATH, char *USER_DICT) {
  char *s;

  Jieba handle = NewJieba (DICT_PATH, HMM_PATH, USER_DICT);
  setlocale (LC_ALL, "");
  printf ("Chinese word segmentation\n=========================\n\n");

  while (s = getstr ()) {
    if (strcmp (s, "EOF") == 0) {
      free (s);
      printf ("bye\n");
      break;
    } else {
      size_t len = strlen (s);
      CJiebaWord* words = Cut (handle, s, len);
      CJiebaWord* x;
      for (x = words; x && x->word; x++) {
        /* printf ("%*.*s/", x->len, x->len, x->word); */
        printf ("%d ", x->len / CJIEBA_WCHAR_SIZE);
      }
      printf ("\n");
      free (s);
      FreeWords (words);
    }
  }
  FreeJieba (handle);
}
开发者ID:kanglmf,项目名称:emacs-chinese-word-segmentation,代码行数:27,代码来源:chinese-word-segmentation.c

示例7: Cut

 void Cut(const string& sentence,
       vector<string>& words,
       size_t max_word_len) const {
   vector<Word> tmp;
   Cut(sentence, tmp, max_word_len);
   GetStringsFromWords(tmp, words);
 }
开发者ID:C-sjia,项目名称:cppjieba,代码行数:7,代码来源:MPSegment.hpp

示例8: switch

void CColorEdit::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags)
{
	// TODO: Add your message handler code here and/or call default
	switch (nChar)
	{
	case 0x01:// Ctrl-A => handle SELECT_ALL
		SetSel(0, -1);
		return;
	case 0x03:// Ctrl-C => handle WM_COPY
		Copy();
		return;
	case 0x16:// Ctrl-V => handle WM_PASTE
		Paste();
		return;
	case 0x18:// Ctrl-X => handle WM_CUT
		Cut();
		return;
	case 0x1A:// Ctrl-Z => handle ID_EDIT_UNDO (EM_UNDO)
		if(CanUndo())
			Undo();
		return;
	}

	CEdit::OnChar(nChar, nRepCnt, nFlags);
}
开发者ID:KurzedMetal,项目名称:Jaangle,代码行数:25,代码来源:ColorEdit.cpp

示例9: Cut

bool Track::SyncLockAdjust(double oldT1, double newT1)
{
   if (newT1 > oldT1) {
      // Insert space within the track

      if (oldT1 > GetEndTime())
         return true;

      Track *tmp;
      bool ret;

      ret = Cut(oldT1, GetEndTime(), &tmp);
      if (!ret) return false;

      ret = Paste(newT1, tmp);
      wxASSERT(ret);

      delete tmp;
      return ret;
   }
   else if (newT1 < oldT1) {
      // Remove from the track
      return Clear(newT1, oldT1);
   }

   // fall-through: no change
   return true;
}
开发者ID:ScorpioJonesy,项目名称:audacity,代码行数:28,代码来源:Track.cpp

示例10: dfs

static void
dfs(Agraph_t * g, Agnode_t * u, bcstate * stp, Agnode_t * parent)
{
    Agnode_t *v;
    Agedge_t *e;
    Agedge_t *ep;
    Agraph_t *sg;

    stp->count++;
    Low(u) = N(u) = stp->count;
    for (e = agfstedge(g, u); e; e = agnxtedge(g, e, u)) {
	if ((v = aghead(e)) == u)
	    v = agtail(e);
	if (v == u)
	    continue;
	if (N(v) == 0) {
	    push(&stp->stk, e);
	    dfs(g, v, stp, u);
	    Low(u) = min(Low(u), Low(v));
	    if (Low(v) >= N(u)) {	/* u is an articulation point */
		Cut(u) = 1;
		sg = mkBlock(g, stp);
		do {
		    ep = pop(&stp->stk);
		    agsubnode(sg, aghead(ep), 1);
		    agsubnode(sg, agtail(ep), 1);
		} while (ep != e);
	    }
	} else if (parent != v) {
	    Low(u) = min(Low(u), N(v));
	    if (N(v) < N(u))
		push(&stp->stk, e);
	}
    }
}
开发者ID:AhmedAMohamed,项目名称:graphviz,代码行数:35,代码来源:bcomps.c

示例11: OpenDocument

STDMETHODIMP CECR::MoveCash(BSTR FirmID, LONG Money, LONG DirectionIn, LONG* ErrorCode)
{
    DWORD dwDocType;
    DirectionIn ? dwDocType = CashInDocument : dwDocType = CashOutDocument;

    // открыть документ
    OpenDocument(FirmID, DEP_NO, ErrorCode, dwDocType);
    if (*ErrorCode == E_SUCCESS)
    {
        PrintBuffer(FirmID, ErrorCode);
        if (*ErrorCode == E_SUCCESS)
        {
            InitCmd();
            // команда
            to_numeric(214, m_Cmd, 3, m_Len);   //SETTENDER
            // пароль
            to_char(OPERATOR_PASSWD, m_Cmd + m_Len, 4, m_Len);
            // тип оплаты
            to_numeric(0, m_Cmd + m_Len, 2, m_Len);   
            // сумма
            to_smoney(Money, m_Cmd + m_Len, 10, m_Len);   

            m_RspLen = 11;
            m_ECRList.PassCmd(FirmID, m_Cmd, m_Len, m_Rsp, m_RspLen, ErrorCode);

            if (*ErrorCode == E_SUCCESS)
                Cut(FirmID, 1, ErrorCode);
        }
    }
    return S_OK;
}
开发者ID:Dennis-Petrov,项目名称:Cash,代码行数:31,代码来源:ECR.cpp

示例12: switch

BOOL CMyComboBox::PreTranslateMessage(MSG* pMsg)
{
	bool	ctrl = (GetKeyState(VK_CONTROL) & 0x8000) != 0;
	if ( pMsg->message == WM_KEYDOWN){
		switch( pMsg->wParam ){
		case 'C':
			if ( ctrl ){
				Copy();
				return TRUE;
			}
			break;
		case 'X':
			if ( ctrl ) {
				Cut();
				return TRUE;
			}
			break;
		case 'V':
			if ( ctrl ) {
				Paste();
				return TRUE;
			}
			break;
		case VK_DOWN:
			if ( GetDroppedState() == FALSE ){
				ShowDropDown( TRUE );
			}
			break;
		}
	}

	return CComboBox::PreTranslateMessage(pMsg);
}
开发者ID:beketa,项目名称:jot-for-X01SC,代码行数:33,代码来源:MyComboBox.cpp

示例13: GetCharCountAlongLine

void CPlainTextEditor::CutLine(CChars* pszDest)
{
	int		iCount;
	int		iStart;
	int		iEnd;

	if (!IsSelected())
	{
		iCount = GetCharCountAlongLine(miEditPos);
		iStart = FindStartOfLine(miEditPos);
		iEnd = FindEndOfLine(miEditPos);

		if (CanGoRight(iEnd))
		{
			iEnd++;
		}

		pszDest->AppendSubString(mszText, iStart, iEnd);
		mszText.Remove(iStart, iEnd);
		ResetUpDown();

		miEditPos = FindPositionAlongLine(iStart, iCount);
	}
	else
	{
		Cut(pszDest);
	}
}
开发者ID:andrewpaterson,项目名称:Codaphela.Library,代码行数:28,代码来源:PlainTextEditor.cpp

示例14: GetSelectedRows

void CSimpleReport::RowDownMulti()
{
	CXTPReportSelectedRows* pRows = GetSelectedRows();
	if (!pRows)
		return;

	int total = GetRows()->GetCount() - 1;
	int cnt = pRows->GetCount();

	CXTPReportRow* pRow = pRows->GetAt(cnt-1);	// 선택 영역의 마지막 row
	if (!pRow)
		return;
	int n = pRow->GetIndex();
	if (n >= total)					// 더이상 내려갈 수 없음
		return;

	// 마지막 row 뒤에 paste하기 위해 m_bAdd를 true로 만듬.
	// 그럼 cut후 add가 됨

	if (n+1 >= total)
		m_bAdd = true;

	// focus는 cut된 시점에서 첫번째로 잡음.
	pRow = pRows->GetAt(0);
	n = pRow->GetIndex();

	Cut();			// 컷하면 선택된 갯수는 제거되므로 total-cnt가 
	RowSetFocused(n+1);
	Paste();
	SetFocus();
}
开发者ID:tlogger,项目名称:TMon,代码行数:31,代码来源:SimpleReport.cpp

示例15: Cut

void fbtTextFile::cutEvent(wxCommandEvent& evt)
{
	if (GetReadOnly()  || GetSelectionEnd() - GetSelectionStart() <= 0)
		return;
	Cut();

}
开发者ID:Ali-il,项目名称:gamekit,代码行数:7,代码来源:fbtTextFile.cpp


注:本文中的Cut函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。