mirror of
https://github.com/jakcron/nstool.git
synced 2024-12-23 11:15:28 +00:00
81 lines
1.6 KiB
C++
81 lines
1.6 KiB
C++
#include "MiscParamsHandler.h"
|
|
|
|
|
|
|
|
nx::MiscParamsHandler::MiscParamsHandler() :
|
|
mIsSet(false),
|
|
mEntry(0)
|
|
{}
|
|
|
|
bool nx::MiscParamsHandler::operator==(const MiscParamsHandler & other) const
|
|
{
|
|
return isEqual(other);
|
|
}
|
|
|
|
bool nx::MiscParamsHandler::operator!=(const MiscParamsHandler & other) const
|
|
{
|
|
return !isEqual(other);
|
|
}
|
|
|
|
void nx::MiscParamsHandler::operator=(const MiscParamsHandler & other)
|
|
{
|
|
copyFrom(other);
|
|
}
|
|
|
|
void nx::MiscParamsHandler::importKernelCapabilityList(const fnd::List<KernelCapability>& caps)
|
|
{
|
|
if (caps.getSize() > kMaxKernelCapNum)
|
|
{
|
|
throw fnd::Exception(kModuleName, "Too many kernel capabilities");
|
|
}
|
|
|
|
if (caps.getSize() == 0)
|
|
return;
|
|
|
|
mEntry.setKernelCapability(caps[0]);
|
|
|
|
mIsSet = true;
|
|
}
|
|
|
|
void nx::MiscParamsHandler::exportKernelCapabilityList(fnd::List<KernelCapability>& caps) const
|
|
{
|
|
if (isSet() == false)
|
|
return;
|
|
|
|
caps.addElement(mEntry.getKernelCapability());
|
|
}
|
|
|
|
void nx::MiscParamsHandler::clear()
|
|
{
|
|
mIsSet = false;
|
|
mEntry.setProgramType(0);
|
|
}
|
|
|
|
bool nx::MiscParamsHandler::isSet() const
|
|
{
|
|
return mIsSet;
|
|
}
|
|
|
|
u8 nx::MiscParamsHandler::getProgramType() const
|
|
{
|
|
return mEntry.getProgramType();
|
|
}
|
|
|
|
void nx::MiscParamsHandler::setProgramType(u8 type)
|
|
{
|
|
mEntry.setProgramType(type);
|
|
mIsSet = true;
|
|
}
|
|
|
|
void nx::MiscParamsHandler::copyFrom(const MiscParamsHandler & other)
|
|
{
|
|
mIsSet = other.mIsSet;
|
|
mEntry.setKernelCapability(other.mEntry.getKernelCapability());
|
|
}
|
|
|
|
bool nx::MiscParamsHandler::isEqual(const MiscParamsHandler & other) const
|
|
{
|
|
return (mIsSet == other.mIsSet) \
|
|
&& (mEntry.getKernelCapability() == other.mEntry.getKernelCapability());
|
|
}
|