Arcane  v3.15.3.0
Documentation utilisateur
Chargement...
Recherche...
Aucune correspondance
Référence de la classe Arcane::CommandLineArguments

Arguments de la ligne de commande. Plus de détails...

#include <arcane/utils/CommandLineArguments.h>

+ Graphe de collaboration de Arcane::CommandLineArguments:

Classes

class  Impl
 

Fonctions membres publiques

 CommandLineArguments (int *argc, char ***argv)
 Créé une instance à partir des arguments (argc,argv)
 
 CommandLineArguments (const StringList &args)
 
 CommandLineArguments (const CommandLineArguments &rhs)
 
CommandLineArgumentsoperator= (const CommandLineArguments &rhs)
 
intcommandLineArgc () const
 
char *** commandLineArgv () const
 
void fillArgs (StringList &args) const
 Remplit args avec arguments de la ligne de commande.
 
String getParameter (const String &param_name) const
 Récupère le paramètre de nom param_name.
 
void addParameterLine (const String &line)
 Ajoute un paramètre.
 
void fillParameters (StringList &param_names, StringList &values) const
 Récupère la liste des paramètres et leur valeur.
 
const ParameterListparameters () const
 Liste des paramètres.
 
ParameterListparameters ()
 Liste des paramètres.
 

Description détaillée

Arguments de la ligne de commande.

Cette classe utilise une sémantique par référence. Les méthodes commandLineArgc() et commandLineArgv() retournent des pointeurs sur des structures internes à cette classe qui ne sont allouées que tant que l'instance est valide. Ils peuvent être utilisés pour les méthodes classiques du C qui attendent des pointeurs sur les arguments de la ligne de commande (soit l'équivalent du couple (argc,argv) de la fonction main()).

Les arguments qui commencent par '-A' sont considérés comme des paramètres de type (clé,valeur) et doivent avoir la forme -A,x=y avec x la clé et y la valeur. Il est ensuite possible de récupérer la valeur d'un paramètre par l'intermédiaire de sa clé via la méthode getParameter(); Si un paramètre est présent plusieurs fois sur la ligne de commande, c'est la dernière valeur qui est conservée.

Définition à la ligne 48 du fichier CommandLineArguments.h.

Documentation des constructeurs et destructeur

◆ CommandLineArguments() [1/4]

Arcane::CommandLineArguments::CommandLineArguments ( int argc,
char ***  argv 
)

Créé une instance à partir des arguments (argc,argv)

Définition à la ligne 152 du fichier CommandLineArguments.cc.

◆ CommandLineArguments() [2/4]

Arcane::CommandLineArguments::CommandLineArguments ( )

Définition à la ligne 162 du fichier CommandLineArguments.cc.

◆ CommandLineArguments() [3/4]

Arcane::CommandLineArguments::CommandLineArguments ( const StringList args)
explicit

Définition à la ligne 172 du fichier CommandLineArguments.cc.

◆ CommandLineArguments() [4/4]

Arcane::CommandLineArguments::CommandLineArguments ( const CommandLineArguments rhs)

Définition à la ligne 182 du fichier CommandLineArguments.cc.

◆ ~CommandLineArguments()

Arcane::CommandLineArguments::~CommandLineArguments ( )

Définition à la ligne 201 du fichier CommandLineArguments.cc.

Documentation des fonctions membres

◆ addParameterLine()

void Arcane::CommandLineArguments::addParameterLine ( const String line)

Ajoute un paramètre.

Voir également
ParameterList::addParameterLine()

Définition à la ligne 249 du fichier CommandLineArguments.cc.

Référencé par Arcane::ApplicationInfo::addParameterLine().

◆ commandLineArgc()

int * Arcane::CommandLineArguments::commandLineArgc ( ) const

Définition à la ligne 209 du fichier CommandLineArguments.cc.

◆ commandLineArgv()

char *** Arcane::CommandLineArguments::commandLineArgv ( ) const

Définition à la ligne 218 du fichier CommandLineArguments.cc.

◆ fillArgs()

void Arcane::CommandLineArguments::fillArgs ( StringList args) const

Remplit args avec arguments de la ligne de commande.

Définition à la ligne 227 du fichier CommandLineArguments.cc.

Référencé par Arcane::ApplicationInfo::args().

◆ fillParameters()

void Arcane::CommandLineArguments::fillParameters ( StringList param_names,
StringList values 
) const

Récupère la liste des paramètres et leur valeur.

Retourne dans param_names la liste des noms des paramètres et dans values la valeur associée.

Définition à la ligne 258 du fichier CommandLineArguments.cc.

◆ getParameter()

String Arcane::CommandLineArguments::getParameter ( const String param_name) const

Récupère le paramètre de nom param_name.

Retourne une chaîne nulle s'il n'y aucun paramètre avec ce nom.

Définition à la ligne 240 du fichier CommandLineArguments.cc.

◆ operator=()

CommandLineArguments & Arcane::CommandLineArguments::operator= ( const CommandLineArguments rhs)

Définition à la ligne 191 du fichier CommandLineArguments.cc.

◆ parameters()

const ParameterList & Arcane::CommandLineArguments::parameters ( ) const

Liste des paramètres.

Définition à la ligne 267 du fichier CommandLineArguments.cc.

Référencé par Arcane::ArcaneLauncher::init().


La documentation de cette classe a été générée à partir des fichiers suivants :