#ifndef CONTENT_COMMON_INDEXED_DB_INDEXED_DB_KEY_H_
#define CONTENT_COMMON_INDEXED_DB_INDEXED_DB_KEY_H_
#include <vector>
#include "base/basictypes.h"
#include "base/memory/scoped_vector.h"
#include "base/strings/string16.h"
#include "content/common/content_export.h"
#include "third_party/WebKit/public/platform/WebIDBTypes.h"
namespace blink {
class WebIDBKey;
}
namespace content {
class CONTENT_EXPORT IndexedDBKey {
public:
typedef std::vector<IndexedDBKey> KeyArray;
IndexedDBKey();
explicit IndexedDBKey(blink::WebIDBKeyType);
explicit IndexedDBKey(const KeyArray& array);
explicit IndexedDBKey(const std::string& binary);
explicit IndexedDBKey(const base::string16& string);
IndexedDBKey(double number,
blink::WebIDBKeyType type);
~IndexedDBKey();
IndexedDBKey(const IndexedDBKey& other);
IndexedDBKey& operator=(const IndexedDBKey& other);
bool IsValid() const;
bool IsLessThan(const IndexedDBKey& other) const;
bool Equals(const IndexedDBKey& other) const;
blink::WebIDBKeyType type() const { return type_; }
const std::vector<IndexedDBKey>& array() const { return array_; }
const std::string& binary() const { return binary_; }
const base::string16& string() const { return string_; }
double date() const { return date_; }
double number() const { return number_; }
size_t size_estimate() const { return size_estimate_; }
private:
int CompareTo(const IndexedDBKey& other) const;
blink::WebIDBKeyType type_;
std::vector<IndexedDBKey> array_;
std::string binary_;
base::string16 string_;
double date_;
double number_;
size_t size_estimate_;
};
}
#endif