Scroom  0.14
measure-load-performance.cc File Reference
#include <cstdlib>
#include <string>
#include <fmt/core.h>
#include <getopt.h>
#include <spdlog/spdlog.h>
#include <gtk/gtk.h>
#include "measure-framerate-callbacks.hh"
#include "measure-load-performance-tests.hh"
Include dependency graph for measure-load-performance.cc:

Functions

void usage (const std::string &me, const std::string &message=std::string())
 
int main (int argc, char *argv[])
 

Function Documentation

◆ main()

int main ( int  argc,
char *  argv[] 
)
34 {
35  const std::string me = argv[0];
36  char result;
37 
38  while((result = getopt(argc, argv, ":h")) != -1)
39  {
40  switch(result)
41  {
42  case 'h':
43  usage(me);
44  break;
45  case '?':
46  // show usage -- unknown option
47  usage(me, "Unknown option");
48  break;
49  case ':':
50  // show usage -- missing argument
51  usage(me, "Option requires an argument");
52  break;
53  default:
54  usage(me, "This shouldn't be happening");
55  break;
56  }
57  }
58 
59  // while(optind < argc)
60  // {
61  // filenames.push_back(std::string(argv[optind]));
62  // optind++;
63  // }
64 
65  setlocale(LC_ALL, ""); // NOLINT(concurrency-mt-unsafe)
66  gtk_init(&argc, &argv);
67 
68  init_tests();
69  init();
70 
71  gtk_main();
72  return 0;
73 }
Here is the call graph for this function:

◆ usage()

void usage ( const std::string &  me,
const std::string &  message = std::string() 
)
21 {
22  if(message.length() != 0)
23  {
24  spdlog::error("{}", message);
25  }
26 
27  fmt::print("Usage: {} [options] [input files]\n\n", me);
28  fmt::print("Options:\n");
29  fmt::print(" -h : Show this help\n");
30  exit(-1); // NOLINT(concurrency-mt-unsafe)
31 }

Referenced by main().

Here is the caller graph for this function:
init_tests
void init_tests()
Definition: measure-framerate-tests.cc:152
init
void init()
Definition: measure-framerate-callbacks.cc:98
usage
void usage(const std::string &me, const std::string &message=std::string())
Definition: measure-load-performance.cc:20