Commit 68cdb4bd authored by A. Wilcox's avatar A. Wilcox

Etsy: Add [tag|material]Count to get count of tags/materials that an item has.

parent 265b29a6
......@@ -236,6 +236,12 @@ libAPI vector<const char *> *EtsyItem::getTags(void)
}
libAPI size_t EtsyItem::tagCount()
{
return this->_tags.size();
}
libAPI vector<const char *> *EtsyItem::getMaterials(void)
{
vector <const char *> *materials = new vector<const char *>;
......@@ -247,6 +253,12 @@ libAPI vector<const char *> *EtsyItem::getMaterials(void)
}
libAPI size_t EtsyItem::materialCount()
{
return this->_materials.size();
}
void EtsyItem::loadTagsFromJSON(JSONNode tags)
{
for(unsigned long next_tag = 0; next_tag < this->_tags.size(); next_tag++)
......
......@@ -56,6 +56,9 @@ public:
libAPI vector<const char *> *getTags(void);
libAPI vector<const char *> *getMaterials(void);
libAPI size_t materialCount(void);
libAPI size_t tagCount(void);
private:
/*!
@brief Initialise an Etsy item from Etsy JSON.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment