mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2025-06-16 07:07:13 +02:00
Migrated the host module to C++ exceptions as well.
Also enabled the latest C++ revision in the project. Replaced the Random library with the one provided by C++11. Implemented a simple AES256 encryption class. Various other fixes and improvements.
This commit is contained in:
54
modules/mmdb/LookupResult.cpp
Normal file
54
modules/mmdb/LookupResult.cpp
Normal file
@ -0,0 +1,54 @@
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
#include "LookupResult.hpp"
|
||||
#include "Module.hpp"
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
namespace SqMod {
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
SQInteger LookupResult::Typename(HSQUIRRELVM vm)
|
||||
{
|
||||
static const SQChar name[] = _SC("SqMMDBLookupResult");
|
||||
sq_pushstring(vm, name, sizeof(name));
|
||||
return 1;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void LookupResult::Validate() const
|
||||
{
|
||||
// Is the document handle valid?
|
||||
if (!m_Db)
|
||||
SqThrowF("Invalid Maxmind database reference");
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
LookupResult::LookupResult()
|
||||
: m_Db(), m_Result()
|
||||
{
|
||||
memset(&m_Result, 0, sizeof(Type));
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
Int32 LookupResult::Cmp(const LookupResult & o) const
|
||||
{
|
||||
if (m_Db == o.m_Db)
|
||||
return 0;
|
||||
else if (m_Db.DbPtr() > o.m_Db.DbPtr())
|
||||
return 1;
|
||||
else
|
||||
return -1;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
EntryDataList LookupResult::GetValueA(CSStr path, Array & arr) const
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
EntryDataList LookupResult::GetValueT(CSStr path, Table & tbl) const
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
} // Namespace:: SqMod
|
Reference in New Issue
Block a user