Update contrib.
1 // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // Flogger (File and Serial logger) utils header
23 #ifndef __COMSDBGAUX_H__
24 #define __COMSDBGAUX_H__
27 #include "comsdbgsvr.h"
29 class CFileLoggerServer;
33 class CIniFileWatcher : public CActive
36 static CIniFileWatcher* NewL(RFs& aFs, CFileLoggerServer& aServer, const TDesC& aIniFile);
39 virtual void DoCancel();
42 CIniFileWatcher(RFs& aFs, CFileLoggerServer& aServer, const TDesC& aIniFile);
47 CFileLoggerServer& iServer;
48 TFullName iWatchedIniFile;
51 class MLogArrayAccess;
53 class CTimeManager : public CBase, public MBeating
56 static CTimeManager* NewL(MLogArrayAccess& aArrayAccess);
59 virtual void Synchronize();
62 CTimeManager(MLogArrayAccess& aArrayAccess);
64 void SendTimeUpdate();
66 MLogArrayAccess& iArrayAccess;
67 CHeartbeat* iHeartbeat;
71 class MIniFlushModeAndLogValidQuery
74 virtual TBool LogValid(const TDesC8& aSubsystem, const TDesC8& aComponent) const = 0;
75 virtual void FlushingOn(TBool& aFlushOn) const = 0;
78 class MIniLoggingMediaQuery
81 virtual void LogMediaSetting(TDes8& aString) const = 0;
82 virtual void FlushingOn(TBool& aFlushOn) const = 0;
83 virtual void LogPathSetting(TDes8& aString) const = 0;
88 class CSubsystemSettings : public CBase
91 CSubsystemSettings(const TDesC8& aName);
93 ~CSubsystemSettings();
94 void SetSubsystemName(const TDesC8& aName);
95 TInt AddComponent(const TDesC8& aComponent);
96 static TInt CompareCSubsystemSettings(const CSubsystemSettings& aFirst, const CSubsystemSettings& aSecond);
97 static TInt CompareTComponent(const TNameTag& aFirst, const TNameTag& aSecond);
98 void SetWildCarded(TBool aWildCarded);
99 TBool IsWildCarded() const {return iSubsystemWildcarded;}
100 TBool ElementExistsInArray(const TDesC8& aComponent) const ;
102 TBool iSubsystemWildcarded;
103 TNameTag iSubsystemName;
104 RArray<TNameTag> iComponentArray;
107 class CIniLoggingPairs : public CBase
110 static CIniLoggingPairs* NewL();
111 void AddSettingL(const TDesC8& aSubsystem, const TDesC8& aComponent);
113 TBool SettingValid(const TDesC8& aSubSystem, const TDesC8& aComponent) const;
118 RPointerArray<CSubsystemSettings> iSubsystems;
119 CSubsystemSettings* iProbeSubsystem;
122 class CIniFileParser : public CBase, public MIniFlushModeAndLogValidQuery, public MIniLoggingMediaQuery
125 static CIniFileParser* NewL(RFs& aFs);
127 TInt ParseIniFile(TDesC& aIniFile);
128 //From MIniFlushModeAndLogValidQuery
129 virtual TBool LogValid(const TDesC8& aSubsystem, const TDesC8& aComponent) const;
130 //From MiniLoggingMediaQuery
131 virtual void LogMediaSetting(TDes8& aString) const;
132 virtual void LogPathSetting(TDes8& aString) const;
133 // From MIniFlushModeAndLogValidQuery and MiniLoggingMediaQuery
134 virtual void FlushingOn(TBool& aFlushOn) const;
135 void FinaliseFlushSetting();
136 TBool Win32DebugEnabled() const { return iWin32DebugEnabled; }
138 CIniFileParser(RFs& aFs);
139 void DoParseIniFileL(TDesC& aIniFile);
140 TInt GetNextTokenAndCheck(TLex8& lex, TPtr8& tempPtr);
143 TBuf8<KMaxMediaStringLength> iLoggingMediaString;
144 TFlushStates iForceFlushState;
145 TBool iWin32DebugEnabled;
146 //iIniSettings == NULL <==> bad ini file, logging is off and client has been told.
147 CIniLoggingPairs* iIniSettings;
148 TFilePath iLoggingPathString;
151 #endif //__COMSDBGAUX_H__