phonebookengines_old/contactsmodel/cntdbdumper/src/dbdbmsdumper.h
branchRCL_3
changeset 19 5b6f26637ad3
equal deleted inserted replaced
18:d4f567ce2e7c 19:5b6f26637ad3
       
     1 /**
       
     2 * Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 /**
       
    21  @file
       
    22  @internalComponent
       
    23  @released
       
    24 */
       
    25 
       
    26 #ifndef __CDbDbmsDumper_H__
       
    27 #define __CDbDbmsDumper_H__
       
    28 
       
    29 #include <e32std.h>
       
    30 #include <e32def.h>
       
    31 #include <f32file.h> 
       
    32 #include <d32dbms.h> 
       
    33 #include <badesca.h>
       
    34 
       
    35 /**
       
    36 CDbDbmsDumper class dumps the contents and columns of all tables in 
       
    37 a given database in HTML format to a given location 
       
    38 */
       
    39 class CDbDbmsDumper : public CBase
       
    40 	{
       
    41 public:  
       
    42 	static CDbDbmsDumper* NewLC(const TDesC& aDbName, const TDesC& aOutputDir);
       
    43 	~CDbDbmsDumper();
       
    44 	TInt NumberOfTables() const;
       
    45 	void OutputDBContentsL(); 
       
    46 		                      
       
    47 private:
       
    48     void ConstructL(const TDesC& aDbName, const TDesC& aOutputDir);  
       
    49 	void OutputTableNameToFile(TInt aTableIndex);
       
    50 	CDesCArray* OutputTableColHeadingsToFileLC(TInt aTableIndex);
       
    51 	void OutputTableColDataToFileL(const CDesCArray& colNames);
       
    52 	void OutputTableToFileL(TInt aTableIndex);
       
    53 
       
    54 	void FieldHeaderColL(TInt aFieldIndex);
       
    55 	void LongBinaryL(TInt aFieldIndex);
       
    56 	void DumpStreamL(RReadStream& stream);
       
    57 
       
    58 
       
    59 private: 
       
    60 	RFs	iFsSession;
       
    61 	RDbNamedDatabase iDatabase;
       
    62 	RDbs iDbsSession;
       
    63 	RDbTable iDbTable;
       
    64 	CDbTableNames* iTableNames; 
       
    65 	RFile iFile;
       
    66 	HBufC8*	iBuffer;
       
    67 };
       
    68 
       
    69 #endif // __CDbDbmsDumper_H__