persistentstorage/sql/TEST/t_sqlcmdlineutil.h
author Chris Dudding <chris.dudding@nokia.com>
Tue, 06 Jul 2010 16:50:33 +0100
changeset 32 0bacd7dbb9a9
parent 28 7a522c0700d3
child 55 44f437012c90
permissions -rw-r--r--
Fix for Bug 3168 Incorrect copyright header in sql and sqlite3api
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
28
7a522c0700d3 201019_09
hgs
parents:
diff changeset
     1
// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
7a522c0700d3 201019_09
hgs
parents:
diff changeset
     2
// All rights reserved.
7a522c0700d3 201019_09
hgs
parents:
diff changeset
     3
// This component and the accompanying materials are made available
7a522c0700d3 201019_09
hgs
parents:
diff changeset
     4
// under the terms of "Eclipse Public License v1.0"
7a522c0700d3 201019_09
hgs
parents:
diff changeset
     5
// which accompanies this distribution, and is available
7a522c0700d3 201019_09
hgs
parents:
diff changeset
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
7a522c0700d3 201019_09
hgs
parents:
diff changeset
     7
//
7a522c0700d3 201019_09
hgs
parents:
diff changeset
     8
// Initial Contributors:
7a522c0700d3 201019_09
hgs
parents:
diff changeset
     9
// Nokia Corporation - initial contribution.
7a522c0700d3 201019_09
hgs
parents:
diff changeset
    10
//
7a522c0700d3 201019_09
hgs
parents:
diff changeset
    11
// Contributors:
7a522c0700d3 201019_09
hgs
parents:
diff changeset
    12
//
7a522c0700d3 201019_09
hgs
parents:
diff changeset
    13
// Description:
7a522c0700d3 201019_09
hgs
parents:
diff changeset
    14
//
7a522c0700d3 201019_09
hgs
parents:
diff changeset
    15
7a522c0700d3 201019_09
hgs
parents:
diff changeset
    16
#ifndef T_SQLCMDLINEUTIL_H
7a522c0700d3 201019_09
hgs
parents:
diff changeset
    17
#define T_SQLCMDLINEUTIL_H
7a522c0700d3 201019_09
hgs
parents:
diff changeset
    18
7a522c0700d3 201019_09
hgs
parents:
diff changeset
    19
#include <f32file.h>
7a522c0700d3 201019_09
hgs
parents:
diff changeset
    20
7a522c0700d3 201019_09
hgs
parents:
diff changeset
    21
class RTest;
7a522c0700d3 201019_09
hgs
parents:
diff changeset
    22
7a522c0700d3 201019_09
hgs
parents:
diff changeset
    23
struct TCmdLineParams
7a522c0700d3 201019_09
hgs
parents:
diff changeset
    24
	{
7a522c0700d3 201019_09
hgs
parents:
diff changeset
    25
	enum TDbEncoding
7a522c0700d3 201019_09
hgs
parents:
diff changeset
    26
		{
7a522c0700d3 201019_09
hgs
parents:
diff changeset
    27
		EDbUtf8,
7a522c0700d3 201019_09
hgs
parents:
diff changeset
    28
		EDbUtf16
7a522c0700d3 201019_09
hgs
parents:
diff changeset
    29
		};
7a522c0700d3 201019_09
hgs
parents:
diff changeset
    30
	
7a522c0700d3 201019_09
hgs
parents:
diff changeset
    31
	inline TCmdLineParams(TDbEncoding aDefaultEncoding = EDbUtf16,
7a522c0700d3 201019_09
hgs
parents:
diff changeset
    32
						  TInt aDefaultPageSize = 1024,
7a522c0700d3 201019_09
hgs
parents:
diff changeset
    33
						  TInt aDefaultCacheSize = 1000) :	
7a522c0700d3 201019_09
hgs
parents:
diff changeset
    34
		iDefaultEncoding(aDefaultEncoding),
7a522c0700d3 201019_09
hgs
parents:
diff changeset
    35
	    iDefaultPageSize(aDefaultPageSize),
7a522c0700d3 201019_09
hgs
parents:
diff changeset
    36
	    iDefaultCacheSize(aDefaultCacheSize)
7a522c0700d3 201019_09
hgs
parents:
diff changeset
    37
		{
7a522c0700d3 201019_09
hgs
parents:
diff changeset
    38
		SetDefaults();
7a522c0700d3 201019_09
hgs
parents:
diff changeset
    39
		}
7a522c0700d3 201019_09
hgs
parents:
diff changeset
    40
	
7a522c0700d3 201019_09
hgs
parents:
diff changeset
    41
	inline void SetDefaults()
7a522c0700d3 201019_09
hgs
parents:
diff changeset
    42
		{
7a522c0700d3 201019_09
hgs
parents:
diff changeset
    43
		iDbEncoding = iDefaultEncoding;
7a522c0700d3 201019_09
hgs
parents:
diff changeset
    44
		iPageSize = iDefaultPageSize;
7a522c0700d3 201019_09
hgs
parents:
diff changeset
    45
		iCacheSize = iDefaultCacheSize;
7a522c0700d3 201019_09
hgs
parents:
diff changeset
    46
		iDriveName.Copy(_L("c:"));
7a522c0700d3 201019_09
hgs
parents:
diff changeset
    47
		iSoftHeapLimitKb = 0;
7a522c0700d3 201019_09
hgs
parents:
diff changeset
    48
		}
7a522c0700d3 201019_09
hgs
parents:
diff changeset
    49
	
7a522c0700d3 201019_09
hgs
parents:
diff changeset
    50
	const TDbEncoding	iDefaultEncoding;
7a522c0700d3 201019_09
hgs
parents:
diff changeset
    51
	const TInt			iDefaultPageSize;
7a522c0700d3 201019_09
hgs
parents:
diff changeset
    52
	const TInt			iDefaultCacheSize;
7a522c0700d3 201019_09
hgs
parents:
diff changeset
    53
	
7a522c0700d3 201019_09
hgs
parents:
diff changeset
    54
	TDbEncoding	iDbEncoding;
7a522c0700d3 201019_09
hgs
parents:
diff changeset
    55
	TInt		iPageSize;
7a522c0700d3 201019_09
hgs
parents:
diff changeset
    56
	TInt 		iCacheSize;
7a522c0700d3 201019_09
hgs
parents:
diff changeset
    57
	TDriveName	iDriveName;
7a522c0700d3 201019_09
hgs
parents:
diff changeset
    58
	TInt		iSoftHeapLimitKb;
7a522c0700d3 201019_09
hgs
parents:
diff changeset
    59
	};
7a522c0700d3 201019_09
hgs
parents:
diff changeset
    60
7a522c0700d3 201019_09
hgs
parents:
diff changeset
    61
void GetCmdLineParamsAndSqlConfigString(RTest& aTest, const TDesC& aTestName, TCmdLineParams& aCmdLineParams, TDes8& aConfigStr);
7a522c0700d3 201019_09
hgs
parents:
diff changeset
    62
void PrepareDbName(const TDesC& aDeafultDbName, const TDriveName& aDriveName, TDes& aDbName);
7a522c0700d3 201019_09
hgs
parents:
diff changeset
    63
void SetSoftHeapLimit(TInt aSoftHeapLimit);
7a522c0700d3 201019_09
hgs
parents:
diff changeset
    64
void ResetSoftHeapLimit();
7a522c0700d3 201019_09
hgs
parents:
diff changeset
    65
7a522c0700d3 201019_09
hgs
parents:
diff changeset
    66
#endif//T_SQLCMDLINEUTIL_H