lintel 0.2.0
Loading...
Searching...
No Matches
ProcessName.h
Go to the documentation of this file.
1#ifndef LINTEL_PROCESSNAME_H
2#define LINTEL_PROCESSNAME_H
3
4#include <filesystem>
5#include <string>
6#include <vector>
7
8namespace lintel {
13{
14private:
15 std::filesystem::path m_path;
16 std::vector<std::string> m_args;
17
18public:
24 ProcessName(int argc, char *const *argv)
25 {
26 m_path = argv[0];
27 for (int i = 1; i < argc; i++) { m_args.push_back(argv[i]); }
28 }
29
34 explicit ProcessName(const std::string &processName) : m_path(processName) {};
35
37 [[nodiscard]] std::string getProcessName() const { return m_path.filename().string(); }
38
40 [[nodiscard]] const std::filesystem::path &getPath() const { return m_path; }
41
43 [[nodiscard]] const std::vector<std::string> &getArgs() const { return m_args; }
44};
45
46}// namespace lintel
47#endif// LINTEL_PROCESSNAME_H
Definition ProcessName.h:13
ProcessName(int argc, char *const *argv)
Definition ProcessName.h:24
const std::vector< std::string > & getArgs() const
Definition ProcessName.h:43
std::string getProcessName() const
Definition ProcessName.h:37
ProcessName(const std::string &processName)
Definition ProcessName.h:34
const std::filesystem::path & getPath() const
Definition ProcessName.h:40
Definition BaseFeature.h:6
constexpr std::string_view type_name()
Definition TypeName.h:9