-
Notifications
You must be signed in to change notification settings - Fork 1
/
nlist.h
67 lines (50 loc) · 1.54 KB
/
nlist.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
//////////////////////////////////////////////////////////////////
// //
// PLINK (c) 2005-2008 Shaun Purcell //
// //
// This file is distributed under the GNU General Public //
// License, Version 2. Please see the file COPYING for more //
// details //
// //
//////////////////////////////////////////////////////////////////
#ifndef __NLIST_H__
#define __NLIST_H__
#include <string>
#include <vector>
#include <iostream>
#include "helper.h"
#include "options.h"
using namespace std;
class NList{
vector<string> tokenize(string);
vector<int> expandNumberList(vector<int> &);
int maxcat;
bool negmode; // exclude list from 1..maxcat
string firstWord;
string lastWord;
char range_char;
string range_string;
char delimit_char;
public:
NList(int n, bool nmode = true )
{
range_char = par::range_delimiter[0];
range_string = par::range_delimiter;
delimit_char = ',';
maxcat = n;
negmode = ! nmode;
}
void setRangeChar(string s)
{
range_char = s[0];
range_string = s;
}
void setDelimiter(string s)
{
delimit_char = s[0];
}
vector<int> deparseNumberList(string);
vector<int> deparseStringList(string, map<string,int> *);
vector<string> deparseStringList(string);
};
#endif