Skip to content

Instantly share code, notes, and snippets.

@pamaury
Created March 6, 2015 22:22
Show Gist options
  • Save pamaury/714108a528954d58f2e4 to your computer and use it in GitHub Desktop.
Save pamaury/714108a528954d58f2e4 to your computer and use it in GitHub Desktop.
diff --git a/utils/regtools/qeditor/backend.cpp b/utils/regtools/qeditor/backend.cpp
index 5f006b0..00e16ff 100644
--- a/utils/regtools/qeditor/backend.cpp
+++ b/utils/regtools/qeditor/backend.cpp
@@ -36,7 +36,22 @@ SocFile::SocFile(const QString& filename)
:m_filename(filename)
{
soc_desc::error_context_t ctx;
+ qDebug() << "try to load" << filename;
m_valid = soc_desc::parse_xml(filename.toStdString(), m_soc, ctx);
+ for(size_t j = 0; j < ctx.count(); j++)
+ {
+ soc_desc::error_t e = ctx.get(j);
+ switch(e.level())
+ {
+ case soc_desc::error_t::INFO: printf("[INFO]"); break;
+ case soc_desc::error_t::WARNING: printf("[WARN]"); break;
+ case soc_desc::error_t::FATAL: printf("[FATAL]"); break;
+ default: printf("[UNK]"); break;
+ }
+ if(e.location().size() != 0)
+ printf(" %s:", e.location().c_str());
+ printf(" %s\n", e.message().c_str());
+ }
}
bool SocFile::IsValid()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment