MCPcopy Create free account
hub / github.com/Exiv2/exiv2 / getopt

Method getopt

app/getopt.cpp:87–106  ·  view source on GitHub ↗

class Getopt

Source from the content-addressed store, hash-verified

85// *****************************************************************************
86// class Getopt
87int Getopt::getopt(int argc, char* const argv[], const std::string& optstring) {
88 progname_ = fs::path(argv[0]).filename().string();
89 Util::optind = 0; // reset the Util::Getopt scanner
90
91 while (!errcnt_) {
92 int c = Util::getopt(argc, argv, optstring.c_str());
93 if (c == -1) {
94 break;
95 }
96 errcnt_ += option(c, Util::optarg ? Util::optarg : "", Util::optopt);
97 if (c == '?') {
98 break;
99 }
100 }
101 for (int i = Util::optind; i < argc; i++) {
102 errcnt_ += nonoption(argv[i]);
103 }
104
105 return errcnt_;
106}
107
108int Getopt::nonoption(const std::string& /*argv*/) {
109 return 0;

Callers

nothing calls this directly

Calls 3

pathFunction · 0.85
getoptFunction · 0.85
c_strMethod · 0.80

Tested by

no test coverage detected