This repository has been archived on 2025-04-11. You can view files and clone it, but cannot push or open issues or pull requests.
dmspine64backup/PHelpers.cpp
2015-10-06 20:15:43 -05:00

120 lines
No EOL
2 KiB
C++
Executable file

#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include "PHelpers.h"
using namespace std;
PAttribute::PAttribute(){
name = "~";
type = "~";
key = false;
size = 0;
}
PAttribute::PAttribute(string str, string t){
name = str;
type = t;
key = false;
size = 0;
}
PAttribute::PAttribute(string str, string t, int s){
name = str;
type = t;
key = false;
size = s;
}
PUnion::PUnion(){
Un1 = "~";
Un2 = "~";
}
PUnion::PUnion(string s1, string s2){
Un1 = s1;
Un2 = s2;
}
string PUnion::getPUnion(){
return "Union of " + Un1 + " and " + Un2;
}
PProduct::PProduct(){
Pr1 = "~";
Pr2 = "~";
}
PProduct::PProduct(string s1, string s2){
Pr1 = s1;
Pr2 = s2;
}
string PProduct::getPProduct(){
return "Product of " + Pr1 + " and " + Pr2;
}
PDifference::PDifference(){
D1 = "~";
D2 = "~";
}
PDifference::PDifference(string s1, string s2){
D1 = s1;
D2 = s2;
}
string PDifference::getPDifference(){
return "Difference of " + D1 + " and " + D2;
}
PRenaming::PRenaming(){
newName = "~";
oldName = "~";
}
PRenaming::PRenaming(string s1, string s2){
newName = s1;
oldName = s2;
}
string PRenaming::doRename(){
return "Renaming " + oldName + " to " + newName;
}
PProjection::PProjection(){
newName = "~";
oldName = "~";
}
PProjection::PProjection(string s1, string s2){
newName = s1;
oldName = s2;
}
string PProjection::doPProjection(){
return "Projecting " + oldName + " onto " + newName;
}
PComparison::PComparison(){
op.setPOp("~");
operand1.setPOperand("~");
operand2.setPOperand("~");
}
PComparison::PComparison(string str1, string str2, string str3){
operand1.setPOperand(str1);
op.setPOp(str2);
operand2.setPOperand(str3);
}
void PComparison::setPComparison(string str1, string str2, string str3){
operand1.setPOperand(str1);
op.setPOp(str2);
operand2.setPOperand(str3);
}
string PComparison::getPComparison(){
return operand1.getPOperand() + " " + op.getPOp() + " " + operand2.getPOperand();
}