metadataengine/server/inc/mdssqldbmaintenance.h
author Pat Downey <patd@symbian.org>
Wed, 01 Sep 2010 12:24:24 +0100
branchRCL_3
changeset 21 85f623e1ef41
parent 20 f23c07ec56e2
child 22 29d87345eaeb
permissions -rw-r--r--
Revert incorrect RCL_3 drop: Revision: 201033 Kit: 201035

/*
* Copyright (c) 2002-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:  Class for SQL database creation*
*/

#ifndef __MDSSQLDBMAINTENANCE_H__
#define __MDSSQLDBMAINTENANCE_H__

#include <e32base.h>

// FORWARD DECLARATIONS
class CMdSSchema;


_LIT( KMdsSchemaVersionName, "SchemaVersion" );
_LIT( KMdsDBVersionName, "DBVersion" );

// CLASS DECLARATION
/**
* Class for validating and creating tables in database.
*/
class CMdSSqlDbMaintenance : public CBase
    {
    public: // Constructors and destructor
        virtual ~CMdSSqlDbMaintenance();
        
        static CMdSSqlDbMaintenance* NewL();
        static CMdSSqlDbMaintenance* NewLC();

    private: // Private constructors

        CMdSSqlDbMaintenance();
        void ConstructL( );

    public: // Personal methods

        /**
        * Validates the existence of database
        * @return ETrue if the database exists, EFalse if needs to be created.
        */
        TBool ValidateL();

        /**
        * Drops and re-creates tables
        */
        void CreateDatabaseL();
    };

#endif // __MDSSQLDBMAINTENANCE_H__