args-parser 6.3.6
Loading...
Searching...
No Matches
Args Namespace Reference

Namespaces

namespace  details

Classes

class  Arg
 Argument with one value that can be present only once in the command line. More...
class  ArgIface
 Interface for arguments. More...
class  CmdLine
 CmdLine is class that holds all rguments and parse command line arguments in the correspondence with holded arguments. More...
class  Command
 Command in the command line interface. More...
class  Context
 Context is a list of words in the command line that user presented with interface for interacting with them. More...
class  BaseException
 Base exception of the library. More...
class  HelpHasBeenPrintedException
 This exception notifies about that help has been printed. More...
class  GroupIface
 Interface for the groups. More...
class  OnlyOneGroup
 Group of args where only one argument can be defined. More...
class  AllOfGroup
 Group of args where all arguments should be defined. More...
class  AtLeastOneGroup
 Group of args where at least one argument should be defined. More...
class  Help
 Help argument. More...
class  HelpPrinter
 HelpPrinter is a class that prints help. More...
class  HelpPrinterIface
 Interface for HelpPrinter. More...
class  MultiArg
 MultiArg is a class that presents argument in the command line taht can be presented more than once or can have more than one value. More...

Typedefs

template<typename PARENT, typename SELF, typename ARGPTR>
using CmdLineAPI = details::API<PARENT, SELF, ARGPTR, true>
using ArgPtrToAPI = std::unique_ptr<ArgIface, details::Deleter<ArgIface>>
typedef StringList ContextInternal
 What Context actually is.
using String = std::string
 String type.
using Char = String::value_type
 Char type.
using OutStreamType = std::ostream
 Out stream type.
using StringList = std::vector<String>
 List of strings.

Enumerations

enum class  ValueOptions { NoValue = 0 , OneValue = 1 , ManyValues = 2 }
 Options for value property. More...
enum class  ArgType {
  Command , Arg , MultiArg , OnlyOneGroup ,
  AllOfGroup , AtLeastOneGroup
}
 Type of the argument. More...

Functions

template<typename Container, typename Cmd, typename Ctx>
bool eatValues (Ctx &context, Container &container, const String &errorDescription, Cmd *cmdLine)
 Eat values in context.
template<typename Cmd, typename Ctx>
String eatOneValue (Ctx &context, const String &errorDescription, Cmd *cmdLine)
 Eat one value.

Typedef Documentation

◆ ArgPtrToAPI

Definition at line 90 of file cmd_line.hpp.

◆ Char

using Args::Char = String::value_type

Char type.

Definition at line 317 of file types.hpp.

◆ CmdLineAPI

template<typename PARENT, typename SELF, typename ARGPTR>
using Args::CmdLineAPI = details::API<PARENT, SELF, ARGPTR, true>

Definition at line 88 of file cmd_line.hpp.

◆ ContextInternal

What Context actually is.

Definition at line 25 of file context.hpp.

◆ OutStreamType

using Args::OutStreamType = std::ostream

Out stream type.

Definition at line 320 of file types.hpp.

◆ String

using Args::String = std::string

String type.

Definition at line 314 of file types.hpp.

◆ StringList

using Args::StringList = std::vector<String>

List of strings.

Definition at line 336 of file types.hpp.

Enumeration Type Documentation

◆ ArgType

enum class Args::ArgType
strong

Type of the argument.

Enumerator
Command 

Command.

Arg 

Argument.

MultiArg 

Multi argument.

OnlyOneGroup 

"Only one" group.

AllOfGroup 

"All of" group.

AtLeastOneGroup 

"At least one" group.

Definition at line 32 of file enums.hpp.

◆ ValueOptions

enum class Args::ValueOptions
strong

Options for value property.

Enumerator
NoValue 

No values.

OneValue 

One value.

ManyValues 

Many values.

Definition at line 18 of file enums.hpp.

Function Documentation

◆ eatOneValue()

template<typename Cmd, typename Ctx>
String Args::eatOneValue ( Ctx & context,
const String & errorDescription,
Cmd * cmdLine )

Eat one value.

Definition at line 68 of file value_utils.hpp.

◆ eatValues()

template<typename Container, typename Cmd, typename Ctx>
bool Args::eatValues ( Ctx & context,
Container & container,
const String & errorDescription,
Cmd * cmdLine )

Eat values in context.

Definition at line 29 of file value_utils.hpp.