GeneratedMessage.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. // Protocol Buffers for Objective C
  2. //
  3. // Copyright 2010 Booyah Inc.
  4. // Copyright 2008 Cyrus Najmabadi
  5. //
  6. // Licensed under the Apache License, Version 2.0 (the "License");
  7. // you may not use this file except in compliance with the License.
  8. // You may obtain a copy of the License at
  9. //
  10. // http://www.apache.org/licenses/LICENSE-2.0
  11. //
  12. // Unless required by applicable law or agreed to in writing, software
  13. // distributed under the License is distributed on an "AS IS" BASIS,
  14. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. // See the License for the specific language governing permissions and
  16. // limitations under the License.
  17. #import "AbstractMessage.h"
  18. /**
  19. * All generated protocol message classes extend this class. This class
  20. * implements most of the Message and Builder interfaces using Java reflection.
  21. * Users can ignore this class and pretend that generated messages implement
  22. * the Message interface directly.
  23. *
  24. * @author Cyrus Najmabadi
  25. */
  26. @class PBExtensionRegistry;
  27. @class PBCodedInputStream;
  28. @protocol GeneratedMessageProtocol <PBMessage>
  29. /**
  30. * @brief 二进制pb数据转化为类
  31. *
  32. * @param data
  33. *
  34. * @return pb类
  35. */
  36. + (id<GeneratedMessageProtocol>) parseFromData:(NSData*) data;
  37. @optional
  38. /**
  39. * @brief 二进制pb数据转化为PB类
  40. *
  41. * @param input
  42. *
  43. * @return pb类
  44. */
  45. + (id<GeneratedMessageProtocol>) parseFromData:(NSData*) data extensionRegistry:(PBExtensionRegistry*)extensionRegistry;
  46. /**
  47. * @brief NSInputStream里面的数据转化为PB类
  48. *
  49. * @param input
  50. *
  51. * @return pb类
  52. */
  53. + (id<GeneratedMessageProtocol>) parseFromInputStream:(NSInputStream*) input;
  54. /**
  55. * @brief NSInputStream数据转化为类
  56. *
  57. * @param input
  58. *
  59. * @return pb类
  60. */
  61. + (id<GeneratedMessageProtocol>) parseFromInputStream:(NSInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry;
  62. /**
  63. * @brief PBCodedInputStream里面的数据转化为PB类
  64. *
  65. * @param input
  66. *
  67. * @return pb类
  68. */
  69. + (id<GeneratedMessageProtocol>) parseFromCodedInputStream:(PBCodedInputStream*) input;
  70. /**
  71. * @brief PBCodedInputStream数据转化为类
  72. *
  73. * @param input
  74. *
  75. * @return pb类
  76. */
  77. + (id<GeneratedMessageProtocol>) parseFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry;
  78. @end
  79. @interface PBGeneratedMessage : PBAbstractMessage {
  80. //@private
  81. PBUnknownFieldSet* unknownFields;
  82. @protected
  83. SInt32 memoizedSerializedSize;
  84. }
  85. @end