epoc32/include/uloggercommands.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
williamr@4
     1
// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
williamr@4
     2
// All rights reserved.
williamr@4
     3
// This component and the accompanying materials are made available
williamr@4
     4
// under the terms of "Eclipse Public License v1.0"
williamr@4
     5
// which accompanies this distribution, and is available
williamr@4
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
williamr@4
     7
//
williamr@4
     8
// Initial Contributors:
williamr@4
     9
// Nokia Corporation - initial contribution.
williamr@4
    10
//
williamr@4
    11
// Contributors:
williamr@4
    12
//
williamr@4
    13
// Description:
williamr@4
    14
// ULogger commands
williamr@4
    15
// 
williamr@4
    16
//
williamr@4
    17
williamr@4
    18
/**
williamr@4
    19
 @file
williamr@4
    20
 @internalTechnology
williamr@4
    21
 @prototype
williamr@4
    22
*/
williamr@4
    23
williamr@4
    24
#ifndef ULOGGERCOMMANDS_H_
williamr@4
    25
#define ULOGGERCOMMANDS_H_
williamr@4
    26
williamr@4
    27
#include <e32base.h>
williamr@4
    28
williamr@4
    29
/** Ulogger command line syntax description.
williamr@4
    30
ULogger is used to configure and enable/disable logging of trace data on device.
williamr@4
    31
williamr@4
    32
SYNOPSIS: ulogger [-rqtvhioH][-edl <config_options>...][-fsSoicbmn]...
williamr@4
    33
williamr@4
    34
DESCRIPTION:
williamr@4
    35
ULogger groups the commands into execution and configuration commands
williamr@4
    36
where options -rqtvhH belong to the former group and -edlbnmfsSoic to the latter.
williamr@4
    37
Execution commands: -rqtvhioH, require no other arguments.
williamr@4
    38
Configuration commands are further divided into:
williamr@4
    39
	-edl, these require one of the following options '-fsSoic'
williamr@4
    40
	to be present, these will fail if too many or missing options are given.
williamr@4
    41
	-fsSoicbmn, these will apply the arguments depending on provided option -edl.
williamr@4
    42
	
williamr@4
    43
OPTIONS
williamr@4
    44
Execution commands:
williamr@4
    45
-r                      Start logging (Run)
williamr@4
    46
-q                      Stop logging (Quit)
williamr@4
    47
-t                      Restart (restarT) while logging, to update configurations
williamr@4
    48
-v                      Verbose mode, will list all results, or silent mode is
williamr@4
    49
							assumed and only error codes will be returned
williamr@4
    50
-h 						List of options.
williamr@4
    51
-o						List active output plugin.
williamr@4
    52
-i						List active input plugin.
williamr@4
    53
-H						This man page.
williamr@4
    54
-?						The version of this tool and most usefull commands.
williamr@4
    55
williamr@4
    56
Configuration commands:
williamr@4
    57
-e <-fsSoicbmn options> ...	Enable/set either of option -fsSoicbmn
williamr@4
    58
-d <-fsSoic options> ...	Disable/delete either of option -fsSoic
williamr@4
    59
-l <-fsSoicbmn options> ...	List either of option -fsSoicbmn
williamr@4
    60
-f [<filter> ...]       Enable/disable/list primary filter 0-255
williamr@4
    61
-s [<filter> ...]       Enable/disable/list secondary filter 0-4294967295
williamr@4
    62
-S 						Enable/disable/list secondary filtering.
williamr@4
    63
							Enable to filter on secondary filters,
williamr@4
    64
							Disable to log all traces irrespective of secondary filter.
williamr@4
    65
							By default filtering is enabled.
williamr@4
    66
-o [<filename>]         Enable/disable an output plugin, list all output plugins
williamr@4
    67
-i [<filename>]         Enable/disable an input plugin, list all input plugins
williamr@4
    68
-c [<filename> <config> ...]       Enable(set)/delete/list plugin configurations.
williamr@4
    69
							First argument must be the name of the configuration
williamr@4
    70
							to be changed and any following arguments are treated as values of
williamr@4
    71
							this configuration. The configuration keyword can not use any white 
williamr@4
    72
							characters (e.g. space or tabulation key).
williamr@4
    73
-b [<size> ...]         Buffer size, 1-1024 Kb rounded up to nearest page size, 4Kb.
williamr@4
    74
-n [<size> ...]         Notification size, 0-1024 Kb rounded up to nearest page size, 4Kb.
williamr@4
    75
-m [<mode> ...]         Buffer mode, 'circular' or 'straight'. Default is straight.
williamr@4
    76
 */
