OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_GOOGLE_APIS_GDATA_WAPI_PARSER_H_ | 5 #ifndef CHROME_BROWSER_GOOGLE_APIS_GDATA_WAPI_PARSER_H_ |
6 #define CHROME_BROWSER_GOOGLE_APIS_GDATA_WAPI_PARSER_H_ | 6 #define CHROME_BROWSER_GOOGLE_APIS_GDATA_WAPI_PARSER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
379 | 379 |
380 // Registers the mapping between JSON field names and the members in | 380 // Registers the mapping between JSON field names and the members in |
381 // this class. | 381 // this class. |
382 static void RegisterJSONConverter( | 382 static void RegisterJSONConverter( |
383 base::JSONValueConverter<DocumentEntry>* converter); | 383 base::JSONValueConverter<DocumentEntry>* converter); |
384 | 384 |
385 // Helper function for parsing bool fields based on presence of | 385 // Helper function for parsing bool fields based on presence of |
386 // their value nodes. | 386 // their value nodes. |
387 static bool HasFieldPresent(const base::Value* value, bool* result); | 387 static bool HasFieldPresent(const base::Value* value, bool* result); |
388 | 388 |
389 static bool OptionalChangestamp(const base::StringPiece& value, int64* result) ; | |
kinuko
2012/11/29 11:40:46
nit: over 80 chars
tzik
2012/12/03 10:00:08
Done.
| |
390 | |
389 // Returns true if |file| has one of the hosted document extensions. | 391 // Returns true if |file| has one of the hosted document extensions. |
390 static bool HasHostedDocumentExtension(const FilePath& file); | 392 static bool HasHostedDocumentExtension(const FilePath& file); |
391 | 393 |
392 // Document entry resource id. | 394 // Document entry resource id. |
393 const std::string& resource_id() const { return resource_id_; } | 395 const std::string& resource_id() const { return resource_id_; } |
394 | 396 |
395 // Document entry id. | 397 // Document entry id. |
396 const std::string& id() const { return id_; } | 398 const std::string& id() const { return id_; } |
397 | 399 |
398 // Document entry kind. | 400 // Document entry kind. |
(...skipping 28 matching lines...) Expand all Loading... | |
427 | 429 |
428 // Document feed file content MD5 (exists only for kinds FILE and PDF). | 430 // Document feed file content MD5 (exists only for kinds FILE and PDF). |
429 const std::string& file_md5() const { return file_md5_; } | 431 const std::string& file_md5() const { return file_md5_; } |
430 | 432 |
431 // Document feed file size (exists only for kinds FILE and PDF). | 433 // Document feed file size (exists only for kinds FILE and PDF). |
432 int64 file_size() const { return file_size_; } | 434 int64 file_size() const { return file_size_; } |
433 | 435 |
434 // True if the file or directory is deleted (applicable to change feeds only). | 436 // True if the file or directory is deleted (applicable to change feeds only). |
435 bool deleted() const { return deleted_ || removed_; } | 437 bool deleted() const { return deleted_ || removed_; } |
436 | 438 |
439 // Changestamp (exists only for change query results). | |
440 int64 changestamp() const { return changestamp_; } | |
kinuko
2012/11/29 11:40:46
Yes, I wanted to have this!
| |
441 | |
437 // Text version of document entry kind. Returns an empty string for | 442 // Text version of document entry kind. Returns an empty string for |
438 // unknown entry kind. | 443 // unknown entry kind. |
439 std::string GetEntryKindText() const; | 444 std::string GetEntryKindText() const; |
440 | 445 |
441 // Returns preferred file extension for hosted documents. If entry is not | 446 // Returns preferred file extension for hosted documents. If entry is not |
442 // a hosted document, this call returns an empty string. | 447 // a hosted document, this call returns an empty string. |
443 std::string GetHostedDocumentExtension() const; | 448 std::string GetHostedDocumentExtension() const; |
444 | 449 |
445 // True if document entry is remotely hosted. | 450 // True if document entry is remotely hosted. |
446 bool is_hosted_document() const { | 451 bool is_hosted_document() const { |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
510 std::vector<string16> labels_; | 515 std::vector<string16> labels_; |
511 Content content_; | 516 Content content_; |
512 ScopedVector<FeedLink> feed_links_; | 517 ScopedVector<FeedLink> feed_links_; |
513 // Optional fields for files only. | 518 // Optional fields for files only. |
514 string16 filename_; | 519 string16 filename_; |
515 string16 suggested_filename_; | 520 string16 suggested_filename_; |
516 std::string file_md5_; | 521 std::string file_md5_; |
517 int64 file_size_; | 522 int64 file_size_; |
518 bool deleted_; | 523 bool deleted_; |
519 bool removed_; | 524 bool removed_; |
525 int64 changestamp_; | |
520 | 526 |
521 DISALLOW_COPY_AND_ASSIGN(DocumentEntry); | 527 DISALLOW_COPY_AND_ASSIGN(DocumentEntry); |
522 }; | 528 }; |
523 | 529 |
524 // Document feed represents a list of entries. The feed is paginated and | 530 // Document feed represents a list of entries. The feed is paginated and |
525 // the rest of the feed can be fetched by retrieving the remaining parts of the | 531 // the rest of the feed can be fetched by retrieving the remaining parts of the |
526 // feed from URLs provided by GetNextFeedURL() method. | 532 // feed from URLs provided by GetNextFeedURL() method. |
527 class DocumentFeed : public FeedEntry { | 533 class DocumentFeed : public FeedEntry { |
528 public: | 534 public: |
529 virtual ~DocumentFeed(); | 535 virtual ~DocumentFeed(); |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
727 int64 largest_changestamp_; | 733 int64 largest_changestamp_; |
728 ScopedVector<InstalledApp> installed_apps_; | 734 ScopedVector<InstalledApp> installed_apps_; |
729 | 735 |
730 DISALLOW_COPY_AND_ASSIGN(AccountMetadataFeed); | 736 DISALLOW_COPY_AND_ASSIGN(AccountMetadataFeed); |
731 }; | 737 }; |
732 | 738 |
733 | 739 |
734 } // namespace google_apis | 740 } // namespace google_apis |
735 | 741 |
736 #endif // CHROME_BROWSER_GOOGLE_APIS_GDATA_WAPI_PARSER_H_ | 742 #endif // CHROME_BROWSER_GOOGLE_APIS_GDATA_WAPI_PARSER_H_ |
OLD | NEW |