Index: chrome/browser/chromeos/gdata/gdata_db.h |
=================================================================== |
--- chrome/browser/chromeos/gdata/gdata_db.h (revision 0) |
+++ chrome/browser/chromeos/gdata/gdata_db.h (revision 0) |
@@ -0,0 +1,64 @@ |
+// 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 CHROME_BROWSER_CHROMEOS_GDATA_GDATA_DB_H_ |
+#define CHROME_BROWSER_CHROMEOS_GDATA_GDATA_DB_H_ |
+#pragma once |
+ |
+#include <string> |
+ |
+#include "base/file_path.h" |
+#include "base/memory/scoped_ptr.h" |
+ |
+namespace gdata { |
+ |
+class GDataEntry; |
+class GDataDBIter; |
+ |
+class GDataDB { |
satorux1
2012/04/23 17:40:41
class comment is missing.
|
+ public: |
+ enum Status { |
+ DB_OK = 0, |
+ DB_NOT_FOUND, |
+ DB_ERR, |
+ }; |
+ |
+ virtual ~GDataDB() {} |
+ |
+ // Factory method to create a GDataDB instance at |db_path| |
satorux1
2012/04/23 17:40:41
period is missing.
achuithb
2012/04/24 08:09:36
Done.
|
+ static scoped_ptr<GDataDB> Create(const FilePath& db_path); |
satorux1
2012/04/23 17:40:41
You might want to move this factory function out o
achuithb
2012/04/24 08:09:36
Done.
|
+ |
+ // Add |entry| to the database. |
+ virtual Status Put(const GDataEntry& entry) = 0; |
+ |
+ // Delete a database entry with key |resource_id| or |path| respectively. |
+ virtual Status DeleteByResourceId(const std::string& resource_id) = 0; |
+ virtual Status DeleteByPath(const std::string& path) = 0; |
+ |
+ // Fetch a GDataEntry* by key |resource_id| or |path| respectively. |
+ virtual Status GetByResourceId(const std::string& resource_id, |
+ scoped_ptr<GDataEntry>* entry) = 0; |
+ virtual Status GetByPath(const std::string& path, |
+ scoped_ptr<GDataEntry>* entry) = 0; |
+ |
+ // An iterator to fetch all GDataEntry's under |path|. |
+ virtual scoped_ptr<GDataDBIter> NewIterator(const std::string& path) = 0; |
+ |
+ protected: |
+ GDataDB() {} |
+ |
+ DISALLOW_COPY_AND_ASSIGN(GDataDB); |
+}; |
+ |
+class GDataDBIter { |
satorux1
2012/04/23 17:40:41
class comment is missing.
achuithb
2012/04/24 08:09:36
Done.
|
+ public: |
+ virtual ~GDataDBIter() {} |
+ virtual scoped_ptr<GDataEntry> GetNext() = 0; |
satorux1
2012/04/23 17:40:41
put a blank line?
achuithb
2012/04/24 08:09:36
Done.
|
+ protected: |
+ GDataDBIter() {} |
+}; |
+ |
+} // namespace gdata |
+ |
+#endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_DB_H_ |
Property changes on: chrome/browser/chromeos/gdata/gdata_db.h |
___________________________________________________________________ |
Added: svn:eol-style |
+ LF |