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


C++ CDbColSet::Col方法代码示例

本文整理汇总了C++中CDbColSet::Col方法的典型用法代码示例。如果您正苦于以下问题:C++ CDbColSet::Col方法的具体用法?C++ CDbColSet::Col怎么用?C++ CDbColSet::Col使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CDbColSet的用法示例。


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

示例1: AlterEventTblIfNoSimIdL

/**
Alters the "Event" table if the the table does not have "SimId" column.
@return KErrNone, The "alter" operation has completed successfully, system wide or database specific error code otherwise.  
@leave  KErrNoMemory, an out of memory condition has occurred;
                      Some other failure codes, not related to the "alter" opertaion.
*/
TInt CLogServDatabaseMarshall::AlterEventTblIfNoSimIdL(CDbColSet& aEventTblColSet)
    {//Compiled only when SYMBIAN_ENABLE_EVENTLOGGER_DUALSIM macro is defined
    const TDbCol* simIdCol = aEventTblColSet.Col(KLogFieldEventSimId);
    TInt err = KErrNone;
    if(!simIdCol)
        {
        TDbCol col(KLogFieldEventSimId, EDbColUint32);
        aEventTblColSet.AddL(col);
        err = iDatabase.AlterTable(KLogNameEventString, aEventTblColSet);
        }
    return err;
    }
开发者ID:cdaffara,项目名称:symbiandump-os2,代码行数:18,代码来源:LogServDatabaseMarshall.cpp

示例2: AlterEventTblIfOldFmt

/**
Alters the "Event" table if the number column length is not KLogMaxNumberLength.
@return KErrNone, The "alter" operation has completed successfully, system wide or database specific error code otherwise.  
*/
TInt CLogServDatabaseMarshall::AlterEventTblIfOldFmt(CDbColSet& aEventTblColSet)
    {
    const TDbCol* numberCol = aEventTblColSet.Col(KLogFieldEventNumberString);
    __ASSERT_DEBUG(numberCol != NULL, User::Invariant());
    TInt err = KErrNone;
    // check the column width is correct
    if(numberCol->iMaxLength != KLogMaxNumberLength)
        {
        //The column width is not correct, so this is an old format database.
        //Modify the database so the number length is KLogMaxNumberLength.
        (const_cast <TDbCol*> (numberCol))->iMaxLength = KLogMaxNumberLength;
        err = iDatabase.AlterTable(KLogNameEventString, aEventTblColSet);
        }
    return err;
    }
开发者ID:cdaffara,项目名称:symbiandump-os2,代码行数:19,代码来源:LogServDatabaseMarshall.cpp

示例3: ExtHintFieldExistsL

TBool ExtHintFieldExistsL(RFs& theFS)
	{
	TBool theResult;
	RDbNamedDatabase theDatabase;
	
	TestNoErrL(theDatabase.Open(theFS, KDatabaseFileName,KCntDbSecureFormat));

	CDbColSet* theIdentitiTable = theDatabase.ColSetL(KIdentityTableName);
	CleanupStack::PushL(theIdentitiTable);
	const TDbCol* theExtHint = theIdentitiTable->Col(KContactExtHintField);
	theResult = (theExtHint != NULL); //The field shouldn't exits

	CleanupStack::PopAndDestroy(); //theIdentitiTable
	theDatabase.Close();

	return theResult;
	}
开发者ID:bavanisp,项目名称:qtmobility-1.1.0,代码行数:17,代码来源:t_hintextension.cpp

示例4: MakeColumnAutoIncremetingL

void CLogServDatabaseMarshall::MakeColumnAutoIncremetingL(const TDesC& aTable, const TDesC& aColumn)
	{
	CDbColSet* newTable = iDatabase.ColSetL(aTable);
	CleanupStack::PushL(newTable);

	const TDbCol* oldCol = newTable->Col(aColumn);
	__ASSERT_DEBUG(oldCol != NULL, Panic(ELogNoSuchColumn));

	TDbCol newCol = *oldCol;
	newCol.iAttributes |= TDbCol::EAutoIncrement;

	newTable->Remove(aColumn);
	newTable->AddL(newCol);

	User::LeaveIfError(iDatabase.DropTable(aTable));
	User::LeaveIfError(iDatabase.CreateTable(aTable, *newTable));
		
	CleanupStack::PopAndDestroy(newTable);
	}
开发者ID:cdaffara,项目名称:symbiandump-os2,代码行数:19,代码来源:LogServDatabaseMarshall.cpp


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