Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(404)

Side by Side Diff: google_apis/drive/gdata_wapi_parser.h

Issue 881723002: Remove google_apis::ResourceEntry and related code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « google_apis/BUILD.gn ('k') | google_apis/drive/gdata_wapi_parser.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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 GOOGLE_APIS_DRIVE_GDATA_WAPI_PARSER_H_
6 #define GOOGLE_APIS_DRIVE_GDATA_WAPI_PARSER_H_
7
8 #include <string>
9
10 #include "base/macros.h"
11
12 // Defines data elements of Google Documents API as described in
13 // http://code.google.com/apis/documents/.
14 namespace google_apis {
15
16 // This class represents a resource entry. A resource is a generic term which
17 // refers to a file and a directory.
18 class ResourceEntry {
19 public:
20 enum ResourceEntryKind {
21 ENTRY_KIND_UNKNOWN,
22 ENTRY_KIND_FOLDER,
23 ENTRY_KIND_FILE
24 };
25 ResourceEntry();
26 ~ResourceEntry();
27
28 // The resource ID is used to identify a resource, which looks like:
29 // file:d41d8cd98f00b204e9800998ecf8
30 const std::string& resource_id() const { return resource_id_; }
31
32 ResourceEntryKind kind() const { return kind_; }
33 const std::string& title() const { return title_; }
34
35 // True if the file or directory is deleted (applicable to change list only).
36 bool deleted() const { return deleted_; }
37
38 // True if resource entry is a folder (collection).
39 bool is_folder() const {
40 return kind_ == ENTRY_KIND_FOLDER;
41 }
42 // True if resource entry is regular file.
43 bool is_file() const {
44 return kind_ == ENTRY_KIND_FILE;
45 }
46
47 void set_resource_id(const std::string& resource_id) {
48 resource_id_ = resource_id;
49 }
50 void set_kind(ResourceEntryKind kind) { kind_ = kind; }
51 void set_title(const std::string& title) { title_ = title; }
52 void set_deleted(bool deleted) { deleted_ = deleted; }
53
54 private:
55 std::string resource_id_;
56 ResourceEntryKind kind_;
57 std::string title_;
58 bool deleted_;
59
60 DISALLOW_COPY_AND_ASSIGN(ResourceEntry);
61 };
62
63 } // namespace google_apis
64
65 #endif // GOOGLE_APIS_DRIVE_GDATA_WAPI_PARSER_H_
OLDNEW
« no previous file with comments | « google_apis/BUILD.gn ('k') | google_apis/drive/gdata_wapi_parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698