persistentstorage/sql/SRC/Server/SqlSrvUtil.inl
author NTT DOCOMO, INC <bugtracker-ml@nttdocomo.com>
Wed, 07 Jul 2010 08:33:46 +0100
branchRCL_3
changeset 19 b19bba7c5885
parent 0 08ec8eefde2f
permissions -rw-r--r--
Bug 3170 "SQL library test T_SQLPERFORMANCE4 fails with USER 84 panic"

// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
// All rights reserved.
// This component and the accompanying materials are made available
// under the terms of "Eclipse Public License v1.0"
// which accompanies this distribution, and is available
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
//
// Initial Contributors:
// Nokia Corporation - initial contribution.
//
// Contributors:
//
// Description:
//

/**
 
 @param aTableName UTF16 encoded table name.
 
 @return Non-zero if aTableName is one of the system tables (the table name prefix is KSystemPrefix16).
 
 @internalComponent
*/
inline TBool IsSystemTableName(const TDesC16& aTableName)
	{
	return ::CompareNoCase16(aTableName.Left(KSystemPrefix16().Length()), KSystemPrefix16) == 0;
   	}

/**
@param aTableName UTF8 encoded table name.

@return Non-zero if aTableName is one of the system tables (the table name prefix is KSystemPrefix8).

@internalComponent
*/
inline TBool IsSystemTableName(const TDesC8& aTableName)
	{
	return ::CompareNoCase8(aTableName.Left(KSystemPrefix8().Length()), KSystemPrefix8) == 0;
	}

/**
@param aTableName UTF8 encoded table name.

@return Non-zero if aTableName name prefix is is KSqlitePrefix8.

@internalComponent
*/
inline TBool IsSqliteTableName(const TDesC8& aTableName)
	{
	return ::CompareNoCase8(aTableName.Left(KSqlitePrefix8().Length()), KSqlitePrefix8) == 0;
	}

/**
Returns non-zero if a file with "aFileName" name exists.

@internalComponent
*/
inline TBool FileExists(RFs& aFs, const TDesC& aFileName)
	{
	TEntry entry;
	return aFs.Entry(aFileName, entry) == KErrNone;
	}