This source file includes following definitions.
- assign
- assign
- reset
- lower
- upper
- lowerOpen
- upperOpen
#include "config.h"
#include "public/platform/WebIDBKeyRange.h"
#include "public/platform/WebIDBKey.h"
#include "modules/indexeddb/IDBKey.h"
#include "modules/indexeddb/IDBKeyRange.h"
using namespace WebCore;
namespace blink {
void WebIDBKeyRange::assign(const WebIDBKeyRange& other)
{
m_private = other.m_private;
}
void WebIDBKeyRange::assign(const WebIDBKey& lower, const WebIDBKey& upper, bool lowerOpen, bool upperOpen)
{
if (!lower.isValid() && !upper.isValid())
m_private.reset();
else
m_private = IDBKeyRange::create(lower, upper, lowerOpen ? IDBKeyRange::LowerBoundOpen : IDBKeyRange::LowerBoundClosed, upperOpen ? IDBKeyRange::UpperBoundOpen : IDBKeyRange::UpperBoundClosed);
}
void WebIDBKeyRange::reset()
{
m_private.reset();
}
WebIDBKey WebIDBKeyRange::lower() const
{
if (!m_private.get())
return WebIDBKey::createInvalid();
return m_private->lower();
}
WebIDBKey WebIDBKeyRange::upper() const
{
if (!m_private.get())
return WebIDBKey::createInvalid();
return m_private->upper();
}
bool WebIDBKeyRange::lowerOpen() const
{
return m_private.get() && m_private->lowerOpen();
}
bool WebIDBKeyRange::upperOpen() const
{
return m_private.get() && m_private->upperOpen();
}
WebIDBKeyRange::WebIDBKeyRange(const PassRefPtr<IDBKeyRange>& value)
: m_private(value)
{
}
WebIDBKeyRange& WebIDBKeyRange::operator=(const PassRefPtr<IDBKeyRange>& value)
{
m_private = value;
return *this;
}
WebIDBKeyRange::operator PassRefPtr<IDBKeyRange>() const
{
return m_private.get();
}
}