2016-03-21 06:59:03 +08:00
|
|
|
/* nvram.cpp
|
|
|
|
Copyright (c) 2016, Nikolaj Schlej. All rights reserved.
|
|
|
|
|
|
|
|
This program and the accompanying materials
|
|
|
|
are licensed and made available under the terms and conditions of the BSD License
|
|
|
|
which accompanies this distribution. The full text of the license may be found at
|
|
|
|
http://opensource.org/licenses/bsd-license.php.
|
|
|
|
|
|
|
|
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
#include "nvram.h"
|
|
|
|
|
|
|
|
QString variableAttributesToQstring(UINT8 attributes)
|
|
|
|
{
|
2016-03-21 16:54:20 +08:00
|
|
|
if (attributes == 0x00 || attributes == 0xFF)
|
2016-03-21 06:59:03 +08:00
|
|
|
return QString();
|
2016-03-21 16:54:20 +08:00
|
|
|
|
|
|
|
QString str;
|
|
|
|
|
|
|
|
if (attributes & NVRAM_NVAR_VARIABLE_ATTRIB_RUNTIME)
|
2016-03-21 06:59:03 +08:00
|
|
|
str += QObject::tr(", Runtime");
|
2016-03-21 16:54:20 +08:00
|
|
|
if (attributes & NVRAM_NVAR_VARIABLE_ATTRIB_ASCII_NAME)
|
2016-03-21 06:59:03 +08:00
|
|
|
str += QObject::tr(", AsciiName");
|
2016-03-21 16:54:20 +08:00
|
|
|
if (attributes & NVRAM_NVAR_VARIABLE_ATTRIB_GUID)
|
2016-03-21 06:59:03 +08:00
|
|
|
str += QObject::tr(", Guid");
|
2016-03-21 16:54:20 +08:00
|
|
|
if (attributes & NVRAM_NVAR_VARIABLE_ATTRIB_DATA_ONLY)
|
2016-03-21 06:59:03 +08:00
|
|
|
str += QObject::tr(", DataOnly");
|
2016-03-21 16:54:20 +08:00
|
|
|
if (attributes & NVRAM_NVAR_VARIABLE_ATTRIB_EXT_HEADER)
|
2016-03-21 06:59:03 +08:00
|
|
|
str += QObject::tr(", ExtHeader");
|
2016-03-21 16:54:20 +08:00
|
|
|
if (attributes & NVRAM_NVAR_VARIABLE_ATTRIB_HW_ERROR_RECORD)
|
2016-03-21 06:59:03 +08:00
|
|
|
str += QObject::tr(", HwErrorRecord");
|
2016-03-21 16:54:20 +08:00
|
|
|
if (attributes & NVRAM_NVAR_VARIABLE_ATTRIB_AUTH_WRITE)
|
2016-03-21 06:59:03 +08:00
|
|
|
str += QObject::tr(", AuthWrite");
|
2016-03-21 16:54:20 +08:00
|
|
|
if (attributes & NVRAM_NVAR_VARIABLE_ATTRIB_VALID)
|
2016-03-21 06:59:03 +08:00
|
|
|
str += QObject::tr(", Valid");
|
2016-03-21 16:54:20 +08:00
|
|
|
|
2016-03-21 06:59:03 +08:00
|
|
|
return str.mid(2); // Remove the first comma and space
|
2016-03-21 16:54:20 +08:00
|
|
|
}
|
|
|
|
|