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_PATH_H_ 6 #define CONTENT_COMMON_INDEXED_DB_INDEXED_DB_KEY_PATH_H_ 7 8 #include <string> 9 #include <vector> 10 11 #include "base/logging.h" 12 #include "base/strings/string16.h" 13 #include "content/common/content_export.h" 14 #include "third_party/WebKit/public/platform/WebIDBTypes.h" 15 16 namespace content { 17 18 class CONTENT_EXPORT IndexedDBKeyPath { 19 public: 20 IndexedDBKeyPath(); // Defaults to blink::WebIDBKeyPathTypeNull. 21 explicit IndexedDBKeyPath(const base::string16&); 22 explicit IndexedDBKeyPath(const std::vector<base::string16>&); 23 ~IndexedDBKeyPath(); 24 25 bool IsNull() const { return type_ == blink::WebIDBKeyPathTypeNull; } 26 bool operator==(const IndexedDBKeyPath& other) const; 27 28 blink::WebIDBKeyPathType type() const { return type_; } 29 const std::vector<base::string16>& array() const; 30 const base::string16& string() const; 31 32 private: 33 blink::WebIDBKeyPathType type_; 34 base::string16 string_; 35 std::vector<base::string16> array_; 36 }; 37 38 } // namespace content 39 40 #endif // CONTENT_COMMON_INDEXED_DB_INDEXED_DB_KEY_PATH_H_ 41