24#ifndef EASYEDAPRO_V3_PARSER_H_
25#define EASYEDAPRO_V3_PARSER_H_
32#include <nlohmann/json.hpp>
67 const wxString& aDefault = wxEmptyString );
69wxString
V3GetString(
const nlohmann::json& aObj,
const char* aKey,
70 const wxString& aDefault = wxEmptyString );
72wxString
V3GetString(
const nlohmann::json& aObj,
const wxString& aKey,
73 const wxString& aDefault = wxEmptyString );
75double V3GetDouble(
const nlohmann::json& aObj,
const char* aKey,
double aDefault = 0.0 );
77int V3GetInt(
const nlohmann::json& aObj,
const char* aKey,
int aDefault = 0 );
79bool V3GetBool(
const nlohmann::json& aObj,
const char* aKey,
bool aDefault =
false );
103 static bool IsV3Archive(
const wxString& aFileName );
113 static bool IsV3Library(
const wxString& aFileName,
const wxString& aRequiredDocType = wxEmptyString );
133 const std::map<wxString, V3_DOC_RAW>&
GetRawDocs(
const wxString& aDocType )
const;
143 std::map<wxString, std::map<wxString, V3_DOC_RAW>>
m_rawDocs;
void Load()
Load all v3 docs from the archive.
const V3_DOC_RAW * FindRawDoc(const wxString &aDocType, const wxString &aUuid) const
const nlohmann::json & GetProject2() const
const std::map< wxString, V3_DOC_RAW > & GetRawDocs(const wxString &aDocType) const
nlohmann::json m_project2
static bool IsV3Library(const wxString &aFileName, const wxString &aRequiredDocType=wxEmptyString)
Return true if aFileName looks like an EasyEDA Pro v3 library archive.
std::map< wxString, std::map< wxString, V3_DOC_RAW > > m_rawDocs
nlohmann::json m_libraryIndex
const nlohmann::json & GetLibraryIndex() const
V3_DOC_PARSER(const wxString &aFileName)
int GetSkippedCount() const
static bool IsV3Archive(const wxString &aFileName)
Return true if aFileName looks like an EasyEDA Pro v3 archive.
void LoadLibrary()
Load all v3 docs from a library archive.
bool V3GetBool(const nlohmann::json &aObj, const char *aKey, bool aDefault)
nlohmann::json V3ParseIdArray(const wxString &aId)
bool V3IsNullOrMissing(const nlohmann::json &aObj, const char *aKey)
double V3GetDouble(const nlohmann::json &aObj, const char *aKey, double aDefault)
wxString V3JsonToString(const nlohmann::json &aValue, const wxString &aDefault)
int V3GetInt(const nlohmann::json &aObj, const char *aKey, int aDefault)
wxString V3GetString(const nlohmann::json &aObj, const char *aKey, const wxString &aDefault)
Raw parsed document from an EasyEDA Pro v3 .epru stream.
std::map< wxString, size_t > rowById
std::vector< V3_ROW > rows
One parsed row from an EasyEDA Pro v3 .epru document stream.