Initial commit
This commit is contained in:
commit
b7d90b9afe
16245 files changed
+3396666
No files matched your search
@@ -0,0 +1,61 @@
|
||||
// **************************************************************************
|
||||
//
|
||||
// (C) Copyright 2009 Swiss SIMTEC AG
|
||||
//
|
||||
// **************************************************************************
|
||||
//
|
||||
// $HeadURL$
|
||||
// $LastChangedBy$
|
||||
// $LastChangedDate$
|
||||
// $LastChangedRevision$
|
||||
//
|
||||
// **************************************************************************
|
||||
|
||||
#include "LogViewXdrElement.hpp"
|
||||
|
||||
namespace N_LogView
|
||||
{
|
||||
|
||||
// ---------------------------------------------------------------
|
||||
// Constructor of a struct or enum
|
||||
// ---------------------------------------------------------------
|
||||
LogViewXdrElement::LogViewXdrElement(const QString& a_name, const E_ElementKind a_kind, const char *loggerName)
|
||||
: m_Name(a_name)
|
||||
, m_Kind(a_kind)
|
||||
, m_logger(getLogger(loggerName))
|
||||
{
|
||||
if (a_name.indexOf(QLatin1Char('<')) >= 0 || a_name.indexOf(QLatin1Char('[')) >= 0)
|
||||
ERROR_LOG(m_logger) << "Element \'" << a_name.toStdString() << "\' has a problem";
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------
|
||||
void LogViewXdrElement::dump() const
|
||||
{
|
||||
INFO_LOG(m_logger) << "Element[" << getName() << "]: kind=" << getKindName();
|
||||
}
|
||||
|
||||
|
||||
// ---------------------------------------------------------------
|
||||
QString LogViewXdrElement::getKindName() const
|
||||
{
|
||||
switch (getKind())
|
||||
{
|
||||
case e_KindDefine:
|
||||
return QLatin1String("Define");
|
||||
case e_KindEnum:
|
||||
return QLatin1String("Enum");
|
||||
case e_KindEnumElement:
|
||||
return QLatin1String("EnumElement");
|
||||
case e_KindStandardType:
|
||||
return QLatin1String("StandardType");
|
||||
case e_KindStruct:
|
||||
return QLatin1String("Struct");
|
||||
case e_KindStructElement:
|
||||
return QLatin1String("StructElement");
|
||||
case e_KindTypedef:
|
||||
return QLatin1String("Typedef");
|
||||
}
|
||||
return QStringLiteral("Unknown (%1)").arg(getKind());
|
||||
}
|
||||
|
||||
} // namespace N_LogView
|
||||
Reference in new issue
Block a user