OpenShot Library | OpenShotAudio  0.2.1
juce::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. More...
 
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. More...
 
bool isLongOption () const
 Returns true if this argument starts with a double dash. More...
 
bool isShortOption () const
 Returns true if this argument starts with a single dash. More...
 
bool isLongOption (const String &optionRoot) const
 Returns true if this argument starts with a double dash, followed by the given string. More...
 
String getLongOptionValue () const
 If this argument is a long option with a value, this returns the value. More...
 
bool isShortOption (char shortOptionCharacter) const
 Returns true if this argument starts with a single dash and then contains the given character somewhere inside it. More...
 
bool isOption () const
 Returns true if this argument starts with one or more dashes. More...
 
bool operator== (StringRef stringToCompare) const
 Compares this argument against a string. More...
 
bool operator!= (StringRef stringToCompare) const
 Compares this argument against a string. More...
 

Public Attributes

String text
 The original text of this argument. More...
 

Detailed Description

One of the arguments in an ArgumentList.

Definition at line 62 of file juce_ConsoleApplication.h.

Member Function Documentation

◆ resolveAsExistingFile()

File juce::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

Definition at line 63 of file juce_ConsoleApplication.cpp.

References resolveAsFile().

◆ resolveAsExistingFolder()

File juce::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

Definition at line 68 of file juce_ConsoleApplication.cpp.

References juce::ConsoleApplication::fail(), and resolveAsFile().

◆ isLongOption() [1/2]

bool juce::ArgumentList::Argument::isLongOption ( ) const

Returns true if this argument starts with a double dash.

Definition at line 82 of file juce_ConsoleApplication.cpp.

References text.

Referenced by getLongOptionValue(), isLongOption(), and operator==().

◆ isShortOption() [1/2]

bool juce::ArgumentList::Argument::isShortOption ( ) const

Returns true if this argument starts with a single dash.

Definition at line 83 of file juce_ConsoleApplication.cpp.

References text.

Referenced by isShortOption(), and operator==().

◆ isLongOption() [2/2]

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

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

Definition at line 86 of file juce_ConsoleApplication.cpp.

References isLongOption(), text, and juce::String::upToFirstOccurrenceOf().

◆ getLongOptionValue()

String juce::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'.

Definition at line 97 of file juce_ConsoleApplication.cpp.

References juce::String::indexOfChar(), isLongOption(), juce::String::substring(), and text.

◆ isShortOption() [2/2]

bool juce::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.

Definition at line 110 of file juce_ConsoleApplication.cpp.

References juce::String::containsChar(), isShortOption(), and text.

◆ isOption()

bool juce::ArgumentList::Argument::isOption ( ) const

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

Definition at line 84 of file juce_ConsoleApplication.cpp.

References text.

◆ operator==()

bool juce::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"

Definition at line 117 of file juce_ConsoleApplication.cpp.

References juce::StringArray::fromTokens(), isLongOption(), isShortOption(), and text.

Referenced by operator!=().

◆ operator!=()

bool juce::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"

Definition at line 134 of file juce_ConsoleApplication.cpp.

References operator==().

Member Data Documentation

◆ text

String juce::ArgumentList::Argument::text

The original text of this argument.

Definition at line 65 of file juce_ConsoleApplication.h.

Referenced by getLongOptionValue(), isLongOption(), isOption(), isShortOption(), operator==(), and resolveAsFile().


The documentation for this struct was generated from the following files: