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


C++ ListAdd函数代码示例

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


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

示例1: CopySpecifier

struct Specifier * CopySpecifier(struct Specifier * spec)
{
if(spec)
switch(spec->type)
{
case 0:
return MkSpecifier(spec->specifier);
case 2:
{
struct Identifier * id = CopyIdentifier(spec->id);
struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
struct Enumerator * enumerator;

if(spec->list)
{
for(enumerator = (*spec->list).first; enumerator; enumerator = enumerator->next)
ListAdd(list, CopyEnumerator(enumerator));
}
return MkEnum(id, list);
}
case 3:
case 4:
{
struct Identifier * id = CopyIdentifier(spec->id);
struct __ecereNameSpace__ecere__sys__OldList * list = (((void *)0));
struct ClassDef * def;
struct Specifier * s;

if(spec->definitions)
{
list = MkList();
if(spec->list)
{
for(def = (*spec->list).first; def; def = def->next)
ListAdd(list, CopyClassDef(def));
}
}
s = MkStructOrUnion(spec->type, id, list);
s->extDeclStruct = CopyExtDecl(spec->extDeclStruct);
return s;
}
case 1:
{
struct Specifier * copy = (copy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Specifier), copy->type = 1, copy->name = __ecereNameSpace__ecere__sys__CopyString(spec->name), copy->symbol = spec->symbol, copy->templateArgs = (((void *)0)), copy);

return copy;
}
case 7:
return MkSpecifierSubClass(CopySpecifier(spec->_class));
case 8:
return __extension__ ({
struct Specifier * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Specifier);

__ecereInstance1->loc = spec->loc, __ecereInstance1->type = 8, __ecereInstance1->templateParameter = spec->templateParameter, __ecereInstance1;
});
case 5:
return MkSpecifierExtended(CopyExtDecl(spec->extDecl));
}
开发者ID:tcsilver,项目名称:ecere-sdk,代码行数:58,代码来源:copy.c

示例2: QMkDeclarationBase

struct Declaration * QMkDeclarationBase(int base, struct InitDeclarator * initDecl)
{
struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * initDecls = (((void *)0));

ListAdd(specs, MkSpecifier(base));
if(initDecl)
{
initDecls = MkList();
ListAdd(initDecls, initDecl);
}
return MkDeclaration(specs, initDecls);
}
开发者ID:DBane,项目名称:sdk,代码行数:12,代码来源:shortcuts.c

示例3: ListView_GetItemCount

BOOL ZipDlg::ListMove( BOOL blnUp)
{
	int	intSize		= ListView_GetItemCount( hwndList) ;
	bool	blnMoved	= false ;	// 動く余地があるかどうか
	int	intIndex ;
	
	vector<BOOL> vecSelected ;
	BOOL blnTop = TRUE ;

	for( int i = 0; i < intSize; i++)
	{
		intIndex = blnUp ? i : intSize - i - 1 ;
		
		if( ListView_GetItemState( hwndList, intIndex, LVIS_SELECTED))
		{
			if( !blnMoved)
			{
				continue ;
			}

			// リストビュー
			ListView_DeleteItem( hwndList, intIndex) ;

			if( blnUp) // index減少
			{
				ListAdd( vecFileList[ intIndex], intIndex - 1) ;
			}
			else
			{
				ListAdd( vecFileList[ intIndex], intIndex + 1) ;
			}

			if( blnTop)
			{
				ListView_SetItemState( hwndList, intIndex + ( blnUp ? -1 : 1), LVIS_FOCUSED, LVIS_FOCUSED) ;
				ListView_EnsureVisible( hwndList, intIndex + ( blnUp ? -1 : 1), FALSE) ;
				blnTop = FALSE ;
			}

			// ドキュメント
			ListReload() ;
		}
		else
		{
			blnMoved = true ;
		}
	}

	return TRUE ;
}
开发者ID:nitoyon,项目名称:mp3album,代码行数:50,代码来源:ZipDlg.cpp

示例4: AddOpenNeighboursToList

