1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2024-11-14 03:37:16 +01:00
SqMod/modules/mmdb/LookupResult.cpp
2016-06-03 21:29:15 +03:00

54 lines
1.6 KiB
C++

// ------------------------------------------------------------------------------------------------
#include "LookupResult.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)
STHROWF("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