StrokeSeg 1.0.0
Loading...
Searching...
No Matches
commandLineTools.h File Reference

Header file for the CommandLineTools module. This file contains declarations for functions related to command line argument extraction, Python executable path checking, and command line preparation for executing Python scripts. More...

#include "deps.h"
Include dependency graph for commandLineTools.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define PYTHON_BIN_NAME   L"python.exe"
#define APP_RELATIVE_PATH   L".\\stroke_seg.py"

Functions

LPWSTR * extractAndCheck (int &argc, std::filesystem::path &currentExecutableDirPath, std::filesystem::path &pythonExecutablePath)
 Extracts command line arguments and checks the Python executable path.
std::wstring commandLineConverter (std::wstring scriptFileName, std::filesystem::path pythonExecutablePath, LPWSTR *argvW, int argc, bool &console)
 Prepares the command line for execution.

Detailed Description

Header file for the CommandLineTools module. This file contains declarations for functions related to command line argument extraction, Python executable path checking, and command line preparation for executing Python scripts.

Author
Florent LERAY
Date
2023-10-01
Version
1.0

Definition in file commandLineTools.h.

Macro Definition Documentation

◆ APP_RELATIVE_PATH

#define APP_RELATIVE_PATH   L".\\stroke_seg.py"

Definition at line 15 of file commandLineTools.h.

◆ PYTHON_BIN_NAME

#define PYTHON_BIN_NAME   L"python.exe"

Definition at line 14 of file commandLineTools.h.

Function Documentation

◆ commandLineConverter()

std::wstring commandLineConverter ( std::wstring scriptFileName,
std::filesystem::path pythonExecutablePath,
LPWSTR * argvW,
int argc,
bool & console )

Prepares the command line for execution.

Parameters
scriptFileNameThe name of the script file to execute.
pythonExecutablePathThe path to the Python executable.
argvWPointer to an array of wide strings (LPWSTR) containing the command line arguments.
argcThe number of command line arguments.
consoleReference to a boolean indicating if the console should be used.
Returns
A wide string (std::wstring) containing the prepared command line.

Definition at line 42 of file commandLineTools.cpp.

◆ extractAndCheck()

LPWSTR * extractAndCheck ( int & argc,
std::filesystem::path & currentExecutableDirPath,
std::filesystem::path & pythonExecutablePath )

Extracts command line arguments and checks the Python executable path.

Parameters
[OUT]argc Reference to the argument count.
[OUT]currentExecutableDirPath Reference to the current executable directory path.
[OUT]pythonExecutablePath Reference to the Python executable path.
Returns
A pointer to an array of wide strings (LPWSTR) containing the command line arguments, equivalent to a argvW.

Definition at line 5 of file commandLineTools.cpp.