WoW Model Viewer
Your premiere tool for viewing, equipping and animating World of Warcraft models.
Loading...
Searching...
No Matches
ArmoryImporter.h
Go to the documentation of this file.
1/*----------------------------------------------------------------------*\
2| This file is part of WoW Model Viewer |
3| |
4| WoW Model Viewer is free software: you can redistribute it and/or |
5| modify it under the terms of the GNU General Public License as |
6| published by the Free Software Foundation, either version 3 of the |
7| License, or (at your option) any later version. |
8| |
9| WoW Model Viewer is distributed in the hope that it will be useful, |
10| but WITHOUT ANY WARRANTY; without even the implied warranty of |
11| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12| GNU General Public License for more details. |
13| |
14| You should have received a copy of the GNU General Public License |
15| along with WoW Model Viewer. |
16| If not, see <http://www.gnu.org/licenses/>. |
17\*----------------------------------------------------------------------*/
18
19/*
20 * ArmoryImporter.h
21 *
22 * Created on: 9 dec. 2013
23 * Copyright: 2013 , WoW Model Viewer (http://wowmodelviewer.net)
24 */
25
26#pragma once
27
28#include <nlohmann/json.hpp>
29#include <string>
30
31#include "ImporterPlugin.h"
32
34class ArmoryImporter final : public ImporterPlugin //-V1106
35{
36
37public:
39 ~ArmoryImporter() = default;
40
41 bool acceptURL(const std::string& url) const override;
42
43 NPCInfos* importNPC(const std::string& url) const override { return nullptr; };
44 CharInfos* importChar(const std::string& url) const override;
45 ItemRecord* importItem(const std::string& url) const override;
46
47private:
53
54 int readJSONValues(ImportType type, const std::string& url, nlohmann::json& result) const;
55 std::string getURLData(const std::string& inputUrl) const;
56 static bool hasMember(const nlohmann::json& check, const std::string& lookfor);
57 static bool hasTransmog(const nlohmann::json& check);
58};
Imports character and item data from the World of Warcraft Armory API.
static bool hasMember(const nlohmann::json &check, const std::string &lookfor)
static bool hasTransmog(const nlohmann::json &check)
NPCInfos * importNPC(const std::string &url) const override
CharInfos * importChar(const std::string &url) const override
~ArmoryImporter()=default
bool acceptURL(const std::string &url) const override
int readJSONValues(ImportType type, const std::string &url, nlohmann::json &result) const
std::string getURLData(const std::string &inputUrl) const
ItemRecord * importItem(const std::string &url) const override
Stores imported character information (race, gender, equipment, customisations, tabard).
Definition CharInfos.h:8
Abstract base class for URL-based import plugins (Armory, Wowhead, etc.).
Stores basic NPC metadata (id, display id, type, name) imported from external sources.
Definition NPCInfos.h:7
A single equipment item record from the item database.
Definition database.h:26