void AddOpenNeighboursToList (location_t here)
{
  if (HasExit (here, NORTH)) {
    ListAdd (Neighbour (here, NORTH));
  }
  if (HasExit (here, EAST)) {
    ListAdd (Neighbour (here, EAST));
  }
  if (HasExit (here, SOUTH)) {
    ListAdd (Neighbour (here, SOUTH));
  }
  if (HasExit (here, WEST)) {
    ListAdd (Neighbour (here, WEST));
  }
}
开发者ID:micromouseonline,项目名称:micromouse-maze,代码行数:15,代码来源:mazeflooder.c

示例5: mimeTypeAdd

static void
mimeTypeAdd(MIMEType *   const MIMETypeP,
            const char * const type,
            const char * const ext,
            bool *       const successP) {
    
    uint16_t index;
    void * mimeTypesItem;
    bool typeIsInList;

    assert(MIMETypeP != NULL);

    typeIsInList = ListFindString(&MIMETypeP->typeList, type, &index);
    if (typeIsInList)
        mimeTypesItem = MIMETypeP->typeList.item[index];
    else
        mimeTypesItem = (void*)PoolStrdup(&MIMETypeP->pool, type);

    if (mimeTypesItem) {
        bool extIsInList;
        extIsInList = ListFindString(&MIMETypeP->extList, ext, &index);
        if (extIsInList) {
            MIMETypeP->typeList.item[index] = mimeTypesItem;
            *successP = TRUE;
        } else {
            void * extItem = (void*)PoolStrdup(&MIMETypeP->pool, ext);
            if (extItem) {
                bool addedToMimeTypes;

                addedToMimeTypes =
                    ListAdd(&MIMETypeP->typeList, mimeTypesItem);
                if (addedToMimeTypes) {
                    bool addedToExt;
                    
                    addedToExt = ListAdd(&MIMETypeP->extList, extItem);
                    *successP = addedToExt;
                    if (!*successP)
                        ListRemove(&MIMETypeP->typeList);
                } else
                    *successP = FALSE;
                if (!*successP)
                    PoolReturn(&MIMETypeP->pool, extItem);
            } else
                *successP = FALSE;
        }
    } else
        *successP = FALSE;
}
开发者ID:BirminghamConservatoire,项目名称:IntegraLive,代码行数:48,代码来源:response.c

示例6: DragQueryFile

LRESULT ZipDlg::OnDropFiles( HWND hwnd, WPARAM wParam, LPARAM lParam)
{
	HDROP hDrop = (HDROP)wParam ;
	unsigned int intIndex = DragQueryFile( hDrop, 0xFFFFFFFF, NULL, 0) ;
	for( unsigned int i = 0; i < intIndex; i++)
	{
		char pszBuf[ MAX_PATH + 1] ;
		DragQueryFile( hDrop, i, pszBuf, MAX_PATH) ;
		string s = pszBuf ;

		// フォルダか?
		if( GetFileAttributes( s.c_str()) & FILE_ATTRIBUTE_DIRECTORY)
		{
			// 検索開始
			string strFind = s + "\\*.*" ;
			WIN32_FIND_DATA wfd ;
			HANDLE hFind = FindFirstFile( strFind.c_str(), &wfd) ;
			if( hFind == INVALID_HANDLE_VALUE)
			{
				return 0 ;
			}
			do
			{
				// アイテム名のフィルタリング
				string strFile = wfd.cFileName ;
				if( strFile == "." || strFile == "..")
				{
					continue ;
				}

				Mp3File* pMp3 = new Mp3File( s + "\\" + strFile) ;
				pMp3->SetSaveName( GetFileName( s) + "\\" + strFile) ;
				ListAdd( pMp3, vecFileList.size()) ;
			}
			while( FindNextFile( hFind, &wfd)) ;

			FindClose( hFind) ;
		}
		else if( !Profile::blnOnlyMp3 || s.rfind( ".mp3") == s.size() - 4 || 
		    s.rfind( ".MP3") == s.size() - 4)
		{
			Mp3File* pMp3 = new Mp3File( pszBuf) ;
			ListAdd( pMp3, vecFileList.size()) ;
		}
	}
	DragFinish( hDrop) ;
	return TRUE ;
}
开发者ID:nitoyon,项目名称:mp3album,代码行数:48,代码来源:ZipDlg.cpp

