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.

31 lines
588B

  1. #include "plugin/Model.hpp"
  2. namespace rack {
  3. namespace plugin {
  4. void Model::fromJson(json_t *rootJ) {
  5. json_t *nameJ = json_object_get(rootJ, "name");
  6. if (nameJ)
  7. name = json_string_value(nameJ);
  8. json_t *descriptionJ = json_object_get(rootJ, "description");
  9. if (descriptionJ)
  10. description = json_string_value(descriptionJ);
  11. json_t *tagsJ = json_object_get(rootJ, "tags");
  12. if (tagsJ) {
  13. size_t i;
  14. json_t *tagJ;
  15. json_array_foreach(tagsJ, i, tagJ) {
  16. std::string tag = json_string_value(tagJ);
  17. tags.push_back(tag);
  18. }
  19. }
  20. }
  21. } // namespace plugin
  22. } // namespace rack