1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/persistentdata/loggingservices/filelogger/SSVR/FLOGMAN.H Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,102 @@
1.4 +// Copyright (c) 1997-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 +//
1.18 +
1.19 +/**
1.20 + @file
1.21 + @internalTechnology
1.22 +*/
1.23 +
1.24 +#ifndef __FLOGMAN_H__
1.25 +#define __FLOGMAN_H__
1.26 +
1.27 +#include <f32file.h>
1.28 +#include <flogger.h>
1.29 +
1.30 +class CFileLogger;
1.31 +NONSHARABLE_CLASS(CFileLoggerManager) : public CBase
1.32 +/**
1.33 +@internalComponent
1.34 +*/
1.35 + {
1.36 +public:
1.37 + static CFileLoggerManager* NewL();
1.38 + ~CFileLoggerManager();
1.39 +//
1.40 + void FindOrCreateLogL(TLogFile& aLogFile);
1.41 + void CloseLog(const TLogFile& aLogFile);
1.42 + void WriteToLogL(const TLogFile& aLogFile, const TDesC8& aBuf);
1.43 + void DeleteLogger(CFileLogger* aLogger);
1.44 +private:
1.45 + CFileLoggerManager();
1.46 + void ConstructL();
1.47 + TInt FindLogger(const TLogFile& aLogFile) const;
1.48 +private:
1.49 + CArrayFixFlat<CFileLogger*> iLogger;
1.50 + RFs iFs;
1.51 + };
1.52 +
1.53 +class CLoggerDeletionTimer;
1.54 +
1.55 +NONSHARABLE_CLASS(CFileLogger) : public CBase
1.56 +/**
1.57 +@publishedAll
1.58 +@deprecated becoming internal
1.59 +*/
1.60 + {
1.61 +public:
1.62 + static CFileLogger* NewL(CFileLoggerManager* aLoggerManager,TLogFile& aLogFile, RFs& aFs);
1.63 + ~CFileLogger();
1.64 + void Close();
1.65 + void WriteLogL(const TDesC8& aBuf);
1.66 + TBool StartDeletionTimer();
1.67 + void CancelDeletionTimer();
1.68 + void DeletionTimerExpired();
1.69 + inline void IncrementAccessCount();
1.70 + inline void DecrementAccessCount();
1.71 + inline TInt AccessCount() const;
1.72 + inline TLogFile LogFile() const;
1.73 + inline TBool DeletionTimerActive() const;
1.74 +private:
1.75 + CFileLogger(CFileLoggerManager* aLoggerManager,TLogFile& aLogFile, RFs& aFs);
1.76 + void ConstructL(TLogFile& aLogFile);
1.77 + void GetFolderAndFileNameL(TFileName& aFolder,TFileName& aFilename) const;
1.78 +private:
1.79 + CLoggerDeletionTimer* iTimer;
1.80 + CFileLoggerManager* iLoggerManager;
1.81 + RFs iFs;
1.82 + RFile iFile;
1.83 + TLogFile iLogFile;
1.84 + TInt iAccessCount;
1.85 + };
1.86 +
1.87 +NONSHARABLE_CLASS(CLoggerDeletionTimer) : public CTimer
1.88 +/**
1.89 +@internalComponent
1.90 +*/
1.91 + {
1.92 +public:
1.93 + static CLoggerDeletionTimer* NewL(CFileLogger* aLogger);
1.94 + ~CLoggerDeletionTimer();
1.95 +protected:
1.96 + CLoggerDeletionTimer(CFileLogger* aLoggerManager);
1.97 + void RunL();
1.98 +private:
1.99 + CFileLogger* iLogger;
1.100 + };
1.101 +
1.102 +#include "FLOGMAN.INL"
1.103 +
1.104 +#endif
1.105 +