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


C++ DeleteList函数代码示例

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


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

示例1: DeletePermanent

void DeletePermanent(Permanent* permanent) {
    if (permanent->equipment)
        DeleteList(permanent->equipment);
    if (permanent->abilities)
        DeleteList(permanent->abilities);
    free(permanent);
    
}
开发者ID:jingdao,项目名称:mtg,代码行数:8,代码来源:MTGPlayer.c

示例2: MTGPlayer_tap

bool MTGPlayer_tap(MTGPlayer* player,Permanent* permanent) {
    List* options = InitList();
    char buffer[256];
    char* c = buffer;
    for (unsigned int i=0;i<permanent->abilities->size;i++) {
        char* s = c;
        Ability* a = permanent->abilities->entries[i];
        for (unsigned int j=0;j<a->manaCost->size;j++) {
            Manacost* m = a->manaCost->entries[j];
            char color;
            switch (m->color1) {
                case WHITE:
                    color = 'W';
                    break;
                case BLUE:
                    color = 'U';
                    break;
                case BLACK:
                    color = 'B';
                    break;
                case RED:
                    color = 'R';
                    break;
                case GREEN:
                    color = 'G';
                    break;
                case COLORLESS:
                    color = ' ';
                    break;
            }
            c += sprintf(c,"{%d%c}",m->num,color);
        }
        c += sprintf(c,"%s",a->needs_tap?"{T}":"") + 1;
        AppendToList(options, s);
    }
    if (permanent->subtypes.is_land) {
        if (permanent->subtypes.is_plains) AppendToList(options, "W");
        if (permanent->subtypes.is_island) AppendToList(options, "U");
        if (permanent->subtypes.is_swamp) AppendToList(options, "B");
        if (permanent->subtypes.is_mountain) AppendToList(options, "R");
        if (permanent->subtypes.is_forest) AppendToList(options, "G");
        if (permanent->source == cd.DarksteelCitadel) AppendToList(options, "C");
        permanent->is_tapped = true;
    }
    if (options->size > 1) {
        if (player == player1)
            selectAbility(permanent,options);
        else
            AI_selectAbility(permanent,options);
        DeleteList(options);
        return false;
    } else {
        permanent->selectedAbility = 1;
        DeleteList(options);
        return true;
    }
}
开发者ID:jingdao,项目名称:mtg,代码行数:57,代码来源:MTGPlayer.c

示例3: main

void main()
{
	struct node* a = PushAtHead(10);
	PrintList(a);
	struct node* b = PushAtHead(5);
	PrintList(b);
	Append(&a, &b);
	PrintList(a);
	PrintList(b);
	DeleteList(&a);
	DeleteList(&b);
}
开发者ID:pmiriyals,项目名称:C_Programs,代码行数:12,代码来源:Append.c

示例4: while

bool OperCFThread::DeleteDir( FS* fs, FSPath& path )
{
	if ( Info()->Stopped() ) { return false; }

	FSList list;

	while ( true )
	{
		int ret_err;
		int ret = fs->ReadDir( &list, path, &ret_err, Info() );

		if ( ret == -2 ) { return false; }

		if ( !ret ) { break; }

		switch ( RedMessage( _LT( "Can`t open directory:\n" ), fs->Uri( path ).GetUtf8(), bRetrySkipCancel, fs->StrError( ret_err ).GetUtf8() ) )
		{
			case CMD_SKIP:
				return true;

			case CMD_RETRY:
				continue;

			default:
				return false;
		}
	}

	return DeleteList( fs, path, list );
}
开发者ID:FaionWeb,项目名称:WCMCommander,代码行数:30,代码来源:fileopers.cpp

示例5: InsertNthTest

// 5 — InsertNth()
void InsertNthTest() {
	struct node* head = NULL; // start with the empty list
	InsertNth(&head, 0, 13); // build {13)
	InsertNth(&head, 1, 42); // build {13, 42}
	InsertNth(&head, 1, 5); // build {13, 5, 42}
	DeleteList(&head); // clean up after ourselves
}
开发者ID:zzw4github,项目名称:clanguage,代码行数:8,代码来源:linklistproblems.c

示例6: main

main()
{
	struct node *head = malloc(sizeof(struct node));
	head = Build(); // {1,2,3}
	len(head);
	DeleteList(&head);
}
开发者ID:ArunRamachandran,项目名称:Stanford-cslib-linkedlist-solutions,代码行数:7,代码来源:3.c

示例7: ReverseTest

// 17 — Reverse()
void ReverseTest() {
	struct node* head;
	head = BuildOneTwoThree();
	Reverse(&head);
	// head now points to the list {3, 2, 1}
	DeleteList(&head); // clean up after ourselves
}
开发者ID:zzw4github,项目名称:clanguage,代码行数:8,代码来源:linklistproblems.c

示例8: cancelDownloadCallback

static void cancelDownloadCallback(GtkWidget *button, BrowserDownloadDialog *dialog)
{
    GtkTreeModel * model;
    GtkTreeIter iter;
    WebKitDownload *wkDownload;

    if (gtk_tree_selection_get_selected(GTK_TREE_SELECTION(dialog->select), &model, &iter))
    {
        gtk_tree_model_get (GTK_TREE_MODEL(dialog->model), &iter, 7, &wkDownload, -1);
        if(wkDownload)
        {
            webkit_download_cancel(WEBKIT_DOWNLOAD(wkDownload));
            gtk_list_store_remove(dialog->model, &iter);
            return;
        }

        char *treeviewIndex = g_strdup_printf("%s", gtk_tree_model_get_string_from_iter(GTK_TREE_MODEL(dialog->model), &iter));
        if(treeviewIndex)
        {
            size_t listIndex = atoi(treeviewIndex);
            DeleteList(dialog->download,listIndex);
        }
        g_printerr("store_remove\n");
        gtk_list_store_remove(dialog->model, &iter);
    }
}
开发者ID:sinoory,项目名称:webv8,代码行数:26,代码来源:BrowserDownloadDialog.c

