testconns/statapi/device/source/statapi/inc/filedump.h
changeset 4 b8d1455fddc0
equal deleted inserted replaced
2:73b88125830c 4:b8d1455fddc0
       
     1 /*
       
     2 * Copyright (c) 2005-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 #ifndef FILEDUMP_H
       
    21 #define FILEDUMP_H
       
    22 
       
    23 #include <e32base.h>
       
    24 #include <f32file.h>
       
    25 #include <e32cons.h>
       
    26 
       
    27 #include "stat_interfaces.h"
       
    28 
       
    29 #define ST_MAXMESSAGELENGTH		510
       
    30 
       
    31 class FileDump : public MNotifyLogMessage
       
    32 {
       
    33 public:
       
    34 	FileDump():bInitialised(EFalse), pConsole(NULL){}
       
    35 
       
    36 	// from MNotifyLogMessage
       
    37 	GLDEF_C TInt Init(RFs &fsSession, TPtrC16 filename, CConsoleBase* console);
       
    38 	GLDEF_C TBool IsInitialised() const;
       
    39 	GLDEF_C void Msg(TPtrC16 text, ...);
       
    40 	GLDEF_C void CloseFile();
       
    41 
       
    42 private:
       
    43 	TBool bInitialised;
       
    44 	RFile file;
       
    45 	CConsoleBase* pConsole;
       
    46 	TBuf16<ST_MAXMESSAGELENGTH + 2> buf;	// temp buffer
       
    47 
       
    48 	GLDEF_C TBool WriteBuffer16ToFile(TDesC16 &buffer, RFile &handle);
       
    49 };
       
    50 
       
    51 #endif