mirror of
https://github.com/DarwinAnim8or/DarkflameServerNostalgiaMax.git
synced 2025-12-30 10:19:56 -06:00
47 lines
1.2 KiB
C++
47 lines
1.2 KiB
C++
#include "CDIconsTable.h"
|
|
//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:32.990911
|
|
//DO NOT EDIT THIS FILE MANUALLY!
|
|
|
|
CDIconsTable::CDIconsTable() {
|
|
unsigned int size = 0;
|
|
auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM Icons");
|
|
while (!tableSize.eof()) {
|
|
size = tableSize.getIntField(0, 0);
|
|
tableSize.nextRow();
|
|
}
|
|
|
|
tableSize.finalize();
|
|
this->m_entries.reserve(size);
|
|
|
|
auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM Icons");
|
|
while (!tableData.eof()) {
|
|
CDIcons entry;
|
|
entry.IconID = tableData.getIntField(0, int{});
|
|
entry.IconPath = tableData.getStringField(1, std::string{}.c_str());
|
|
entry.IconName = tableData.getStringField(2, std::string{}.c_str());
|
|
this->m_entries.push_back(entry);
|
|
tableData.nextRow();
|
|
}
|
|
|
|
tableData.finalize();
|
|
}
|
|
|
|
CDIconsTable::~CDIconsTable() {
|
|
}
|
|
|
|
std::string CDIconsTable::GetName(void) const {
|
|
return "Icons";
|
|
}
|
|
|
|
std::vector<CDIcons> CDIconsTable::Query(std::function<bool(CDIcons)> predicate) {
|
|
std::vector<CDIcons> data = cpplinq::from(this->m_entries)
|
|
>> cpplinq::where(predicate)
|
|
>> cpplinq::to_vector();
|
|
|
|
return data;
|
|
}
|
|
|
|
std::vector<CDIcons> CDIconsTable::GetEntries(void) const {
|
|
return this->m_entries;
|
|
}
|