os/security/securityanddataprivacytools/securitytools/certapp/utils/filestream_private.h
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
     1 #ifndef __FILESTREAM_PRIVATE_H__
     2 #define __FILESTREAM_PRIVATE_H__/*
     3 * Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
     4 * All rights reserved.
     5 * This component and the accompanying materials are made available
     6 * under the terms of the License "Eclipse Public License v1.0"
     7 * which accompanies this distribution, and is available
     8 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     9 *
    10 * Initial Contributors:
    11 * Nokia Corporation - initial contribution.
    12 *
    13 * Contributors:
    14 *
    15 * Description: 
    16 *
    17 */
    18 
    19 
    20 #include <s32strm.h>
    21 #include "filestream.h"
    22 
    23 /**
    24  * @file
    25  * @internalComponent
    26  */
    27 
    28 class FileStreamBuf : public MStreamBuf
    29 	{
    30 public:
    31 	FileStreamBuf(const std::string &aFileName, bool aWritable, bool aSpecialTextHandling = false);
    32 	
    33 	void StripUtf8HeaderIfPresent();
    34 
    35 	// Symbian MStreamBuf does not have a virtual destructor and relies on DoRelease virtual...
    36 
    37 private:
    38 	virtual TInt DoReadL(TAny *aPtr,TInt aMaxLength);
    39 	virtual void DoWriteL(const TUint8* aPtr,TInt aLength);
    40 	virtual TStreamPos DoSeekL(TMark aMark,TStreamLocation aLocation,TInt anOffset);
    41 	virtual void DoRelease();
    42 private:
    43 	bool iWritable;
    44 	std::fstream iFile;
    45 	bool iSpecialTextHandling;
    46 	};
    47 
    48 #endif