nsICmdLineService

IID:e34783f4-ac08-11d2-8d19-00805fc2500c
Inherits From:nsISupports

This interface is implemented by the following components:


Properties

readonly PRInt32 argc

Argc The number of parameters passed in on the command line

[noscript] readonly charArray* argv

Argv returns a direct reference to the parameter array passed in to initialize() - do NOT dereference this array!

readonly char* programName

ProgramName

readonly char* URLToLoad

URLToLoad The URL to load as passed to the command line


Methods

char* getCmdLineValue ( char* argv ) nsICmdLineHandler getHandlerForParam ( char* param ) [noscript] void initialize ( PRInt32 argc , out char* argv )

char* getCmdLineValue ( char* argv )

returns the 2nd parameter, if any, to the parameter passed in For example, getCmdLineValue "-edit" will return any url that came after the -edit parameter

Arguments:
argv

nsICmdLineHandler getHandlerForParam ( char* param )

Get the command line handler for the given parameter

Arguments:
param: - can be any parameter, with or without leading "-" such as "-mail" or "edit" - Pass in a null string if you want the "default" handler

void initialize ( PRInt32 argc , out char* argv )

Used to pass the original argv/argc from main() Warning: This will hold a reference to the original argv passed into Initialze();

Arguments:
argc
argv

References

This interface is passed as an argument to the following methods:

nsIAppShellService.doProfileStartup, nsIAppShellService.ensure1Window, nsIAppShellService.initialize, nsINativeAppSupport.ensureProfile, nsIProfileInternal.startupWithArgs

Reference documentation is generated from Mozilla's source.

Add a note User Contributed Notes
No comments available

Copyright © 1999 - 2005 XULPlanet.com