1// Copyright (c) 2012 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef CONTENT_COMMON_INDEXED_DB_INDEXED_DB_KEY_RANGE_H_
6#define CONTENT_COMMON_INDEXED_DB_INDEXED_DB_KEY_RANGE_H_
7
8#include "base/basictypes.h"
9#include "content/common/content_export.h"
10#include "content/common/indexed_db/indexed_db_key.h"
11
12namespace content {
13
14class CONTENT_EXPORT IndexedDBKeyRange {
15 public:
16  IndexedDBKeyRange();
17  explicit IndexedDBKeyRange(const IndexedDBKey& onlyKey);
18  IndexedDBKeyRange(const IndexedDBKey& lower,
19                    const IndexedDBKey& upper,
20                    bool lower_open,
21                    bool upper_open);
22  ~IndexedDBKeyRange();
23
24  const IndexedDBKey& lower() const { return lower_; }
25  const IndexedDBKey& upper() const { return upper_; }
26  bool lowerOpen() const { return lower_open_; }
27  bool upperOpen() const { return upper_open_; }
28
29  bool IsOnlyKey() const;
30
31 private:
32  IndexedDBKey lower_;
33  IndexedDBKey upper_;
34  bool lower_open_;
35  bool upper_open_;
36};
37
38}  // namespace content
39
40#endif  // CONTENT_COMMON_INDEXED_DB_INDEXED_DB_KEY_RANGE_H_
41