# Interface ICefCommandLine

Description
Hierarchy
Fields
Methods
Properties

## Unit

uCEFInterfaces

## Declaration

`type ICefCommandLine = interface(ICefBaseRefCounted)`

## Description

Interface used to create and/or parse command line arguments. Arguments with "–", "-" and, on Windows, "/" prefixes are considered switches. Switches will always precede any arguments without switch prefixes. Switches can optionally have a value specified using the "=" delimiter (e.g. "-switch=value"). An argument of "–" will terminate switch parsing with all subsequent tokens, regardless of prefix, being interpreted as non-switch arguments. Switch names should be lowercase ASCII and will be converted to such if necessary. Switch values will retain the original case and UTF8 encoding. This interface can be used before cef_initialize() is called.

UNKNOWN

<see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_command_line_capi.h">CEF source file: /include/capi/cef_command_line_capi.h (cef_command_line_t))

## Hierarchy

- IInterface
- ICefBaseRefCounted
- ICefCommandLine

## Overview

### Methods

| `function IsValid: Boolean;`
| `function IsReadOnly: Boolean;`
| `function Copy: ICefCommandLine;`
| `procedure InitFromArgv(argc: Integer; const argv: PPAnsiChar);`
| `procedure InitFromString(const commandLine: ustring);`
| `procedure Reset;`
| `function GetCommandLineString: ustring;`
| `procedure GetArgv(var args: TStrings);`
| `function GetProgram: ustring;`
| `procedure SetProgram(const prog: ustring);`
| `function HasSwitches: Boolean;`
| `function HasSwitch(const name: ustring): Boolean;`
| `function GetSwitchValue(const name: ustring): ustring;`
| `function GetSwitches(var switches: TStrings): boolean; overload;`
| `function GetSwitches(var SwitchKeys, SwitchValues: TStringList): boolean; overload;`
| `procedure AppendSwitch(const name: ustring);`
| `procedure AppendSwitchWithValue(const name, value: ustring);`
| `function HasArguments: Boolean;`
| `procedure GetArguments(var arguments: TStrings);`
| `procedure AppendArgument(const argument: ustring);`
| `procedure PrependWrapper(const wrapper: ustring);`
| `procedure RemoveSwitch(const name_: ustring);`

### Properties

| `property CommandLineString : ustring read GetCommandLineString;`

## Description

### Methods

| `function IsValid: Boolean;`
Returns true (1) if this object is valid. Do not call any other functions if this function returns false (0). ###### Attributes GUID['{6B43D21B-0F2C-4B94-B4E6-4AF0D7669D8E}']

| `function IsReadOnly: Boolean;`
Returns true (1) if the values of this object are read-only. Some APIs may expose read-only objects.

| `function Copy: ICefCommandLine;`
Returns a writable copy of this object.

| `procedure InitFromArgv(argc: Integer; const argv: PPAnsiChar);`
Initialize the command line with the specified |argc| and |argv| values. The first argument must be the name of the program. This function is only supported on non-Windows platforms.

| `procedure InitFromString(const commandLine: ustring);`
Initialize the command line with the string returned by calling GetCommandLineW(). This function is only supported on Windows.

| `procedure Reset;`
Reset the command-line switches and arguments but leave the program component unchanged.

| `function GetCommandLineString: ustring;`
Constructs and returns the represented command line string. Use this function cautiously because quoting behavior is unclear.

| `procedure GetArgv(var args: TStrings);`
Retrieve the original command line string as a vector of strings. The argv array: `{ program, [(–|-|/)switch[=value]]*, [–], [argument]* }`

| `function GetProgram: ustring;`
Get the program part of the command line string (the first item).

| `procedure SetProgram(const prog: ustring);`
Set the program part of the command line string (the first item).

| `function HasSwitches: Boolean;`
Returns true (1) if the command line has switches.

| `function HasSwitch(const name: ustring): Boolean;`
Returns true (1) if the command line contains the given switch.

| `function GetSwitchValue(const name: ustring): ustring;`
Returns the value associated with the given switch. If the switch has no value or isn't present this function returns the NULL string.

| `function GetSwitches(var switches: TStrings): boolean; overload;`
Returns the map of switch names and values. If a switch has no value an NULL string is returned.

| `function GetSwitches(var SwitchKeys, SwitchValues: TStringList): boolean; overload;`
Returns the map of switch names and values. If a switch has no value an NULL string is returned.

| `procedure AppendSwitch(const name: ustring);`
Add a switch to the end of the command line.

| `procedure AppendSwitchWithValue(const name, value: ustring);`
Add a switch with the specified value to the end of the command line. If the switch has no value pass an NULL value string.

| `function HasArguments: Boolean;`
True if there are remaining command line arguments.

| `procedure GetArguments(var arguments: TStrings);`
Get the remaining command line arguments.

| `procedure AppendArgument(const argument: ustring);`
Add an argument to the end of the command line.

| `procedure PrependWrapper(const wrapper: ustring);`
Insert a command before the current command. Common for debuggers, like "valgrind" or "gdb –args".

| `procedure RemoveSwitch(const name_: ustring);`
Remove a switch from the command line. If no such switch is present, this has no effect.

### Properties

| `property CommandLineString : ustring read GetCommandLineString;`
Constructs and returns the represented command line string. Use this function cautiously because quoting behavior is unclear.

Generated by PasDoc 0.16.0-snapshot.