Nektar++
Loading...
Searching...
No Matches
Public Member Functions | List of all members
PyCppCommandLine Struct Reference

Helper structure to construct C++ command line argc and argv variables from a Python list. More...

#include <NekPyConfig.hpp>

Inheritance diagram for PyCppCommandLine:
[legend]

Public Member Functions

 PyCppCommandLine (py::list &py_argv)
 Constructor.
 
- Public Member Functions inherited from Nektar::LibUtilities::CppCommandLine
 CppCommandLine ()=default
 
 CppCommandLine (std::vector< std::string > argv)
 Constructor.
 
 ~CppCommandLine ()
 Destructor.
 
char ** GetArgv ()
 Returns the constructed argv.
 
int GetArgc ()
 Returns the constructed argc.
 

Additional Inherited Members

- Protected Member Functions inherited from Nektar::LibUtilities::CppCommandLine
void Setup (std::vector< std::string > &argv)
 

Detailed Description

Helper structure to construct C++ command line argc and argv variables from a Python list.

Definition at line 90 of file NekPyConfig.hpp.

Constructor & Destructor Documentation

◆ PyCppCommandLine()

PyCppCommandLine::PyCppCommandLine ( py::list &  py_argv)
inline

Constructor.

Parameters
py_argvList of command line arguments from Python.

Definition at line 97 of file NekPyConfig.hpp.

98 {
99 int argc = py::len(py_argv);
100 std::vector<std::string> argv(argc);
101
102 for (int i = 0; i < argc; ++i)
103 {
104 argv[i] = py::cast<std::string>(py_argv[i]);
105 }
106
107 Setup(argv);
108 }
Helper structure to construct C++ command line argc and argv variables from a C++ vector.
void Setup(std::vector< std::string > &argv)

References Nektar::LibUtilities::CppCommandLine::Setup().