1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2024-11-08 16:57:16 +01:00
SqMod/modules/ini/Common.cpp
Sandu Liviu Catalin f4a11ef825 Separated major non mandatory libraries into their onwn modules.
Consolidated and simplified the module API system.
Various other fixes and improvements.
2016-02-27 11:57:10 +02:00

36 lines
1.2 KiB
C++

// ------------------------------------------------------------------------------------------------
#include "Common.hpp"
#include "Module.hpp"
// ------------------------------------------------------------------------------------------------
namespace SqMod {
// ------------------------------------------------------------------------------------------------
void IniResult::Check() const
{
// Identify the error type
switch (m_Result)
{
case SI_FAIL:
_SqMod->SqThrow("Unable to %s. Probably invalid", m_Action.c_str());
break;
case SI_NOMEM:
_SqMod->SqThrow("Unable to %s. Ran out of memory", m_Action.c_str());
break;
case SI_FILE:
_SqMod->SqThrow("Unable to %s. %s", strerror(errno));
break;
case SI_BADREF:
_SqMod->SqThrow("Unable to %s. Invalid document reference", m_Action.c_str());
break;
case SI_OK:
case SI_UPDATED:
case SI_INSERTED:
break; /* These are not error messahes. */
default:
_SqMod->SqThrow("Unable to %s for some unforeseen reason", m_Action.c_str());
}
}
} // Namespace:: SqMod