Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
ArgumentList::Argument Struct Reference

One of the arguments in an ArgumentList. More...

#include <juce_ConsoleApplication.h>

Public Member Functions

File resolveAsFile () const
 Resolves this argument as an absolute File, using the current working directory as a base for resolving relative paths, and stripping quotes, etc.
 
File resolveAsExistingFile () const
 Resolves this argument as an absolute File, using the current working directory as a base for resolving relative paths, and also doing a check to make sure the file exists.
 
File resolveAsExistingFolder () const
 Resolves a user-supplied folder name into an absolute File, using the current working directory as a base for resolving relative paths, and also doing a check to make sure the folder exists.
 
bool isLongOption () const
 Returns true if this argument starts with a double dash.
 
bool isShortOption () const
 Returns true if this argument starts with a single dash.
 
bool isLongOption (const String &optionRoot) const
 Returns true if this argument starts with a double dash, followed by the given string.
 
String getLongOptionValue () const
 If this argument is a long option with a value, this returns the value.
 
bool isShortOption (char shortOptionCharacter) const
 Returns true if this argument starts with a single dash and then contains the given character somewhere inside it.
 
bool isOption () const
 Returns true if this argument starts with one or more dashes.
 
bool operator== (StringRef stringToCompare) const
 Compares this argument against a string.
 
bool operator!= (StringRef stringToCompare) const
 Compares this argument against a string.
 

Public Attributes

String text
 The original text of this argument.
 

Detailed Description

One of the arguments in an ArgumentList.

Member Function Documentation

◆ resolveAsFile()

File ArgumentList::Argument::resolveAsFile ( ) const

Resolves this argument as an absolute File, using the current working directory as a base for resolving relative paths, and stripping quotes, etc.

◆ resolveAsExistingFile()

File ArgumentList::Argument::resolveAsExistingFile ( ) const

Resolves this argument as an absolute File, using the current working directory as a base for resolving relative paths, and also doing a check to make sure the file exists.

If the file doesn't exist, this will call fail() with a suitable error.

See also
resolveAsFile, resolveAsExistingFolder

◆ resolveAsExistingFolder()

File ArgumentList::Argument::resolveAsExistingFolder ( ) const

Resolves a user-supplied folder name into an absolute File, using the current working directory as a base for resolving relative paths, and also doing a check to make sure the folder exists.

If the folder doesn't exist, this will call fail() with a suitable error.

See also
resolveAsFile, resolveAsExistingFile

◆ isLongOption() [1/2]

bool ArgumentList::Argument::isLongOption ( ) const

Returns true if this argument starts with a double dash.

◆ isShortOption() [1/2]

bool ArgumentList::Argument::isShortOption ( ) const

Returns true if this argument starts with a single dash.

◆ isLongOption() [2/2]

bool ArgumentList::Argument::isLongOption ( const String & optionRoot) const

Returns true if this argument starts with a double dash, followed by the given string.

◆ getLongOptionValue()

String ArgumentList::Argument::getLongOptionValue ( ) const

If this argument is a long option with a value, this returns the value.

e.g. for "--foo=bar", this would return 'bar'.

◆ isShortOption() [2/2]

bool ArgumentList::Argument::isShortOption ( char shortOptionCharacter) const

Returns true if this argument starts with a single dash and then contains the given character somewhere inside it.

◆ isOption()

bool ArgumentList::Argument::isOption ( ) const

Returns true if this argument starts with one or more dashes.

◆ operator==()

bool ArgumentList::Argument::operator== ( StringRef stringToCompare) const

Compares this argument against a string.

The string may be a pipe-separated list of options, e.g. "--help|-h"

◆ operator!=()

bool ArgumentList::Argument::operator!= ( StringRef stringToCompare) const

Compares this argument against a string.

The string may be a pipe-separated list of options, e.g. "--help|-h"

Member Data Documentation

◆ text

String ArgumentList::Argument::text

The original text of this argument.


The documentation for this struct was generated from the following file:
linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram