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_CHROMEOS_GDATA_GDATA_PARSER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_GDATA_GDATA_PARSER_H_ |
6 #define CHROME_BROWSER_CHROMEOS_GDATA_GDATA_PARSER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_GDATA_GDATA_PARSER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
339 // Document feed file content MD5 (exists only for kinds FILE and PDF). | 339 // Document feed file content MD5 (exists only for kinds FILE and PDF). |
340 const std::string& file_md5() const { return file_md5_; } | 340 const std::string& file_md5() const { return file_md5_; } |
341 | 341 |
342 // Document feed file size (exists only for kinds FILE and PDF). | 342 // Document feed file size (exists only for kinds FILE and PDF). |
343 int64 file_size() const { return file_size_; } | 343 int64 file_size() const { return file_size_; } |
344 | 344 |
345 // Text version of document entry kind. Returns an empty string for | 345 // Text version of document entry kind. Returns an empty string for |
346 // unknown entry kind. | 346 // unknown entry kind. |
347 std::string GetEntryKindText() const; | 347 std::string GetEntryKindText() const; |
348 | 348 |
| 349 // Returns preferred file extension for hosted documents. If entry is not |
| 350 // a hosted document, this call returns an empty string. |
| 351 std::string GetHostedDocumentExtension() const; |
| 352 |
349 // True if document entry is remotely hosted. | 353 // True if document entry is remotely hosted. |
350 bool is_hosted_document() const { return (kind_ & 0x002000) != 0; } | 354 bool is_hosted_document() const { return (kind_ & 0x002000) != 0; } |
351 // True if document entry is a folder (collection). | 355 // True if document entry is a folder (collection). |
352 bool is_folder() const { return (kind_ & 0x004000) != 0; } | 356 bool is_folder() const { return (kind_ & 0x004000) != 0; } |
353 // True if document entry is regular file. | 357 // True if document entry is regular file. |
354 bool is_file() const { return (kind_ & 0x008000) != 0; } | 358 bool is_file() const { return (kind_ & 0x008000) != 0; } |
355 // True if document entry can't be mapped to the file system. | 359 // True if document entry can't be mapped to the file system. |
356 bool is_special() const { | 360 bool is_special() const { |
357 return !is_file() && !is_folder() && !is_hosted_document(); | 361 return !is_file() && !is_folder() && !is_hosted_document(); |
358 } | 362 } |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
450 static const char kItemsPerPageField[]; | 454 static const char kItemsPerPageField[]; |
451 static const char kTitleField[]; | 455 static const char kTitleField[]; |
452 static const char kEntryField[]; | 456 static const char kEntryField[]; |
453 | 457 |
454 DISALLOW_COPY_AND_ASSIGN(DocumentFeed); | 458 DISALLOW_COPY_AND_ASSIGN(DocumentFeed); |
455 }; | 459 }; |
456 | 460 |
457 } // namespace gdata | 461 } // namespace gdata |
458 | 462 |
459 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_PARSER_H_ | 463 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_PARSER_H_ |
OLD | NEW |