blob: 94143328d77719893451abac8e679263ac33b077 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CONTENT_COMMON_INDEXED_DB_INDEXED_DB_KEY_H_
#define CONTENT_COMMON_INDEXED_DB_INDEXED_DB_KEY_H_
#pragma once
#include <vector>
#include "base/basictypes.h"
#include "base/string16.h"
#include "content/common/content_export.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBKey.h"
class CONTENT_EXPORT IndexedDBKey {
public:
IndexedDBKey(); // Defaults to WebKit::WebIDBKey::InvalidType.
explicit IndexedDBKey(const WebKit::WebIDBKey& key);
~IndexedDBKey();
void SetNull();
void SetInvalid();
void SetArray(const std::vector<IndexedDBKey>& array);
void SetString(const string16& string);
void SetDate(double date);
void SetNumber(double number);
void Set(const WebKit::WebIDBKey& key);
WebKit::WebIDBKey::Type type() const { return type_; }
const std::vector<IndexedDBKey>& array() const { return array_; }
const string16& string() const { return string_; }
double date() const { return date_; }
double number() const { return number_; }
operator WebKit::WebIDBKey() const;
private:
WebKit::WebIDBKey::Type type_;
std::vector<IndexedDBKey> array_;
string16 string_;
double date_;
double number_;
};
#endif // CONTENT_COMMON_INDEXED_DB_INDEXED_DB_KEY_H_
|