1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/persistentdata/persistentstorage/dbms/sdbms/Sd_DbProps.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,70 @@
1.4 +// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +// RDbPropsFactory class
1.18 +//
1.19 +//
1.20 +
1.21 +#ifndef __SD_DBPROPS_H__
1.22 +#define __SD_DBPROPS_H__
1.23 +
1.24 +#include "D32DBMS.H"
1.25 +#include "D32Security.h"
1.26 +
1.27 +using namespace DBSC;
1.28 +
1.29 +/**
1.30 +This structure describes an object, which conatains
1.31 +database properties, which can be collected from a database path and format string.
1.32 +@internalComponent
1.33 +*/
1.34 +struct TDbProps
1.35 + {
1.36 + TDbPolicyRequest iDbPolicyRequest;
1.37 + TDriveNumber iDriveNumber;
1.38 + TFileName iPath;
1.39 + TDbName iFormatStr;
1.40 + };
1.41 +
1.42 +/**
1.43 +RDbPropsFactory class is used to parse the supplied database path and format string and
1.44 +collect from them some database properties, such as requested access type, drive number,
1.45 +security policy uid, path, format string
1.46 +@internalComponent
1.47 +*/
1.48 +class RDbPropsFactory
1.49 + {
1.50 +public:
1.51 + static void StripCommonPart(TDes& aDbName);
1.52 + static void ConstructCommonPart(TUid aPolicyUid, TDes& aRes);
1.53 + RDbPropsFactory(RFs&);
1.54 + void OpenL();
1.55 + void Close();
1.56 + TDbProps* ExtractLC(const TDesC& aPath, const TDesC& aFormatStr);
1.57 + TDbProps* ExtractLC(const TDesC& aPath, TUid aPolicyUid);
1.58 + void GetPrivatePathL(TDriveNumber aDriveNumber, TDes& aRes) const;
1.59 +
1.60 +private:
1.61 + void ExtractSecureL(const TDesC& aFormatStr, TDbProps& aDbProps);
1.62 + void ExtractNonSecureL(const TDesC& aPath, const TDesC& aFormatStr, TDbProps& aDbProps);
1.63 + void ConstructFullDbPathL(TDbProps& aDbProps);
1.64 + void ConstructFormatString(TDbProps& aDbProps, const TDesC& aFormatStr);
1.65 +
1.66 +private:
1.67 + RFs& iFs;
1.68 + TParse* iFileNameParser;
1.69 + HBufC* iPrivateDataPath;
1.70 +
1.71 + };
1.72 +
1.73 +#endif//__SD_DBPROPS_H__