file_errors.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. #ifndef COMPONENTS_DRIVE_FILE_ERRORS_H_
  5. #define COMPONENTS_DRIVE_FILE_ERRORS_H_
  6. #include "base/files/file.h"
  7. #include "google_apis/common/api_error_codes.h"
  8. namespace drive {
  9. enum FileError {
  10. FILE_ERROR_OK = 0,
  11. FILE_ERROR_FAILED = -1,
  12. FILE_ERROR_IN_USE = -2,
  13. FILE_ERROR_EXISTS = -3,
  14. FILE_ERROR_NOT_FOUND = -4,
  15. FILE_ERROR_ACCESS_DENIED = -5,
  16. FILE_ERROR_TOO_MANY_OPENED = -6,
  17. FILE_ERROR_NO_MEMORY = -7,
  18. FILE_ERROR_NO_SERVER_SPACE = -8,
  19. FILE_ERROR_NOT_A_DIRECTORY = -9,
  20. FILE_ERROR_INVALID_OPERATION = -10,
  21. FILE_ERROR_SECURITY = -11,
  22. FILE_ERROR_ABORT = -12,
  23. FILE_ERROR_NOT_A_FILE = -13,
  24. FILE_ERROR_NOT_EMPTY = -14,
  25. FILE_ERROR_INVALID_URL = -15,
  26. FILE_ERROR_NO_CONNECTION = -16,
  27. FILE_ERROR_NO_LOCAL_SPACE = -17,
  28. FILE_ERROR_SERVICE_UNAVAILABLE = -18,
  29. };
  30. // Returns a string representation of FileError.
  31. std::string FileErrorToString(FileError error);
  32. // Returns a base::File::Error that corresponds to the FileError provided.
  33. base::File::Error FileErrorToBaseFileError(FileError error);
  34. // Converts GData error code into Drive file error code.
  35. FileError GDataToFileError(google_apis::ApiErrorCode status);
  36. } // namespace drive
  37. #endif // COMPONENTS_DRIVE_FILE_ERRORS_H_