示例7: CopyInstantiation

static struct Instantiation * CopyInstantiation(struct Instantiation * inst)
{
struct Instantiation * copy;
struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
struct MembersInit * member;

if(inst->members)
{
for(member = (*inst->members).first; member; member = member->next)
ListAdd(list, CopyMembersInit(member));
}
copy = MkInstantiation(CopySpecifier(inst->_class), CopyExpression(inst->exp), list);
copy->data = inst->data;
if(inst->data)
{
struct Symbol * classSym = FindClass(inst->_class->name);
struct __ecereNameSpace__ecere__com__Class * _class = classSym ? classSym->registered : (((void *)0));

if(_class)
{
if(_class->type == 0)
((struct __ecereNameSpace__ecere__com__Instance *)(char *)((struct __ecereNameSpace__ecere__com__Instance *)copy->data))->_refCount++;
}
}
copy->loc = inst->loc;
copy->isConstant = inst->isConstant;
return copy;
}
开发者ID:tcsilver,项目名称:ecere-sdk,代码行数:28,代码来源:copy.c

示例8: RCBC_MiniXML_ProcessGeometries_Mesh_FloatArray

/**
 * Reads a float array, such as verticies, normals, text cords, etc...
 * @param tempory The ModelTempory struct to hold the array.
 * @param mesh The mesh using the floats
 * @param xnode The XML node containing the data.
 * @return 
 */
FloatArray* RCBC_MiniXML_ProcessGeometries_Mesh_FloatArray(ModelTempory *tempory, Mesh *mesh, mxml_node_t *xnode) {
	DEBUG_M("Entering function...");

	const char* id = mxmlElementGetAttr(xnode, "id");
	const char* count_s = mxmlElementGetAttr(xnode, "count");
	int count = atoi(count_s);

	FloatArray* newarray = NEW(FloatArray, count);
	if(!newarray) {
		return NULL;
	}

	GLfloat f = 0.0f;
	int i = 0;
	char* pch = strtok(xnode->child->value.opaque, " ");
	while(pch && i < count) {
		sscanf(pch, "%f", &f);
		newarray->values[i] = f;
		pch = strtok(NULL, " ");
		i++;
	}

	ListAdd(tempory->deleteme, newarray);

	DEBUG_M("exiting function");
	return newarray;
}
开发者ID:dcbishop,项目名称:rcbc,代码行数:34,代码来源:rcbc_xml_minixml_geometries.c

示例9: ListAddFromString

int ListAddFromString(TList *list,char *c)
{
	char *t = 0;
	char *p = 0;

	/* sanity */
	if (!list) {
		return FALSE;
	}

	if (c)
		while (1)
		{
			NextToken(&c);

			while (*c==',')
				c++;

			if (!(t=GetToken(&c)))
				break;

			p=c-2;

			while (*p==',')
				*(p--)='\0';

			if (*t)
				if (!ListAdd(list,t))
					return FALSE;
		};

	return TRUE;
}
开发者ID:cmjonze,项目名称:anacapa,代码行数:33,代码来源:data.c

示例10: LookupNotificationAttributes

