/core/externals/update-engine/externals/gdata-objectivec-client/Source/Networking/GDataServerError.h

http://macfuse.googlecode.com/ · C++ Header · 94 lines · 41 code · 23 blank · 30 comment · 0 complexity · 1c5a20c0a496285812ce8cda543b73f7 MD5 · raw file

  1. /* Copyright (c) 2008 Google Inc.
  2. *
  3. * Licensed under the Apache License, Version 2.0 (the "License");
  4. * you may not use this file except in compliance with the License.
  5. * You may obtain a copy of the License at
  6. *
  7. * http://www.apache.org/licenses/LICENSE-2.0
  8. *
  9. * Unless required by applicable law or agreed to in writing, software
  10. * distributed under the License is distributed on an "AS IS" BASIS,
  11. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. * See the License for the specific language governing permissions and
  13. * limitations under the License.
  14. */
  15. //
  16. // GDataServerError.h
  17. //
  18. // Wrapper around the list of structured errors returned by GData servers
  19. //
  20. // See also the Java library's ErrorDomain.java, ServiceException.java, and
  21. // CoreErrorDomain.java
  22. //
  23. #import <Foundation/Foundation.h>
  24. #import "GDataDefines.h"
  25. #undef _EXTERN
  26. #undef _INITIALIZE_AS
  27. #ifdef GDATASERVERERROR_DEFINE_GLOBALS
  28. #define _EXTERN
  29. #define _INITIALIZE_AS(x) =x
  30. #else
  31. #define _EXTERN GDATA_EXTERN
  32. #define _INITIALIZE_AS(x)
  33. #endif
  34. _EXTERN NSString* const kGDataErrorDomainCore _INITIALIZE_AS(@"GData");
  35. @class GDataServerError;
  36. //
  37. // GDataServerErrorGroup represents an array of error objects
  38. //
  39. @interface GDataServerErrorGroup : NSObject {
  40. NSArray *errors_;
  41. }
  42. - (id)initWithData:(NSData *)data;
  43. - (NSArray *)errors;
  44. - (void)setErrors:(NSArray *)array;
  45. - (GDataServerError *)mainError;
  46. @end
  47. //
  48. // GDataServerError
  49. //
  50. @interface GDataServerError : NSObject {
  51. NSString *domain_; // domain name
  52. NSString *code_; // error name, unique within the domain
  53. NSString *internalReason_; // internal server message
  54. NSString *extendedHelpURI_; // URI to additional help
  55. NSString *sendReportURI_; // URI for sending a report
  56. }
  57. - (id)initWithXMLElement:(NSXMLElement *)element;
  58. // summary is a minimally user-readable summary of the domain, code, and
  59. // reason
  60. - (NSString *)summary;
  61. - (NSString *)domain;
  62. - (void)setDomain:(NSString *)str;
  63. - (NSString *)code;
  64. - (void)setCode:(NSString *)str;
  65. - (NSString *)internalReason;
  66. - (void)setInternalReason:(NSString *)str;
  67. - (NSString *)extendedHelpURI;
  68. - (void)setExtendedHelpURI:(NSString *)str;
  69. - (NSString *)sendReportURI;
  70. - (void)setSendReportURI:(NSString *)str;
  71. @end