Chromium Code Reviews| 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 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 376 | 376 |
| 377 // Returns name of entry node. | 377 // Returns name of entry node. |
| 378 static std::string GetEntryNodeName(); | 378 static std::string GetEntryNodeName(); |
| 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. |
|
satorux1
2012/12/03 05:59:57
Please also fix this comment too.
tzik
2012/12/03 06:16:34
Done.
| |
| 387 static bool HasFieldPresent(const base::Value* value, bool* result); | 387 static bool HasFieldPresent(const base::Value* value, bool* result); |
| 388 | 388 |
| 389 // Helper function for parsing changestamp. | |
|
satorux1
2012/12/03 05:59:57
The function comment looks not good. Please revise
tzik
2012/12/03 06:16:34
Done.
| |
| 390 static bool OptionalChangestamp(const base::StringPiece& value, | |
|
satorux1
2012/12/03 05:59:57
Function names should usually start with a verb.
tzik
2012/12/03 06:16:34
Done.
| |
| 391 int64* result); | |
| 392 | |
| 389 // Returns true if |file| has one of the hosted document extensions. | 393 // Returns true if |file| has one of the hosted document extensions. |
| 390 static bool HasHostedDocumentExtension(const FilePath& file); | 394 static bool HasHostedDocumentExtension(const FilePath& file); |
| 391 | 395 |
| 392 // Document entry resource id. | 396 // Document entry resource id. |
| 393 const std::string& resource_id() const { return resource_id_; } | 397 const std::string& resource_id() const { return resource_id_; } |
| 394 | 398 |
| 395 // Document entry id. | 399 // Document entry id. |
| 396 const std::string& id() const { return id_; } | 400 const std::string& id() const { return id_; } |
| 397 | 401 |
| 398 // Document entry kind. | 402 // Document entry kind. |
| (...skipping 28 matching lines...) Expand all Loading... | |
| 427 | 431 |
| 428 // Document feed file content MD5 (exists only for kinds FILE and PDF). | 432 // Document feed file content MD5 (exists only for kinds FILE and PDF). |
| 429 const std::string& file_md5() const { return file_md5_; } | 433 const std::string& file_md5() const { return file_md5_; } |
| 430 | 434 |
| 431 // Document feed file size (exists only for kinds FILE and PDF). | 435 // Document feed file size (exists only for kinds FILE and PDF). |
| 432 int64 file_size() const { return file_size_; } | 436 int64 file_size() const { return file_size_; } |
| 433 | 437 |
| 434 // True if the file or directory is deleted (applicable to change feeds only). | 438 // True if the file or directory is deleted (applicable to change feeds only). |
| 435 bool deleted() const { return deleted_ || removed_; } | 439 bool deleted() const { return deleted_ || removed_; } |
| 436 | 440 |
| 441 // Changestamp (exists only for change query results). | |
| 442 int64 changestamp() const { return changestamp_; } | |
| 443 | |
| 437 // Text version of document entry kind. Returns an empty string for | 444 // Text version of document entry kind. Returns an empty string for |
| 438 // unknown entry kind. | 445 // unknown entry kind. |
| 439 std::string GetEntryKindText() const; | 446 std::string GetEntryKindText() const; |
| 440 | 447 |
| 441 // Returns preferred file extension for hosted documents. If entry is not | 448 // Returns preferred file extension for hosted documents. If entry is not |
| 442 // a hosted document, this call returns an empty string. | 449 // a hosted document, this call returns an empty string. |
| 443 std::string GetHostedDocumentExtension() const; | 450 std::string GetHostedDocumentExtension() const; |
| 444 | 451 |
| 445 // True if document entry is remotely hosted. | 452 // True if document entry is remotely hosted. |
| 446 bool is_hosted_document() const { | 453 bool is_hosted_document() const { |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 510 std::vector<string16> labels_; | 517 std::vector<string16> labels_; |
| 511 Content content_; | 518 Content content_; |
| 512 ScopedVector<FeedLink> feed_links_; | 519 ScopedVector<FeedLink> feed_links_; |
| 513 // Optional fields for files only. | 520 // Optional fields for files only. |
| 514 string16 filename_; | 521 string16 filename_; |
| 515 string16 suggested_filename_; | 522 string16 suggested_filename_; |
| 516 std::string file_md5_; | 523 std::string file_md5_; |
| 517 int64 file_size_; | 524 int64 file_size_; |
| 518 bool deleted_; | 525 bool deleted_; |
| 519 bool removed_; | 526 bool removed_; |
| 527 int64 changestamp_; | |
| 520 | 528 |
| 521 DISALLOW_COPY_AND_ASSIGN(DocumentEntry); | 529 DISALLOW_COPY_AND_ASSIGN(DocumentEntry); |
| 522 }; | 530 }; |
| 523 | 531 |
| 524 // Document feed represents a list of entries. The feed is paginated and | 532 // 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 | 533 // the rest of the feed can be fetched by retrieving the remaining parts of the |
| 526 // feed from URLs provided by GetNextFeedURL() method. | 534 // feed from URLs provided by GetNextFeedURL() method. |
| 527 class DocumentFeed : public FeedEntry { | 535 class DocumentFeed : public FeedEntry { |
| 528 public: | 536 public: |
| 529 virtual ~DocumentFeed(); | 537 virtual ~DocumentFeed(); |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 727 int64 largest_changestamp_; | 735 int64 largest_changestamp_; |
| 728 ScopedVector<InstalledApp> installed_apps_; | 736 ScopedVector<InstalledApp> installed_apps_; |
| 729 | 737 |
| 730 DISALLOW_COPY_AND_ASSIGN(AccountMetadataFeed); | 738 DISALLOW_COPY_AND_ASSIGN(AccountMetadataFeed); |
| 731 }; | 739 }; |
| 732 | 740 |
| 733 | 741 |
| 734 } // namespace google_apis | 742 } // namespace google_apis |
| 735 | 743 |
| 736 #endif // CHROME_BROWSER_GOOGLE_APIS_GDATA_WAPI_PARSER_H_ | 744 #endif // CHROME_BROWSER_GOOGLE_APIS_GDATA_WAPI_PARSER_H_ |
| OLD | NEW |