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

Namespaces

namespace  details
 

Classes

class  AllOfGroup
 Group of args where all arguments should be defined. More...
 
class  Arg
 Argument with one value that can be present only once in the command line. More...
 
class  ArgIface
 Interface for arguments. More...
 
class  AtLeastOneGroup
 Group of args where at least one argument should be defined. More...
 
class  BaseException
 Base exception of the library. 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  GroupIface
 Interface for the groups. More...
 
class  Help
 Help argument. More...
 
class  HelpHasBeenPrintedException
 This exception notifies about that help has been printed. 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...
 
class  OnlyOneGroup
 Group of args where only one argument can be defined. 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

using Args::ArgPtrToAPI = typedef std::unique_ptr< ArgIface, details::Deleter< ArgIface > >

Definition at line 114 of file cmd_line.hpp.

◆ Char

using Args::Char = typedef String::value_type

Char type.

Definition at line 327 of file types.hpp.

◆ CmdLineAPI

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

Definition at line 112 of file cmd_line.hpp.

◆ ContextInternal

What Context actually is.

Definition at line 49 of file context.hpp.

◆ OutStreamType

using Args::OutStreamType = typedef std::ostream

Out stream type.

Definition at line 330 of file types.hpp.

◆ String

using Args::String = typedef std::string

String type.

Definition at line 324 of file types.hpp.

◆ StringList

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

List of strings.

Definition at line 346 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 56 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 41 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 93 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 51 of file value_utils.hpp.