williamr@4
    77
williamr@4
    78
williamr@4
    79
//ulogger commands
williamr@4
    80
_LIT(KCmdEnable,				"e");
williamr@4
    81
_LIT(KCmdDisable,				"d");
williamr@4
    82
_LIT(KCmdList,					"l");
williamr@4
    83
_LIT(KCmdPrimaryFilter,			"f");
williamr@4
    84
_LIT(KCmdSecondaryFilter,		"s");
williamr@4
    85
_LIT(KCmdSecondaryFilterToggle,	"S");
williamr@4
    86
_LIT(KCmdOutputPlugin,		 	"o");
williamr@4
    87
_LIT(KCmdInputPlugin,		 	"i");
williamr@4
    88
_LIT(KCmdPluginConfigurations, 	"c");
williamr@4
    89
_LIT(KCmdBuffer, 				"b");
williamr@4
    90
_LIT(KCmdNotification,		 	"n");
williamr@4
    91
_LIT(KCmdBufferMode, 			"m");
williamr@4
    92
_LIT(KCmdVerboseMode,			"v");
williamr@4
    93
_LIT(KCmdStart,					"r");
williamr@4
    94
_LIT(KCmdStop,	  				"q");
williamr@4
    95
_LIT(KCmdRestart,	  			"t");
williamr@4
    96
_LIT(KCmdHelp,		  			"h");
williamr@4
    97
_LIT(KCmdMan,					"H");
williamr@4
    98
_LIT(KCmdVersion,				"?");
williamr@4
    99
_LIT(KCmdIndicator, 			"-");
williamr@4
   100
_LIT(KCmdAll,					"all");
williamr@4
   101
_LIT(KCmdBufferModeCircular,	"circular");
williamr@4
   102
_LIT(KCmdBufferModeStraight,	"straight");
williamr@4
   103
williamr@4
   104
williamr@4
   105
/**
williamr@4
   106
@internalTechnology
williamr@4
   107
@prototype
williamr@4
   108
*/
williamr@4
   109
enum TCommand
williamr@4
   110
 	{		
williamr@4
   111
 	EUnknown = 0,
williamr@4
   112
 	ERunAsService,     // function not yet implemented in server!
williamr@4
   113
 	EDontRunAsService, // function not yet implemented in server!
williamr@4
   114
 	EStart,
williamr@4
   115
 	EStop,
williamr@4
   116
 	ERestart,
williamr@4
   117
 	ESetPrimaryFilter,
williamr@4
   118
 	EGetPrimaryFilters,
williamr@4
   119
 	ERemovePrimaryFilter,
williamr@4
   120
 	ESetSecondaryFilter,
williamr@4
   121
 	EGetSecondaryFilters,
williamr@4
   122
 	ERemoveSecondaryFilter,
williamr@4
   123
 	EGetSecondaryFiltering,
williamr@4
   124
 	EEnableSecondaryFiltering,
williamr@4
   125
 	EDisableSecondaryFiltering,
williamr@4
   126
 	ESetActivePlugin,
williamr@4
   127
 	EGetActivePlugin,
williamr@4
   128
 	EGetInstalledPlugins,
williamr@4
   129
 	ESetActiveInputPlugin,
williamr@4
   130
 	EGetActiveInputPlugin,
williamr@4
   131
 	EDeactivateInputPlugin,
williamr@4
   132
 	EGetInputPlugins,
williamr@4
   133
	ESetPluginSettings,
williamr@4
   134
	EGetPluginSettings,
williamr@4
   135
 	ERemovePluginSettings,
williamr@4
   136
 	EResizeTraceBuffer,
williamr@4
   137
 	EGetTraceBufferSize,
williamr@4
   138
 	ESetDataNotificationSize,
williamr@4
   139
 	EGetDataNotificationSize,
williamr@4
   140
 	ESetBufferMode,
williamr@4
   141
	EGetBufferMode,
williamr@4
   142
	EHelp,
williamr@4
   143
	EManPage,
williamr@4
   144
	EVersion
williamr@4
   145
 	};
