-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCSSvalue.cpp
90 lines (71 loc) · 2.03 KB
/
CSSvalue.cpp
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
/*
* Name: CSS API
* Description: C++ for CSS Logic
* Web: <www/.themindspot/.com>
*
* Company: The Mind Company
*
* File: CSSvalue.cpp
* Author: Brandon L. Clark
*
* 2013 | All rights reserved unless authorized.
*/
#include "CSSvalue.h"
CSSvalue::CSSvalue(): valueName(), valueSetting(), browser() {}
CSSvalue::CSSvalue(std::string name, std::string setting) : valueName(name), valueSetting(setting), browser() {}
CSSvalue::CSSvalue(int type, std::string name, std::string setting) {
setValue(name,setting);
setValueBrowser(type);
}
CSSvalue::~CSSvalue() {}
void CSSvalue::setValue(CSSvalue aValue) {
valueName = aValue.getValueName();
valueSetting = aValue.getValueSetting();
browser = aValue.getBrowser();
}
void CSSvalue::setValue(std::string name, std::string setting) {
valueName = name;
valueSetting = setting;
}
void CSSvalue::setValue(int type, std::string name, std::string setting) {
setValue(name,setting);
setValueBrowser(type);
}
void CSSvalue::setValueName(std::string name) {valueName = name;}
void CSSvalue::setValueSetting(std::string setting) {valueSetting = setting;}
void CSSvalue::setValueBrowser(int type) {browser = type;}
bool CSSvalue::matchValue(std::string name) {return (name == valueName);}
bool CSSvalue::matchValue(int type) {return (type == browser);}
CSSvalue CSSvalue::getValue(void) {
CSSvalue value;
value.setValue(browser, valueName, valueSetting);
return value;
}
std::string CSSvalue::getValueName(void) {return valueName;}
std::string CSSvalue::getValueSetting(void) {return valueSetting;}
std::string CSSvalue::getValueString(void) {return valueName + ": " + getBrowserTag() + valueSetting +";";}
int CSSvalue::getBrowser(void) {return browser;}
std::string CSSvalue::getBrowserTag(void) {
std::string kit;
switch (browser) {
case 0:
kit = "";
break;
case 1:
kit = "-webkit-";
break;
case 2:
kit = "-moz-";
break;
case 3:
kit = "-o-";
break;
case 4:
kit = "-ms-";
break;
default:
kit = "";
break;
}
return kit;
}