1
0
Fork 0
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

52 lines
1.3 KiB

#include <iostream>
#include <string>
#include <vector>
using namespace std;
class ParserPoint {
public:
ParserPoint(string name, int line) {
beginLine = line;
pointName = name;
}
string getPointName() {
return pointName;
}
//void setContentArray(char *contentArray);
vector<string> getContentArray() {
return contentArray;
}
int count() {return arrayCount;}
void addPoint(string name) {
contentArray.push_back(name);
arrayCount++;
endLine = beginLine + arrayCount;
}
bool contains(string name) {
for (int i = 0; i < arrayCount; i++) {
if (name == contentArray[i]) return true;
}
return false;
}
void printContent() {
cout << pointName << "@";
cout << "[";
for (int i = 0; i < arrayCount; i++) {
cout << contentArray[i];
if (arrayCount != i + 1) cout << ", ";
}
cout << "]" << endl;
}
private:
int arrayCount = 0;
int beginLine;
int endLine = beginLine;
string pointName;
vector<string> contentArray;
};