version 2.0.0_prealpha

PIFile::put() and get()
This commit is contained in:
2020-08-11 20:09:34 +03:00
parent 3ba6a7b0e8
commit 57a9ccb854
8 changed files with 87 additions and 5 deletions

View File

@@ -59,7 +59,7 @@ PIVariant::PIVariant() {
}
PIVariant::PIVariant(const PIVariant &v) {
PIVariant::PIVariant(const PIVariant & v) {
_type = v._type;
_content = v._content;
#ifdef CUSTOM_PIVARIANT
@@ -68,6 +68,11 @@ PIVariant::PIVariant(const PIVariant &v) {
}
PIVariant::PIVariant(PIVariant && v) {
swap(v);
}
void PIVariant::setValueFromString(const PIString & v) {
switch (_type) {
case PIVariant::pivBool: {setValue(v.toBool());} break;
@@ -108,6 +113,12 @@ PIVariant & PIVariant::operator =(const PIVariant & v) {
}
PIVariant & PIVariant::operator =(PIVariant && v) {
swap(v);
return *this;
}
bool PIVariant::operator ==(const PIVariant & v) const {
return (_type == v._type) && (_content == v._content);
}
@@ -161,6 +172,15 @@ PIString PIVariant::typeName() const {
}
void PIVariant::swap(PIVariant & v) {
piSwap(_type, v._type);
_content.swap(v._content);
#ifdef CUSTOM_PIVARIANT
piSwap(_info, v._info);
#endif
}
PIString PIVariant::typeName(PIVariant::Type type) {
switch (type) {
case PIVariant::pivBool: return "Bool";