示例9: DeleteList

CDialogList::~CDialogList()
{
	DeleteList();
	
	if(m_pMalloc)
		m_pMalloc->Release();
}
开发者ID:sqba,项目名称:zenfolders,代码行数:7,代码来源:dlglist.cpp

示例10: DeleteList

// CreateList assumes the pointer is at the head of the list.
// Only pass m_head through here!!!
void EndpointAddrlist::CreateList( struct addrinfo* list )
{
        int count = 1;
        DeleteList();

        // curList_addr = current node in 'list'
//  EndpointAddress *curList_addr = (EndpointAddress*) list;
        addrinfo *curList_addr = list;
        // curM_addr = current node in our class' vector
        EndpointAddress curM_addr;

        if( !list ) {
                return;
        }

        while( curList_addr != NULL ) {
                count++;
                curM_addr = *curList_addr;

                // explicitly set ai_next = 0 since the vector iterators are used instead.
                curM_addr.ai_next = 0;

                //finalize
                m_addrlist.push_back(curM_addr);
                curList_addr = (EndpointAddress*) curList_addr->ai_next;
        }
        m_addrs = m_addrlist.begin();

        return;
}
开发者ID:151706061,项目名称:ginkgocadx,代码行数:32,代码来源:address.cpp

示例11: main

int main()
{
	List L;
	Position P;
	int X;

	L = (Position) malloc(sizeof(struct Node));
	L->Next = NULL;
	L->Element = -1;

	initList(L);
	printf("print list:\n");
	PrintList(L);

	return 0;

	printf("input a num:");
	scanf("%d", &X);

	P = FindPrevious(X, L);
	if(P == NULL)
		printf("can't find the num:%d previous num\n", X);
	else
		printf("Previous num is:%d, address is :0x%p\n", P->Element, P->Next);

	DeleteList(L);

	return 0;
}
开发者ID:xiongyejun,项目名称:02-c,代码行数:29,代码来源:01-list.c

示例12: CheckAce

void CheckAce(char *type, char *name, Bool verbose)
{
  char *args[2], buf[BUFSIZ];
  int status;

  if (strcmp(type, "LIST"))
    return;		/* If the ace is not a list the ignore it. */

  args[0] = type;
  args[1] = name;
  status = do_mr_query("get_ace_use", 2, args, NULL, NULL);
  if (status != MR_NO_MATCH)
    return;			/* If this query fails the ace will
				   not be deleted even if it is empty. */
  if (verbose)
    {
      sprintf(buf, "Delete the unused Access Control Entity (ACE) %s? ", name);
      if (YesNoQuestion(buf, FALSE) != TRUE)
	{
	  Put_message("Aborting Deletion!");
	  return;
	}
    }
  /*
   * Delete the ACE.
   *
   * NOTE: Delete list expects only the name of the list to delete in argv[1].
   *       since, 'args' already satisfies this, there is no need to create
   *       a special argument list.
   */
  DeleteList(2, args);
}
开发者ID:sipb,项目名称:athena-svn-mirror,代码行数:32,代码来源:delete.c

示例13: DeleteUserGroup

int DeleteUserGroup(char *name, Bool verbose)
{
  int status, ans;
  char buf[BUFSIZ], *args[10];

  status = do_mr_query("get_list_info", 1, &name, NULL, NULL);
  if (!status)
    {
      if (verbose)
	{
	  sprintf(buf, "There is also a list named %s, delete it?", name);
	  ans = YesNoQuestion(buf, FALSE);
	  if (ans == FALSE)
	    {
	      Put_message("Leaving group alone.");
	      return SUB_NORMAL;
	    }
	  if (ans < 0)
	    {
	      Put_message("Aborting...");
	      return SUB_ERROR;
	    }
	}
      /* ans == TRUE  || ~verbose */
      args[0] = "foo";	/* not used. */
      args[1] = name;
      DeleteList(2, args);
    }
  else if (status != MR_NO_MATCH)
    {
      com_err(program_name, status, " Aborting Delete User.");
      return SUB_ERROR;
    }
  return SUB_NORMAL;
}
开发者ID:sipb,项目名称:athena-svn-mirror,代码行数:35,代码来源:delete.c

示例14: main

void main()
{	
	struct node* head = AddAtTail();
	printf("List len = %d\n", ListLen(head));
	PrintList(head);
	DeleteList(head);
}
开发者ID:pmiriyals,项目名称:C_Programs,代码行数:7,代码来源:BasicLinkedList.c

示例15: main

int main()
{
	char ch[10],num[5];
	LinkList head;
	head=CreatList();
	printlist(head);
	printf(" Delete node (y/n):");
	scanf("%s",num);
	if(strcmp(num,"y")==0||strcmp(num,"Y")==0) 
	{
		printf("Please input Delete_data:");
		scanf("%s",ch);
		DeleteList(head,ch);
		printlist(head);
	}
	printf("Add node ? (y/n): ");
	scanf("%s",ch);
	if(strcmp(ch,"y")==0||strcmp(ch,"Y")==0)
	{
		head=AddNode(head);
	}
	printlist(head);
	system("pause");
	DeleteAll(head);
}
开发者ID:homesangsang,项目名称:datastruct,代码行数:25,代码来源:linkedlist.c


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