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


C++ Append函数代码示例

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


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

示例1: Append

void SQArray::Extend(const SQArray *a){
	SQInteger xlen;
	if((xlen=a->Size()))
		for(SQInteger i=0;i<xlen;i++)
			Append(a->_values[i]);
}
开发者ID:Heartbroken,项目名称:bikini,代码行数:6,代码来源:sqobject.cpp

示例2: LOG

std::unique_ptr<Ephemeris<Frame>> Ephemeris<Frame>::ReadFromPreBourbakiMessages(
    google::protobuf::RepeatedPtrField<
        serialization::Plugin::CelestialAndProperties> const& messages,
    Length const& fitting_tolerance,
    typename Ephemeris<Frame>::FixedStepParameters const& fixed_parameters) {
  LOG(INFO) << "Reading "<< messages.SpaceUsedExcludingSelf()
            << " bytes in pre-Bourbaki compatibility mode ";
  std::vector<not_null<std::unique_ptr<MassiveBody const>>> bodies;
  std::vector<DegreesOfFreedom<Frame>> initial_state;
  std::vector<std::unique_ptr<DiscreteTrajectory<Frame>>> histories;
  std::set<Instant> initial_time;
  std::set<Instant> final_time;
  for (auto const& message : messages) {
    serialization::Celestial const& celestial = message.celestial();
    bodies.emplace_back(MassiveBody::ReadFromMessage(celestial.body()));
    histories.emplace_back(DiscreteTrajectory<Frame>::ReadFromMessage(
        celestial.history_and_prolongation().history(), /*forks=*/{}));
    auto const prolongation =
        DiscreteTrajectory<Frame>::ReadPointerFromMessage(
            celestial.history_and_prolongation().prolongation(),
            histories.back().get());
    typename DiscreteTrajectory<Frame>::Iterator const history_begin =
        histories.back()->Begin();
    initial_state.push_back(history_begin.degrees_of_freedom());
    initial_time.insert(history_begin.time());
    final_time.insert(prolongation->last().time());
  }
  CHECK_EQ(1, initial_time.size());
  CHECK_EQ(1, final_time.size());
  LOG(INFO) << "Initial time is " << *initial_time.cbegin()
            << ", final time is " << *final_time.cbegin();

  // Construct a new ephemeris using the bodies and initial states and time
  // extracted from the serialized celestials.
  auto ephemeris = std::make_unique<Ephemeris<Frame>>(std::move(bodies),
                                                      initial_state,
                                                      *initial_time.cbegin(),
                                                      fitting_tolerance,
                                                      fixed_parameters);

  // Extend the continuous trajectories using the data from the discrete
  // trajectories.
  std::set<Instant> last_state_time;
  for (int i = 0; i < histories.size(); ++i) {
    not_null<MassiveBody const*> const body = ephemeris->unowned_bodies_[i];
    auto const& history = histories[i];
    int const j = ephemeris->serialization_index_for_body(body);
    auto continuous_trajectory = ephemeris->trajectories_[j];

    typename DiscreteTrajectory<Frame>::Iterator it = history->Begin();
    Instant last_time = it.time();
    DegreesOfFreedom<Frame> last_degrees_of_freedom = it.degrees_of_freedom();
    for (; it != history->End(); ++it) {
      Time const duration_since_last_time = it.time() - last_time;
      if (duration_since_last_time == fixed_parameters.step_) {
        // A time in the discrete trajectory that is aligned on the continuous
        // trajectory.
        last_time = it.time();
        last_degrees_of_freedom = it.degrees_of_freedom();
        continuous_trajectory->Append(last_time, last_degrees_of_freedom);
      } else if (duration_since_last_time > fixed_parameters.step_) {
        // A time in the discrete trajectory that is not aligned on the
        // continuous trajectory.  Stop here, we'll use prolong to recompute the
        // rest.
        break;
      }
    }

    // Fill the |last_state_| for this body.  It will be the starting state for
    // Prolong.
    last_state_time.insert(last_time);
    ephemeris->last_state_.positions[j] = last_degrees_of_freedom.position();
    ephemeris->last_state_.velocities[j] = last_degrees_of_freedom.velocity();
  }
  CHECK_EQ(1, last_state_time.size());
  ephemeris->last_state_.time = *last_state_time.cbegin();
  LOG(INFO) << "Last time in discrete trajectories is "
            << *last_state_time.cbegin();

  // Prolong the ephemeris to the final time.  This might create discrepancies
  // from the discrete trajectories.
  ephemeris->Prolong(*final_time.cbegin());

  return ephemeris;
}
开发者ID:pdn4kd,项目名称:Principia,代码行数:85,代码来源:ephemeris_body.hpp

