UnknownFieldSet.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. @class PBCodedOutputStream;
  18. @class PBField;
  19. @class PBUnknownFieldSetBuilder;
  20. @interface PBUnknownFieldSet : NSObject {
  21. @private
  22. NSDictionary* fields;
  23. }
  24. @property (readonly, strong) NSDictionary* fields;
  25. //defaultInstance
  26. + (PBUnknownFieldSet*) defaultInstance;
  27. //设置field
  28. + (PBUnknownFieldSet*) setWithFields:(NSMutableDictionary*) fields;
  29. //设置data
  30. + (PBUnknownFieldSet*) parseFromData:(NSData*) data;
  31. //builder
  32. + (PBUnknownFieldSetBuilder*) builder;
  33. //设置UnknownFields with other
  34. + (PBUnknownFieldSetBuilder*) builderWithUnknownFields:(PBUnknownFieldSet*) other;
  35. //- (void) writeAsMessageSetTo:(PBCodedOutputStream*) output;
  36. - (void) writeToCodedOutputStream:(PBCodedOutputStream*) output;
  37. //该field的data
  38. - (NSData*) data;
  39. //该field的size
  40. - (SInt32) serializedSize;
  41. //- (SInt32) serializedSizeAsMessageSet;
  42. - (BOOL) hasField:(SInt32) number;
  43. //get Field with number
  44. - (PBField*) getField:(SInt32) number;
  45. //添加到des字符串
  46. - (void) writeDescriptionTo:(NSMutableString*) output
  47. withIndent:(NSString*) indent;
  48. //字典存储
  49. - (void) storeInDictionary: (NSMutableDictionary *) dic;
  50. @end