StrDict::SetArgv( int, char *const * )

Set a list of values, such as the arguments to a Helix Core Server command.

Virtual?

No

 

Class

StrDict

 

Arguments

int argc

the number of variables (arguments)

 

char *const *argv

the variables (arguments) themselves

Returns

void

 

Notes

SetArgv() is typically used when setting command arguments in ClientApi.

Example

p4api.cc provides an example of using SetArgv() to set arguments.

int main( int argc, char **argv )
{
    ClientUser ui;
    ClientApi client;
    Error e;

    // Any special protocol mods
    // client.SetProtocol( "tag", "" );

    // Connect to server
    client.Init( &e );

    // Run the command "argv[1] argv[2...]"
    client.SetArgv( argc - 2, argv + 2 );
    client.Run( argv[1], &ui );

    // Close connection
    client.Final( &e );

    return 0;
}