-
Notifications
You must be signed in to change notification settings - Fork 0
/
c_args.h
30 lines (23 loc) · 965 Bytes
/
c_args.h
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
#ifndef C_ARGS_H
#define C_ARGS_H
#include <vector>
#include <string>
#include <map>
/******************************************************************/
// Options (key-value pairs)
class Opt: public std::map<std::string, std::string> {
};
std::ostream & operator<< (std::ostream & s, const std::vector<std::string> & v);
Opt
get_position_args(const std::vector<std::string>::const_iterator & b,
const std::vector<std::string>::const_iterator & e,
const std::vector<std::string> & arg_list);
Opt
get_key_val_args(const std::vector<std::string>::const_iterator & b,
const std::vector<std::string>::const_iterator & e,
const std::vector<std::string> & arg_list);
std::string
get_key_val(const std::vector<std::string>::const_iterator & b,
const std::vector<std::string>::const_iterator & e,
const std::string & key, const std::string & def = std::string());
#endif