Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
74 lines (56 sloc) 1.56 KB
//
// Idea.h
// Ideas_Bank
//
// Created by Mirna Wahab on 24/04/2017.
// Copyright © 2017 Mirna Wahab. All rights reserved.
//
#ifndef Idea_h
#define Idea_h
class Idea{
private:
int ID;
string proposer;
vector<string> keywords;
string content;
public:
Idea(){}
bool lookForWord(string word){
// SEARCH KEYWORDS
for (int i = 0; i < keywords.size(); i++) {
if (word == keywords[i]){
return true;
}
}
// SEARCH CONTENT
size_t found;
found = content.find(word);
if (found != string::npos){
return true;
}
return false;
}// end of lookForWord
void printIdea(){
cout << "\nIdea ID: " << ID << "\n"
<< "Proposer: " << proposer << "\n"
<< "Keywords: ";
for (int i = 0; i < keywords.size(); i++) {
cout << keywords[i];
if (i+1 != keywords.size()){
cout << ", ";
}
}
cout << "\nContent: " << content << endl;
cout << endl;
}// end of printIdea
void setID(){ static int id; ID = ++id; }
void setTxtID(int id){ ID = id; }
void setProposer(string p){ proposer = p; }
void setKwords(string k){ keywords.push_back(k); }
void setContent(string c){ content = c; }
int getID(){ return ID; }
vector<string> getKwords(){ return keywords; }
string getContent(){ return content; }
};
//int Idea::ID = 0;
#endif /* Idea_h */
You can’t perform that action at this time.