Project

General

Profile

Download (822 Bytes) Statistics
| Branch: | Revision:
#include <cstring>

#include "CatalogItem.h"

CatalogItem::CatalogItem(const std::string& key, const std::string& value)
: m_key(key),
m_keyLower(key),
m_value(value),
m_visible(true)
{
// Create lowercase version of the key's value
for (uint32_t idx = 0; idx < m_keyLower.size(); ++idx)
{
if ((m_keyLower.at(idx) >= 'A') && (m_keyLower.at(idx) <= 'Z'))
{
m_keyLower.at(idx) = (m_keyLower.at(idx) | 32);
}
}

// Zero out value buffer and then copy the value into the buffer
std::memset(m_valueBuffer, 0, VALUE_BUFFER_SIZE);
std::memcpy(m_valueBuffer, m_value.data(), m_value.size());
}

CatalogItem::~CatalogItem()
{

}

bool CatalogItem::match(const std::string& criteria)
{
return m_keyLower.find(criteria) != std::string::npos;
}
(3-3/7)