DAS  3.0
Das Analysis System
test.h
Go to the documentation of this file.
1 #ifndef DARWIN_TEST_H
2 #define DARWIN_TEST_H
3 
4 #include <iostream>
5 #include <vector>
6 #include <filesystem>
7 #include <string>
8 #include <utility>
9 
10 namespace Darwin::Tools {
11 
15  inline std::vector<const char *> tokenize (const char * str)
16  {
17  std::cout << "\e[1m" << str << "\e[0m" << std::endl;
18 
19  // convert from `const char *` to `char *`
20  char * cmd = new char[strlen(str)+1];
21  strcpy(cmd, str);
22 
23  // tokenize
24  std::vector<const char *> args;
25  for (char * arg = strtok(cmd, " ");
26  arg != nullptr;
27  arg = strtok(NULL, " "))
28  args.push_back(std::move(arg));
29 
30  //free(cmd); // do NOT free the memory
31  return args;
32  }
33 
34 }
35 
36 #endif
Ntupliser_cfg.args
args
Definition: Ntupliser_cfg.py:11
cmd
cmd
Definition: Core-cfgcmd.txt:1
Darwin::Tools
Classes and functions related to the framework.
Definition: forceMetaInfo.cc:28
Darwin::Tools::tokenize
std::vector< const char * > tokenize(const char *str)
Definition: test.h:15