-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBindsContainer.cpp
More file actions
60 lines (52 loc) · 1.32 KB
/
BindsContainer.cpp
File metadata and controls
60 lines (52 loc) · 1.32 KB
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
#pragma once
#include "BindsContainer.h"
#include <string>
#include <vector>
#include <tuple>
#include <algorithm>
#include <locale>
#include "Helpers.h"
BindsContainer::BindsContainer(void){
}
BindsContainer::BindsContainer(std::string n, std::string vn){
this->setName(n);
this->setVarName(vn);
}
BindsContainer::~BindsContainer(void){
}
void BindsContainer::sortContainer(){
std::sort(this->container.begin(),this->container.end(),sortbysecond);
}
int BindsContainer::getContainerSize(){
return this->container.size();
}
std::string BindsContainer::getBinds(int x){
return std::get<0>(container[x]);
}
bool BindsContainer::findBind(std::string f,std::string parameter){
for(std::vector<std::string>::size_type i = 0; i != findthis.size(); i++) {
if(ci_find_substr( f,this->findthis[i]) != -1){
this->addBind(f,parameter);
return true;
}
}
return false;
}
void BindsContainer::addFind(std::string ft){
this->findthis.push_back(ft);
}
void BindsContainer::addBind(std::string fs, std::string p){
this->container.push_back(std::make_tuple(fs,p));
}
void BindsContainer::setVarName(const std::string s){
this->varname = s;
}
std::string BindsContainer::getVarName(){
return this->varname;
}
void BindsContainer::setName(const std::string s){
this->name = s;
}
std::string BindsContainer::getName(){
return this->name;
}