williamr@4
   146
williamr@4
   147
/**
williamr@4
   148
@internalTechnology
williamr@4
   149
@prototype
williamr@4
   150
 */
williamr@4
   151
class TCommandLookup
williamr@4
   152
 {
williamr@4
   153
 public:
williamr@4
   154
 	TCommandLookup(const TDesC* aMainCommand, const TDesC*	aSubCommand, const TCommand aCommand)
williamr@4
   155
 		: iMainCommand(aMainCommand), iSubCommand(aSubCommand), iCommand(aCommand)
williamr@4
   156
 		{}
williamr@4
   157
 	
williamr@4
   158
 	//data
williamr@4
   159
 	const TDesC* 	iMainCommand;
williamr@4
   160
 	const TDesC*	iSubCommand;
williamr@4
   161
 	TCommand 	iCommand;
williamr@4
   162
 };
williamr@4
   163
williamr@4
   164
 
williamr@4
   165
/**
williamr@4
   166
Interface to execute command. 
williamr@4
   167
williamr@4
   168
@internalTechnology
williamr@4
   169
@prototype
williamr@4
   170
 */ 
williamr@4
   171
class MCommandImpl
williamr@4
   172
	{
williamr@4
   173
	public:
williamr@4
   174
		virtual TInt DoCommandL(TCommand aCommand, const RArray<TPtrC>& aValues) = 0;
williamr@4
   175
	};
williamr@4
   176
 
williamr@4
   177
 
williamr@4
   178
/**
williamr@4
   179
This is a utility class to parse command line arguments and to generate accurate event 
williamr@4
   180
to execute required command. 
williamr@4
   181
To use this class properly, MCommandImpl interface must be implemented and pointer to it 
williamr@4
   182
must be passed during object construction.
williamr@4
   183
williamr@4
   184
@internalTechnology
williamr@4
   185
@prototype
williamr@4
   186
 */
williamr@4
   187
class CCommand : public CBase
williamr@4
   188
	{
williamr@4
   189
	public:
williamr@4
   190
		IMPORT_C static CCommand* NewL(MCommandImpl* aCommandImpl);
williamr@4
   191
		IMPORT_C static CCommand* NewLC(MCommandImpl* aCommandImpl);
williamr@4
   192
		IMPORT_C ~CCommand();
williamr@4
   193
		IMPORT_C void ConstructL();
williamr@4
   194
		IMPORT_C TInt HandleCommandL(const RArray<TPtrC>& aArgs);
williamr@4
   195
			
williamr@4
   196
williamr@4
   197
	private:
williamr@4
   198
		CCommand(MCommandImpl* aCommandImpl);
williamr@4
   199
		TInt PrepareCommandL(RArray<TPtrC>& aArgs);
williamr@4
   200
		
williamr@4
   201
		//data
williamr@4
   202
		MCommandImpl* iCommandImpl;
williamr@4
   203
		TBool 		  iVerbose;
williamr@4
   204
		RArray<TCommandLookup> iCommandsLookup;
williamr@4
   205
	};
williamr@4
   206
	
williamr@4
   207
#endif /*ULOGGERCOMMANDS_H_*/