示例3: GetAfterPath

CBool CScene::Load( CChar * fileName, CBool reportWarningsAndErrors, CBool readFromBuffer )
{
	if ( fileName == NULL )
		return CFalse; 
	CChar * nameOnly = GetAfterPath( fileName );
	SetName( nameOnly );

	// Instantiate the reference implementation
	m_collada = new DAE;
	PrintInfo( "\n" );
	PrintInfo( _T("\n========Importing new external scene========"), COLOR_BLUE ); 
	numErrors = numWarnings = 0;
	domCOLLADA *dom;
	if( readFromBuffer )
	{
		/////////////////////////////////////////////////////////////////
		//zip path
		CChar zipPath[MAX_NAME_SIZE];
		Cpy( zipPath, fileName );
		GetWithoutDot( zipPath );
		Append(zipPath, ".zip" );

		//file name inside zip file
		CChar fileNameInZip[MAX_NAME_SIZE];
		Cpy( fileNameInZip, GetAfterPath( fileName ) );
		//Uncompress zip file
		std::string buffer = ReadZipFile( zipPath, fileNameInZip );
		//res = m_collada->load( "", buffer.c_str() );
		dom = m_collada->openFromMemory( "", buffer.c_str() );
		///////////////////////////////////////////////////////////////
	}
	else
	{
		// load with full path 
		//res = m_collada->load( fileName );
		dom = m_collada->open(fileName);
	}

	//if (res != DAE_OK)
	//{
	//	PrintInfo(_T("\nCScene::Load > Error loading the COLLADA file:") + CString(fileName), COLOR_RED );
	//	delete m_collada;
	//	m_collada = NULL;

		//if( reportWarningsAndErrors )
		//{
		//	char tempReport[MAX_NAME_SIZE];;
		//	sprintf( tempReport, "%s - fatal error (s)", nameOnly );
		//	PrintInfo2( tempReport, COLOR_RED ); 
		//}

	//	return CFalse;
	//}
	PrintInfo( _T("\nCOLLADA_DOM Runtime database initialized from" ) );
	PrintInfo( _T("'") +  CString( fileName ), COLOR_RED_GREEN );
	//PrintInfo( _T("nameOnly: '") + (CString)nameOnly + _T( "'\n" ) );

	//domCOLLADA *dom = m_collada->getDom(nameOnly);
	//if ( !dom )
	//	dom = m_collada->getDom( fileName); 
	if ( !dom )
	{
		PrintInfo( _T("\nCScene::Load > COLLADA File loaded to the dom, but query for the dom assets failed "), COLOR_RED );
		PrintInfo( _T("\nCScene::Load > COLLADA Load Aborted! "), COLOR_RED );
		delete m_collada;	
		m_collada = NULL;
		if( reportWarningsAndErrors )
		{
			char tempReport[MAX_NAME_SIZE];;
			sprintf( tempReport, "\n%s - Fatal error (s)", nameOnly );
			PrintInfo( tempReport, COLOR_RED ); 
		}
		return CFalse; 
	}

	CInt ret = 0;
	//PrintInfo("Begin Conditioning\n");
	//ret = kmzcleanup(m_collada, true);
	//if (ret)
	//	PrintInfo("kmzcleanup complete\n");
	ret = Triangulate(m_collada);
	if (ret)
		PrintInfo("\nTriangulate complete");
	//ret = deindexer(m_collada);
	//if (ret)
	//	PrintInfo("deindexer complete\n");

	//PrintInfo("Finish Conditioning\n");

	// Need to now get the asset tag which will determine what vector x y or z is up.  Typically y or z. 
	if ( dom->getAsset()->getUp_axis() )
	{
		domAsset::domUp_axis *up = dom->getAsset()->getUp_axis();
		switch( up->getValue() )
		{
			case UPAXISTYPE_X_UP:
				PrintInfo(_T("\nWarning!X is Up Data and Hiearchies must be converted!") ); 
				PrintInfo(_T("\nConversion to X axis Up isn't currently supported!") ); 
				PrintInfo(_T("\nCOLLADA defaulting to Y Up") ); 
				numWarnings +=1;
//.........这里部分代码省略.........
开发者ID:DCubix,项目名称:1.4.0,代码行数:101,代码来源:Scene.cpp

示例4: Append

	//--------------------------------------------------------------------------------
	CUTF16String& CUTF16String::Append( const CUTF16String& Str )
	{
		return Append( Str.m_String, Str.m_String.Len() );
	}
开发者ID:mfaithfull,项目名称:QOR,代码行数:5,代码来源:UTF16String.cpp

示例5: main

int main(int argc, char* argv[])
{
        
    NodePtr head = NULL;
    NodePtr second = NULL;
    NodePtr third = NULL;

    head = malloc(sizeof(Node));
    second = malloc(sizeof(Node));
    third = malloc(sizeof(Node));

    assert(head != NULL);
    assert(second != NULL);
    assert(third != NULL);
    head = buildList(head, second, third);

    NodePtr newNode;
   
    newNode = malloc(sizeof(Node));
    newNode->data = 1;
    newNode->next = head;    

    head = newNode; // now head points to list {1,2,3}
    printList(head);

    Push(&head, 13);
    Push(&head, 2);
    Push(&head, 1);
    Push(&head, 23);
    Push(&head, 35);

    printf("Before reverse:\n");
    printList(head);
    Reverse(&head);
    printf("After reverse:\n");
    printList(head);

    int count = countIntInList(head, 1);
    printf("count of %d in list is : %d\n", 1, count);
    
    printf("Third item in list is : %d\n", getNth(head, 3) );

#if 0
    printf("Test code for append()\n");

    NodePtr a;
    a = malloc(sizeof(a));
    assert( a!= NULL);
    Push(&a, 100);
    Push(&a, 200);
    printf("Built list a :\n");
    printList(a);

    NodePtr b;
    b = malloc(sizeof(a));
    assert( b!= NULL);
    Push(&b, 300);
    Push(&b, 400);
    printf("Built list b :\n");
    printList(b);

    //Delete(&a);

    Append(&a, &b);
    printf("After appending a to b :\n");
    printList(a);

    free(head);
#endif    
#if 0
    free(second);
    free(third);
    free(newNode);
    free(a);
    free(b);
#endif
  
    return 0; 
}
开发者ID:bds105,项目名称:myrepo,代码行数:79,代码来源:llist.c

示例6: yylex


//.........这里部分代码省略.........
	if (strcmp(yytext, "public") == 0)
	  return (PUBLIC);
	if (strcmp(yytext, "protected") == 0)
	  return (PROTECTED);
	if (strcmp(yytext, "friend") == 0)
	  return (FRIEND);
	if (strcmp(yytext, "virtual") == 0)
	  return (VIRTUAL);
	if (strcmp(yytext, "operator") == 0) {
	  int nexttok;
	  String *s = NewString("operator ");

	  /* If we have an operator, we have to collect the operator symbol and attach it to
             the operator identifier.   To do this, we need to scan ahead by several tokens.
             Cases include:

             (1) If the next token is an operator as determined by Scanner_isoperator(),
                 it means that the operator applies to one of the standard C++ mathematical,
                 assignment, or logical operator symbols (e.g., '+','<=','==','&', etc.)
                 In this case, we merely append the symbol text to the operator string above.

             (2) If the next token is (, we look for ).  This is operator ().
             (3) If the next token is [, we look for ].  This is operator [].
	     (4) If the next token is an identifier.  The operator is possibly a conversion operator.
                      (a) Must check for special case new[] and delete[]

             Error handling is somewhat tricky here.  We'll try to back out gracefully if we can.
 
	  */

	  nexttok = Scanner_token(scan);
	  if (Scanner_isoperator(nexttok)) {
	    /* One of the standard C/C++ symbolic operators */
	    Append(s,Scanner_text(scan));
	    yylval.str = s;
	    return OPERATOR;
	  } else if (nexttok == SWIG_TOKEN_LPAREN) {
	    /* Function call operator.  The next token MUST be a RPAREN */
	    nexttok = Scanner_token(scan);
	    if (nexttok != SWIG_TOKEN_RPAREN) {
	      Swig_error(Scanner_file(scan),Scanner_line(scan),"Syntax error. Bad operator name.\n");
	    } else {
	      Append(s,"()");
	      yylval.str = s;
	      return OPERATOR;
	    }
	  } else if (nexttok == SWIG_TOKEN_LBRACKET) {
	    /* Array access operator.  The next token MUST be a RBRACKET */
	    nexttok = Scanner_token(scan);
	    if (nexttok != SWIG_TOKEN_RBRACKET) {
	      Swig_error(Scanner_file(scan),Scanner_line(scan),"Syntax error. Bad operator name.\n");	      
	    } else {
	      Append(s,"[]");
	      yylval.str = s;
	      return OPERATOR;
	    }
	  } else if (nexttok == SWIG_TOKEN_ID) {
	    /* We have an identifier.  This could be any number of things. It could be a named version of
               an operator (e.g., 'and_eq') or it could be a conversion operator.   To deal with this, we're
               going to read tokens until we encounter a ( or ;.  Some care is needed for formatting. */
	    int needspace = 1;
	    int termtoken = 0;
	    const char *termvalue = 0;

	    Append(s,Scanner_text(scan));
	    while (1) {
开发者ID:veeramarni,项目名称:xuggle-swig,代码行数:67,代码来源:cscanner.c

示例7: _CoreRecover

ssize_t MemKeyCache::StartRecover()
{
	//非新建的共享内存,不用恢复
	if (m_iInitType!=emInit)
	{
		return 0;
	}

	m_pMemCacheHead->m_iDataOK = 0;

	//关闭binlog
	ssize_t iOldBinLogOpen = m_iBinLogOpen;
	m_iBinLogOpen = 0;

	if (access(m_szDumpFile, F_OK) == 0)
	{
		//恢复core
		ssize_t iRet = _CoreRecover(m_iDumpType);
		if (iRet > 0)
		{
			if (m_iDumpType == DUMP_TYPE_MIRROR)
			{
				printf("Recover from dumpfile(%s) %lld bytes.\n",m_szDumpFile,(long long)iRet);
			}
			else
			{
				printf("Recover from dumpfile(%s) %lld records.\n",m_szDumpFile,(long long)iRet);
			}
		}
		else
		{
			printf("not recover from dumpfile\n");
		}
	}
	else
	{
		printf("no dumpfile to recover.\n");
	}

	char cOp = 0;
	ssize_t iCount = 0;
	ssize_t iLogLen = 0;

	char* pTmpBuffer = new char[BUFFSIZE];
	u_int64_t tLogTime;
	//恢复日志流水,均为脏数据
	m_stBinLog.ReadRecordStart();
	while(0<(iLogLen = m_stBinLog.ReadRecordFromBinLog(pTmpBuffer,BUFFSIZE,tLogTime)))
	{
		memcpy(&cOp,pTmpBuffer,sizeof(cOp));

		char *pBuffer = pTmpBuffer+sizeof(cOp);
		ssize_t iBufferLen = iLogLen - sizeof(cOp);

		if (cOp == op_set)
		{
			DecodeBufferFormat(pBuffer,iBufferLen);
			Set(pNodeKey,*piNodeKeyLen,pNodeData,iNodeDataLen,*piDataFlag,pNodeReserve,*piNodeReserveLen);
		}
		else if  (cOp == op_mark)
		{
			DecodeBufferKeyFormat(pBuffer,iBufferLen);
			MarkFlag(pNodeKey,*piNodeKeyLen,*piDataFlag);
		}
		else if  (cOp == op_del)
		{
			DecodeBufferKeyFormat(pBuffer,iBufferLen);
			Del(pNodeKey,*piNodeKeyLen);
		}
		else if  (cOp == op_append)
		{
			DecodeBufferFormat(pBuffer,iBufferLen);
			Append(pNodeKey,*piNodeKeyLen,pNodeData,iNodeDataLen,*piDataFlag);
		}
		else
		{
			printf("bad binlog op %lld.\n",(long long)cOp);
		}

		iCount++;
	}

	printf("recover from binlog %lld records.\n",(long long)iCount);
	delete []pTmpBuffer;

	//恢复binlog开关
	m_iBinLogOpen = iOldBinLogOpen;

	m_pMemCacheHead->m_iDataOK = 1;
	return 0;
}
开发者ID:yafngzh,项目名称:easyMq,代码行数:91,代码来源:MemKeyCache.cpp

示例8: Append

//+-------------------------------------------------------------------------------------------------------------------------------
FvDynamicTuple::FvDynamicTuple(const FvBaseTuple& kOther)
{
	Append(kOther);
}
开发者ID:Kiddinglife,项目名称:geco-game-engine,代码行数:5,代码来源:FvTuple.cpp

示例9: GuiWindow


//.........这里部分代码省略.........
		if(gameList[gameIdx] == header)
		{
			gameSelected = gameIdx;
			break;
		}
	}

	//! Set dvd header if the header does not match any of the list games
	if(gameIdx == gameList.size())
		dvdheader = header;

	GuiBannerGrid *bannerBrowser = dynamic_cast<GuiBannerGrid *>(browserMenu->GetGameBrowser());
	if(bannerBrowser)
		bannerBrowser->GetIconCoordinates(gameSelected, &AnimPosX, &AnimPosY);

	gameBanner = new Banner;

	imgLeft = Resources::GetImageData("startgame_arrow_left.png");
	imgRight = Resources::GetImageData("startgame_arrow_right.png");

	trigA = new GuiTrigger;
	trigA->SetSimpleTrigger(-1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A);
	trigB = new GuiTrigger;
	trigB->SetButtonOnlyTrigger(-1, WPAD_BUTTON_B | WPAD_CLASSIC_BUTTON_B, PAD_BUTTON_B);
	trigL = new GuiTrigger;
	trigL->SetButtonOnlyTrigger(-1, WPAD_BUTTON_LEFT | WPAD_CLASSIC_BUTTON_LEFT, PAD_BUTTON_LEFT);
	trigR = new GuiTrigger;
	trigR->SetButtonOnlyTrigger(-1, WPAD_BUTTON_RIGHT | WPAD_CLASSIC_BUTTON_RIGHT, PAD_BUTTON_RIGHT);
	trigPlus = new GuiTrigger;
	trigPlus->SetButtonOnlyTrigger(-1, WPAD_BUTTON_PLUS | WPAD_CLASSIC_BUTTON_PLUS, PAD_TRIGGER_R);
	trigMinus = new GuiTrigger;
	trigMinus->SetButtonOnlyTrigger(-1, WPAD_BUTTON_MINUS | WPAD_CLASSIC_BUTTON_MINUS, PAD_TRIGGER_L);

	playcntTxt = new GuiText((char*) NULL, 18, thColor("r=0 g=0 b=0 a=255 - banner window playcount text color"));
	playcntTxt->SetAlignment(ALIGN_CENTER, ALIGN_MIDDLE);
	playcntTxt->SetPosition(thInt("0 - banner window play count pos x"),
							thInt("215 - banner window play count pos y") - Settings.AdjustOverscanY / 2);

	settingsBtn = new GuiButton(215, 75);
	settingsBtn->SetAlignment(ALIGN_CENTER, ALIGN_MIDDLE);
	settingsBtn->SetSoundOver(btnSoundOver);
	settingsBtn->SetSoundClick(btnSoundAccept);
	settingsBtn->SetPosition(-120, 175);
	settingsBtn->SetTrigger(trigA);

	startBtn = new GuiButton(215, 75);
	startBtn->SetAlignment(ALIGN_CENTER, ALIGN_MIDDLE);
	startBtn->SetSoundOver(btnSoundOver);
	startBtn->SetSoundClick(btnSoundClick3);
	startBtn->SetPosition(110, 175);
	startBtn->SetTrigger(trigA);

	backBtn = new GuiButton(215, 75);
	backBtn->SetAlignment(ALIGN_CENTER, ALIGN_MIDDLE);
	backBtn->SetSoundOver(btnSoundOver);
	backBtn->SetSoundClick(btnSoundBack);
	backBtn->SetPosition(-screenwidth, -screenheight); // set out of screen
	backBtn->SetTrigger(0, trigA);
	backBtn->SetTrigger(1, trigB);

	btnLeftImg = new GuiImage(imgLeft);
	if (Settings.wsprompt) btnLeftImg->SetWidescreen(Settings.widescreen);
	btnLeft = new GuiButton(btnLeftImg, btnLeftImg, ALIGN_LEFT, ALIGN_MIDDLE, 20, -50, trigA, btnSoundOver, btnSoundClick2, 1);
	btnLeft->SetTrigger(trigL);
	btnLeft->SetTrigger(trigMinus);

	btnRightImg = new GuiImage(imgRight);
	if (Settings.wsprompt) btnRightImg->SetWidescreen(Settings.widescreen);
	btnRight = new GuiButton(btnRightImg, btnRightImg, ALIGN_RIGHT, ALIGN_MIDDLE, -20, -50, trigA, btnSoundOver, btnSoundClick2, 1);
	btnRight->SetTrigger(trigR);
	btnRight->SetTrigger(trigPlus);

	if (Settings.ShowPlayCount)
		Append(playcntTxt);
	Append(backBtn);

	if (!dvdheader) //stuff we don't show if it is a DVD mounted
	{
		Append(btnLeft);
		Append(btnRight);
	}

	bannerFrame.SetButtonBText(tr("Start"));

	//check if unlocked
	if (Settings.godmode || !(Settings.ParentalBlocks & BLOCK_GAME_SETTINGS))
	{
		bannerFrame.SetButtonAText(tr("Settings"));
		Append(settingsBtn);
	}
	else
	{
		bannerFrame.SetButtonAText(tr("Back"));
		backBtn->SetPosition(-120, 175);
	}

	Append(startBtn); //! Appending the disc on top of all

	ChangeGame(false);
}
开发者ID:SuperrSonic,项目名称:ULGX-ICON-VIEW,代码行数:101,代码来源:BannerWindow.cpp

示例10: C4PacketBase

C4PacketList::C4PacketList(const C4PacketList &List2)
		: C4PacketBase(List2),
		pFirst(NULL), pLast(NULL)
{
	Append(List2);
}
开发者ID:Rocket-Fish,项目名称:openclonk,代码行数:6,代码来源:C4Packet2.cpp

示例11: Clear

void FvDynamicTuple::operator=(const FvBaseTuple& kOther)
{
	Clear();
	Append(kOther);
}
开发者ID:Kiddinglife,项目名称:geco-game-engine,代码行数:5,代码来源:FvTuple.cpp

示例12: Append

	const CDuiString& CDuiString::operator+=(const TCHAR ch)
	{      
		TCHAR str[] = { ch, '\0' };
		Append(str);
		return *this;
	}
开发者ID:wang1986one,项目名称:duipcmgr,代码行数:6,代码来源:Utils.cpp

示例13: head_

List<T>::List (const List<T>& x) : head_(nullptr), tail_(nullptr)
// copy constructor
{
  Init();
  Append(x);
}
开发者ID:cob174,项目名称:school-projects,代码行数:6,代码来源:list.cpp

示例14: Swig_symbol_clookup


//.........这里部分代码省略.........
	int *priorities_row;
	max_possible_partials = Len(partials);
	priorities_matrix = (int *)malloc(sizeof(int) * max_possible_partials * parms_len); /* slightly wasteful allocation for max possible matches */
	priorities_row = priorities_matrix;
	for (pi = First(partials); pi.item; pi = Next(pi)) {
	  Parm *p = parms;
	  int all_parameters_match = 1;
	  int i = 1;
	  Parm *partialparms = Getattr(pi.item, "partialparms");
	  Parm *pp = partialparms;
	  String *templcsymname = Getattr(pi.item, "templcsymname");
	  if (template_debug) {
	    Printf(stdout, "    checking match: '%s' (partial specialization)\n", templcsymname);
	  }
	  if (ParmList_len(partialparms) == parms_len) {
	    while (p && pp) {
	      SwigType *t;
	      sprintf(tmp, "$%d", i);
	      t = Getattr(p, "type");
	      if (!t)
		t = Getattr(p, "value");
	      if (t) {
		EMatch match = does_parm_match(t, Getattr(pp, "type"), tmp, tscope, priorities_row + i - 1);
		if (match < (int)PartiallySpecializedMatch) {
		  all_parameters_match = 0;
		  break;
		}
	      }
	      i++;
	      p = nextSibling(p);
	      pp = nextSibling(pp);
	    }
	    if (all_parameters_match) {
	      Append(possiblepartials, pi.item);
	      priorities_row += parms_len;
	    }
	  }
	}
      }
    }

    posslen = Len(possiblepartials);
    if (template_debug) {
      int i;
      if (posslen == 0)
	Printf(stdout, "    matched partials: NONE\n");
      else if (posslen == 1)
	Printf(stdout, "    chosen partial: '%s'\n", Getattr(Getitem(possiblepartials, 0), "templcsymname"));
      else {
	Printf(stdout, "    possibly matched partials:\n");
	for (i = 0; i < posslen; i++) {
	  Printf(stdout, "      '%s'\n", Getattr(Getitem(possiblepartials, i), "templcsymname"));
	}
      }
    }

    if (posslen > 1) {
      /* Now go through all the possibly matched partial specialization templates and look for a non-ambiguous match.
       * Exact matches rank the highest and deduced parameters are ranked by how specialized they are, eg looking for
       * a match to const int *, the following rank (highest to lowest):
       *   const int * (exact match)
       *   const T *
       *   T *
       *   T
       *
       *   An ambiguous example when attempting to match as either specialization could match: %template() X<int *, double *>;
开发者ID:kkaempf,项目名称:swig,代码行数:67,代码来源:templ.c

示例15: swill_deny

void swill_deny(const char *ip) {
   if (!SwillInit) return;
   if (!ip_deny) ip_deny = NewList();
   Append(ip_deny,ip);
}
开发者ID:s1d,项目名称:sniffjoke,代码行数:5,代码来源:security.c


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