Home | History | Annotate | Download | only in drive
      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 CHROME_BROWSER_CHROMEOS_DRIVE_RESOURCE_ENTRY_CONVERSION_H_
      6 #define CHROME_BROWSER_CHROMEOS_DRIVE_RESOURCE_ENTRY_CONVERSION_H_
      7 
      8 namespace base {
      9 struct PlatformFileInfo;
     10 }
     11 
     12 namespace google_apis {
     13 class ResourceEntry;
     14 }
     15 
     16 namespace drive {
     17 
     18 class ResourceEntry;
     19 
     20 // Converts a google_apis::ResourceEntry into a drive::ResourceEntry.
     21 // If the conversion succeeded, return true and sets the result to |output|.
     22 // If failed, it returns false and keeps |*output| untouched.
     23 bool ConvertToResourceEntry(const google_apis::ResourceEntry& input,
     24                             ResourceEntry* output);
     25 
     26 // Converts the resource entry to the platform file info.
     27 void ConvertResourceEntryToPlatformFileInfo(const ResourceEntry& entry,
     28                                             base::PlatformFileInfo* file_info);
     29 
     30 // Converts the platform file info and sets it to the .file_info field of
     31 // the resource entry.
     32 void SetPlatformFileInfoToResourceEntry(const base::PlatformFileInfo& file_info,
     33                                         ResourceEntry* entry);
     34 
     35 }  // namespace drive
     36 
     37 #endif  // CHROME_BROWSER_CHROMEOS_DRIVE_RESOURCE_ENTRY_CONVERSION_H_
     38