Skip to content

Commit

Permalink
map custom properties
Browse files Browse the repository at this point in the history
  • Loading branch information
v-rudkovskiy committed Aug 13, 2024
1 parent 5ba3189 commit 16f2124
Show file tree
Hide file tree
Showing 9 changed files with 56 additions and 0 deletions.
5 changes: 5 additions & 0 deletions include/netlicensing/country.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ namespace netlicensing {
ss << "isEu: " << isEu << ", ";
ss << "code: " << code << ", ";
ss << "vatPercent: " << vatPercent;

for (const auto& pair : getProperties()) {
ss << ", " << pair.first << ": " << pair.second.toString();
}

ss << "]";
return ss.str();
}
Expand Down
5 changes: 5 additions & 0 deletions include/netlicensing/license.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,11 @@ namespace netlicensing {
ss << HIDDEN << ": " << hidden.toString() << ", ";
ss << LICENSEE_NUMBER << ": " << licenseeNumber << ", ";
ss << LICENSE_TEMPLATE_NUMBER << ": " << licenseTemplateNumber;

for (const auto& pair : getProperties()) {
ss << ", " << pair.first << ": " << pair.second.toString();
}

ss << "]";
return ss.str();
}
Expand Down
5 changes: 5 additions & 0 deletions include/netlicensing/license_template.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,11 @@ namespace netlicensing {
ss << AUTOMATIC << ": " << automatic.toString() << ", ";
ss << HIDDEN << ": " << hidden.toString() << ", ";
ss << HIDE_LICENSES << ": " << hideLicenses.toString();

for (const auto& pair : getProperties()) {
ss << ", " << pair.first << ": " << pair.second.toString();
}

ss << "]";
return ss.str();
}
Expand Down
5 changes: 5 additions & 0 deletions include/netlicensing/licensee.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ namespace netlicensing {
ss << NUMBER << ": " << number << ", ";
ss << ACTIVE << ": " << active.toString() << ", ";
ss << PRODUCT_NUMBER << ": " << productNumber;

for (const auto& pair : getProperties()) {
ss << ", " << pair.first << ": " << pair.second.toString();
}

ss << "]";
return ss.str();
}
Expand Down
16 changes: 16 additions & 0 deletions include/netlicensing/mapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ namespace netlicensing {
item_i.setDescription(value);
} else if (key == LICENSING_INFO) {
item_i.setLicensingInfo(value);
} else {
item_i.addProperty(key, value);
}
}

Expand Down Expand Up @@ -138,6 +140,8 @@ namespace netlicensing {
item_i.setLicensingModel(value);
} else if (key == PRODUCT_NUMBER) {
item_i.setProductNumber(value);
} else {
item_i.addProperty(key, value);
}
}
};
Expand Down Expand Up @@ -171,6 +175,8 @@ namespace netlicensing {
item_i.setHidden((value == "true"?true:false));
} else if (key == HIDE_LICENSES) {
item_i.setHideLicenses((value == "true"?true:false));
} else {
item_i.addProperty(key, value);
}
}
};
Expand All @@ -192,6 +198,8 @@ namespace netlicensing {
item_i.setName(value);
} else if (key == PRODUCT_NUMBER) {
item_i.setProductNumber(value);
} else {
item_i.addProperty(key, value);
}
}
};
Expand Down Expand Up @@ -221,6 +229,8 @@ namespace netlicensing {
item_i.setLicenseeNumber(value);
} else if (key == LICENSE_TEMPLATE_NUMBER) {
item_i.setLicenseTemplateNumber(value);
} else {
item_i.addProperty(key, value);
}
}
};
Expand All @@ -242,6 +252,8 @@ namespace netlicensing {
item_i.setName(value);
} else if (key == "vatPercent") {
item_i.setVatPercent(value);
} else {
item_i.addProperty(key, value);
}
}
};
Expand Down Expand Up @@ -312,6 +324,8 @@ namespace netlicensing {
item_i.setExpirationTime(value);
} else if (key == TOKEN_TYPE) {
item_i.setTokenType(stringToTokenType(value));
} else {
item_i.addProperty(key, value);
}
}
};
Expand Down Expand Up @@ -343,6 +357,8 @@ namespace netlicensing {
item_i.setDateCreated(value);
} else if (key == DATE_CLOSED) {
item_i.setDateClosed(value);
} else {
item_i.addProperty(key, value);
}
}
};
Expand Down
5 changes: 5 additions & 0 deletions include/netlicensing/product.h
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,11 @@ namespace netlicensing {
ss << LICENSEE_AUTO_CREATE << ": " << licenseeAutoCreate << ", ";
ss << DESCRIPTION << ": " << description << ", ";
ss << LICENSING_INFO << ": " << licensingInfo;

for (const auto& pair : getProperties()) {
ss << ", " << pair.first << ": " << pair.second.toString();
}

ss << "]";
return ss.str();
}
Expand Down
5 changes: 5 additions & 0 deletions include/netlicensing/product_module.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ namespace netlicensing {
ss << ACTIVE << ": " << active.toString() << ", ";
ss << LICENSING_MODEL << ": " << licensingModel << ", ";
ss << PRODUCT_NUMBER << ": " << productNumber;

for (const auto& pair : getProperties()) {
ss << ", " << pair.first << ": " << pair.second.toString();
}

ss << "]";
return ss.str();
}
Expand Down
5 changes: 5 additions & 0 deletions include/netlicensing/token.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ namespace netlicensing {
ss << VENDOR_NUMBER << ": " << vendorNumber << ", ";
ss << EXPIRATION_TIME << ": " << expirationTime << ", ";
ss << TOKEN_TYPE << ": " << tokenType;

for (const auto& pair : getProperties()) {
ss << ", " << pair.first << ": " << pair.second.toString();
}

ss << "]";
return ss.str();
}
Expand Down
5 changes: 5 additions & 0 deletions include/netlicensing/transaction.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,11 @@ namespace netlicensing {
ss << CURRENCY << ": " << currency << ", ";
ss << DATE_CREATED << ": " << dateCreated << ", ";
ss << DATE_CLOSED << ": " << dateClosed;

for (const auto& pair : getProperties()) {
ss << ", " << pair.first << ": " << pair.second.toString();
}

ss << "]";
return ss.str();
}
Expand Down

0 comments on commit 16f2124

Please sign in to comment.