2 * Copyright (C) 2015 The Android Open Source Project
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
20 #include "util/Maybe.h"
21 #include "util/StringPiece.h"
32 Flags& requiredFlag(const StringPiece& name, const StringPiece& description,
34 Flags& requiredFlagList(const StringPiece& name, const StringPiece& description,
35 std::vector<std::string>* value);
36 Flags& optionalFlag(const StringPiece& name, const StringPiece& description,
37 Maybe<std::string>* value);
38 Flags& optionalFlagList(const StringPiece& name, const StringPiece& description,
39 std::vector<std::string>* value);
40 Flags& optionalSwitch(const StringPiece& name, const StringPiece& description,
43 void usage(const StringPiece& command, std::ostream* out);
45 bool parse(const StringPiece& command, const std::vector<StringPiece>& args,
46 std::ostream* outError);
48 const std::vector<std::string>& getArgs();
53 std::string description;
54 std::function<bool(const StringPiece& value)> action;
61 std::vector<Flag> mFlags;
62 std::vector<std::string> mArgs;
67 #endif // AAPT_FLAGS_H