Field.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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 <Foundation/Foundation.h>
  18. @class PBArray;
  19. @class PBAppendableArray;
  20. @class PBCodedOutputStream;
  21. @interface PBField : NSObject
  22. {
  23. @protected
  24. PBAppendableArray * _varintArray;
  25. PBAppendableArray * _fixed32Array;
  26. PBAppendableArray * _fixed64Array;
  27. NSMutableArray * _lengthDelimitedArray;
  28. NSMutableArray * _groupArray;
  29. }
  30. @property (nonatomic,strong,readonly) PBArray * varintArray;
  31. @property (nonatomic,strong,readonly) PBArray * fixed32Array;
  32. @property (nonatomic,strong,readonly) PBArray * fixed64Array;
  33. @property (nonatomic,strong,readonly) NSArray * lengthDelimitedArray;
  34. @property (nonatomic,strong,readonly) NSArray * groupArray;
  35. //单例
  36. + (PBField *)defaultInstance;
  37. //SerializedSize
  38. - (SInt32)getSerializedSize:(SInt32)fieldNumber;
  39. //SerializedSize
  40. - (SInt32)getSerializedSizeAsMessageSetExtension:(SInt32)fieldNumber;
  41. //write to output stream
  42. - (void)writeTo:(SInt32) fieldNumber output:(PBCodedOutputStream *)output;
  43. //write Message
  44. - (void)writeAsMessageSetExtensionTo:(SInt32)fieldNumber output:(PBCodedOutputStream *)output;
  45. //write Description
  46. - (void)writeDescriptionFor:(SInt32) fieldNumber
  47. to:(NSMutableString*) output
  48. withIndent:(NSString*) indent;
  49. @end