Lines Matching refs:std
37 inline std::istream &operator>>(std::istream &stream, T &out) {
40 auto min = +std::numeric_limits<T>::min();
41 auto max = +std::numeric_limits<T>::max();
48 stream.setstate(std::ios_base::failbit);
58 inline std::istream &operator>>(std::istream &stream, int8_t &out) {
63 inline std::istream &operator>>(std::istream &stream, uint8_t &out) {
70 inline std::istream &operator>>(std::istream &stream, T &out) {
74 std::underlying_type_t<T> in;
81 if (tmp < *validRange.begin() || tmp > *std::prev(validRange.end())) {
83 stream.setstate(std::ios_base::failbit);
101 mArgs.emplace_back(std::string_view(argv[argi])); in Args()
105 template <typename T = std::string>
106 std::optional<T> get() { in get()
110 template <typename T = std::string>
111 std::optional<T> pop() { in pop()
119 std::optional<T> get(bool erase) { in get()
128 std::stringstream stream{std::string{mArgs.front()}}; in get()
129 stream >> std::setbase(0) >> retValue; in get()
141 std::vector<std::string_view> mArgs;
147 std::string name;
148 std::vector<std::string> details;
150 using UsageDetails = std::vector<Usage>;
156 Status status = doArgsAndMain(std::move(args)); in main()
162 std::cerr << "The requested operation is unavailable." << std::endl; in main()
169 virtual std::string getDescription() const = 0;
170 virtual std::string getUsageSummary() const = 0;
176 std::cerr << "Description:\n " << getDescription() << std::endl; in printUsage()
177 std::cerr << "Usage:\n " << mName << " " << getUsageSummary() << std::endl; in printUsage()
179 std::cerr << "Details:" << std::endl; in printUsage()
182 entryNameWidth = std::max(entryNameWidth, entry.name.length()); in printUsage()
187 std::cerr << " " << std::left << std::setw(entryNameWidth + 8) << prefix << line in printUsage()
188 << std::endl; in printUsage()
200 if ((status = doMain(std::move(args))) != OK) { in doArgsAndMain()
207 std::string mName;
213 using CommandCreator = std::function<std::unique_ptr<Command>()>;
217 static CommandCreator Register(const std::string name) { in Register()
218 Instance()->mCommands[name] = [] { return std::make_unique<U>(); }; in Register()
222 static std::unique_ptr<Command> Create(const std::string name) { in Create()
231 std::vector<std::string> list; in List()
235 std::sort(list.begin(), list.end()); in List()
246 std::map<const std::string, CommandCreator> mCommands;
255 std::cerr << "Invalid Command!" << std::endl; in doArgs()
261 Status doMain(Args &&args) override { return mCommand->main(std::move(args)); } in doMain()
264 std::unique_ptr<Command> mCommand;