static NotificationAttributes * LookupNotificationAttributes(struct ListHead * attributesList, int shortServerID, ObjectIDType objectID,
                                                             ObjectInstanceIDType objectInstanceID, ResourceIDType resourceID)
{
    NotificationAttributes * result = NULL;
    if (attributesList != NULL)
    {
        struct ListHead * i;
        ListForEach(i, attributesList)
        {
            NotificationAttributes * attributes = ListEntry(i, NotificationAttributes, list);
            if ((attributes != NULL) &&
                (attributes->ShortServerID == shortServerID) &&
                (attributes->ObjectID == objectID) &&
                (attributes->ObjectInstanceID == objectInstanceID) &&
                (attributes->ResourceID == resourceID))
            {
                result = attributes;
                break;
            }
        }
        if (result == NULL)
        {
            // doesn't exist yet, so create
            result = malloc(sizeof(NotificationAttributes));
            memset(result, 0, sizeof(NotificationAttributes));
            memset(result->Valid, 0, sizeof(result->Valid));
            result->ObjectID = objectID;
            result->ObjectInstanceID = objectInstanceID;
            result->ResourceID = resourceID;
            result->ShortServerID = shortServerID;
            ListAdd(&result->list, attributesList);
        }
    }
开发者ID:FlowM2M,项目名称:AwaLWM2M,代码行数:33,代码来源:lwm2m_attributes.c

示例11: QMkClass

struct TypeName * QMkClass(char * spec, struct Declarator * decl)
{
struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();

ListAdd(specs, MkSpecifierName(spec));
return MkTypeName(specs, decl);
}
开发者ID:DBane,项目名称:sdk,代码行数:7,代码来源:shortcuts.c

示例12: RCBC_MiniXML_ProcessTextureEffects_Newparam

/* Process the <library_effects><effect><profile_COMMON><newparam> section of COLLADA */
void RCBC_MiniXML_ProcessTextureEffects_Newparam(ModelTempory *tempory, mxml_node_t *node, Hookup* fx_hookup) {
	DEBUG_M("Entering function...");
	mxml_node_t* child;
	//const char* newparam_sid = mxmlElementGetAttr(node, "id");
	//const char* surface_type;
	const char* init_from;

	assert(tempory);
	assert(node);
	assert(fx_hookup);

	DumpNodeInfo(node);

	for(node = node->child; node != NULL; node = node->next) {
		DumpNodeInfo(node);
		if(node->type == MXML_ELEMENT
		&& strcasecmp(node->value.element.name, "surface") == 0) {

			for(child = node->child; child != NULL; child = child->next) {
				if(child->type == MXML_ELEMENT
				&& strcasecmp(child->value.element.name, "init_from") == 0) {

					//surface_type = mxmlElementGetAttr(child, "type");
					init_from = child->child->value.opaque;
					Hookup* img_hookup = NEW(Hookup, (char*)init_from, &fx_hookup->ptr);
					ListAdd(tempory->sinks, img_hookup);
				}
			}

		}
	}
}
开发者ID:dcbishop,项目名称:rcbc,代码行数:33,代码来源:rcbc_xml_minixml_textures.c

示例13: QBrackets

struct Expression * QBrackets(struct Expression * exp)
{
struct __ecereNameSpace__ecere__sys__OldList * expList = MkList();

ListAdd(expList, exp);
return MkExpBrackets(expList);
}
开发者ID:DBane,项目名称:sdk,代码行数:7,代码来源:shortcuts.c

示例14: RCBC_MiniXML_ProcessTextureEffects

/* Process the <library_effects> section of COLLADA */
void RCBC_MiniXML_ProcessTextureEffects(ModelTempory *tempory, mxml_node_t *node) {
	DEBUG_M("Entering function...");
	const char* id;
	mxml_node_t* child;

	assert(tempory);
	if(!node) {
		return;
	}
	
	/* Loop through all the effect nodes */
	for(node = node->child; node != NULL; node = node->next) {
		if(node->type == MXML_ELEMENT	&&
			strcasecmp(node->value.element.name, "effect") == 0) {

			id = mxmlElementGetAttr(node, "id");

			for(child = node->child; child != NULL; child = child->next) {
				if(child->type == MXML_ELEMENT &&
					strcasecmp(child->value.element.name, "profile_COMMON") == 0) {

					Hookup* fx_hookup =  NEW(Hookup, (char*)id, NULL);
					ListAdd(tempory->sources, fx_hookup);

					RCBC_MiniXML_ProcessTextureEffects_Profile(tempory, child, fx_hookup);
				}
			}

		}
	}
}
开发者ID:dcbishop,项目名称:rcbc,代码行数:32,代码来源:rcbc_xml_minixml_textures.c

示例15: QMkExpCond

struct Expression * QMkExpCond(struct Expression * cond, struct Expression * exp, struct Expression * elseExp)
{
struct __ecereNameSpace__ecere__sys__OldList * expList = MkList();

ListAdd(expList, exp);
return MkExpCondition(cond, expList, elseExp);
}
开发者ID:DBane,项目名称:sdk,代码行数:7,代码来源:shortcuts.c


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