Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

Struct shell

boost::process::v2::shell — Utility to parse commands.

Synopsis

// In header: <boost/process/v2/shell.hpp>


struct shell {
  // types
  typedef           ;
  typedef  ;

  // construct/copy/destruct
  () = ;
  template<typename Char, typename Traits> 
    ();
  (basic_cstring_ref< );
  ();
  (shell &) = ;
  (shell &&) ;
  shell & (shell &) = ;
  shell & (shell &&) ;
  ~();

  // public member functions
   () ;
   () ;
   () ;
   () ;
   () ;
   () ;
   () ;
  template<typename Environment = environment::current_view> 
     ( = ) ;

  // private member functions
   ();
};

Description

This utility class parses command lines into tokens and allows users to executed based on textual inputs.

In v1, this was possible directly when starting a process, but has been removed based on the security risks associated with this.

By making the shell parsing explicitly, it encourages a user to run a sanity check on the executable before launching it.

Example. 

shell public construct/copy/destruct

  1. () = ;
  2. template<typename Char, typename Traits> 
      ( input);
  3. (basic_cstring_ref<  input);
  4. ( input);
  5. (shell &) = ;
  6. (shell && lhs) ;
  7. shell & (shell &) = ;
  8. shell & (shell && lhs) ;
  9. ~();

shell public member functions

  1.  () ;
  2.  () ;
  3.  () ;
  4.  () ;
  5.  () ;
  6.  () ;
  7.  () ;
    Native representation of the arguments to be used - excluding the executable.
  8. template<typename Environment = environment::current_view> 
       ( env = ) ;

shell private member functions

  1.  ();

PrevUpHomeNext