File: Flag.h

package info (click to toggle)
android-framework-23 6.0.1%2Br72-6
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 233,244 kB
  • sloc: java: 1,707,033; xml: 247,323; cpp: 211,819; ansic: 2,748; python: 2,640; sh: 1,517; yacc: 343; javascript: 338; lex: 214; ruby: 183; perl: 88; makefile: 63; sed: 19
file content (34 lines) | stat: -rw-r--r-- 955 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#ifndef AAPT_FLAG_H
#define AAPT_FLAG_H

#include "StringPiece.h"

#include <functional>
#include <string>
#include <vector>

namespace aapt {
namespace flag {

void requiredFlag(const StringPiece& name, const StringPiece& description,
                  std::function<void(const StringPiece&)> action);

void requiredFlag(const StringPiece& name, const StringPiece& description,
                  std::function<bool(const StringPiece&, std::string*)> action);

void optionalFlag(const StringPiece& name, const StringPiece& description,
                  std::function<void(const StringPiece&)> action);

void optionalSwitch(const StringPiece& name, const StringPiece& description, bool resultWhenSet,
                    bool* result);

void usageAndDie(const StringPiece& command);

void parse(int argc, char** argv, const StringPiece& command);

const std::vector<std::string>& getArgs();

} // namespace flag
} // namespace aapt

#endif // AAPT_FLAG_H