UNISTDX_IPC_ARGSTREAM
template <class Ch, class Tr = std::char_traits<Ch>>
class sys::basic_argbuf

Stream buffer for command line arguments.

Base classes
  • public std::basic_streambuf< Ch, std::char_traits< Ch > >
Types
  • using arg_type = std::vector< char_type >

    Single argument type.

Methods
  • argc() const -> int

    Get the number of arguments.

  • argv() const -> char *const *

    Get argument array suitable to pass to execve(2) system call.

  • argv() -> char **

    Get argument array suitable to pass to execve(2) system call.

  • xsputn(const char_type * s, std::streamsize n) -> std::streamsize

    Overrides std::streambuf::xsputn.

  • overflow(int_type c) -> int_type

    Overrides std::streambuf::overflow.

  • ~basic_argbuf()
  • basic_argbuf(const basic_argbuf &)
  • basic_argbuf(basic_argbuf && rhs)

    Move-constructor.

  • basic_argbuf()
Friends
  • operator<<

    Output all arguments, one argument per line.

class sys::argstream

Output stream of command line arguments.

  • Use append method to append one argument at a time.
  • Insert any object to the stream to append its textual representation to the current command line argument.
  • Insert null character to delimit arguments manually.

Base classes
  • public std::ostream
Methods
  • template <class ... Args>
    append(const Args &... args) -> void

    Insert all function arguments as command line arguments.

  • argc() const -> int

    Get the number of arguments.

  • argv() const -> char *const *

    Get argument array suitable to pass to execve(2) system call.

  • argv() -> char **

    Get argument array suitable to pass to execve(2) system call.

  • argstream(argstream && rhs)

    Move-constructor.

  • template <class ... Args>
    argstream(const Args &... args)

    Construct argument stream from a list of arguments.

  • argstream()

    Construct empty argument stream.

Friends
  • operator<<

    Print all command line arguments.