1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233 |
- // Protocol Buffers - Google's data interchange format
- // Copyright 2008 Google Inc. All rights reserved.
- // https://developers.google.com/protocol-buffers/
- //
- // Redistribution and use in source and binary forms, with or without
- // modification, are permitted provided that the following conditions are
- // met:
- //
- // * Redistributions of source code must retain the above copyright
- // notice, this list of conditions and the following disclaimer.
- // * Redistributions in binary form must reproduce the above
- // copyright notice, this list of conditions and the following disclaimer
- // in the documentation and/or other materials provided with the
- // distribution.
- // * Neither the name of Google Inc. nor the names of its
- // contributors may be used to endorse or promote products derived from
- // this software without specific prior written permission.
- //
- // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- #import <Foundation/Foundation.h>
- #import "GPBTypes.h"
- // These classes are used for map fields of basic data types. They are used because
- // they perform better than boxing into NSNumbers in NSDictionaries.
- // Note: These are not meant to be subclassed.
- //%PDDM-EXPAND DECLARE_DICTIONARIES()
- // This block of code is generated, do not edit it directly.
- #pragma mark - UInt32 -> UInt32
- @interface GPBUInt32UInt32Dictionary : NSObject <NSCopying>
- @property(nonatomic, readonly) NSUInteger count;
- + (instancetype)dictionary;
- + (instancetype)dictionaryWithValue:(uint32_t)value
- forKey:(uint32_t)key;
- + (instancetype)dictionaryWithValues:(const uint32_t [])values
- forKeys:(const uint32_t [])keys
- count:(NSUInteger)count;
- + (instancetype)dictionaryWithDictionary:(GPBUInt32UInt32Dictionary *)dictionary;
- + (instancetype)dictionaryWithCapacity:(NSUInteger)numItems;
- - (instancetype)initWithValues:(const uint32_t [])values
- forKeys:(const uint32_t [])keys
- count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
- - (instancetype)initWithDictionary:(GPBUInt32UInt32Dictionary *)dictionary;
- - (instancetype)initWithCapacity:(NSUInteger)numItems;
- - (BOOL)valueForKey:(uint32_t)key value:(uint32_t *)value;
- - (void)enumerateKeysAndValuesUsingBlock:
- (void (^)(uint32_t key, uint32_t value, BOOL *stop))block;
- - (void)addEntriesFromDictionary:(GPBUInt32UInt32Dictionary *)otherDictionary;
- - (void)setValue:(uint32_t)value forKey:(uint32_t)key;
- - (void)removeValueForKey:(uint32_t)aKey;
- - (void)removeAll;
- @end
- #pragma mark - UInt32 -> Int32
- @interface GPBUInt32Int32Dictionary : NSObject <NSCopying>
- @property(nonatomic, readonly) NSUInteger count;
- + (instancetype)dictionary;
- + (instancetype)dictionaryWithValue:(int32_t)value
- forKey:(uint32_t)key;
- + (instancetype)dictionaryWithValues:(const int32_t [])values
- forKeys:(const uint32_t [])keys
- count:(NSUInteger)count;
- + (instancetype)dictionaryWithDictionary:(GPBUInt32Int32Dictionary *)dictionary;
- + (instancetype)dictionaryWithCapacity:(NSUInteger)numItems;
- - (instancetype)initWithValues:(const int32_t [])values
- forKeys:(const uint32_t [])keys
- count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
- - (instancetype)initWithDictionary:(GPBUInt32Int32Dictionary *)dictionary;
- - (instancetype)initWithCapacity:(NSUInteger)numItems;
- - (BOOL)valueForKey:(uint32_t)key value:(int32_t *)value;
- - (void)enumerateKeysAndValuesUsingBlock:
- (void (^)(uint32_t key, int32_t value, BOOL *stop))block;
- - (void)addEntriesFromDictionary:(GPBUInt32Int32Dictionary *)otherDictionary;
- - (void)setValue:(int32_t)value forKey:(uint32_t)key;
- - (void)removeValueForKey:(uint32_t)aKey;
- - (void)removeAll;
- @end
- #pragma mark - UInt32 -> UInt64
- @interface GPBUInt32UInt64Dictionary : NSObject <NSCopying>
- @property(nonatomic, readonly) NSUInteger count;
- + (instancetype)dictionary;
- + (instancetype)dictionaryWithValue:(uint64_t)value
- forKey:(uint32_t)key;
- + (instancetype)dictionaryWithValues:(const uint64_t [])values
- forKeys:(const uint32_t [])keys
- count:(NSUInteger)count;
- + (instancetype)dictionaryWithDictionary:(GPBUInt32UInt64Dictionary *)dictionary;
- + (instancetype)dictionaryWithCapacity:(NSUInteger)numItems;
- - (instancetype)initWithValues:(const uint64_t [])values
- forKeys:(const uint32_t [])keys
- count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
- - (instancetype)initWithDictionary:(GPBUInt32UInt64Dictionary *)dictionary;
- - (instancetype)initWithCapacity:(NSUInteger)numItems;
- - (BOOL)valueForKey:(uint32_t)key value:(uint64_t *)value;
- - (void)enumerateKeysAndValuesUsingBlock:
- (void (^)(uint32_t key, uint64_t value, BOOL *stop))block;
- - (void)addEntriesFromDictionary:(GPBUInt32UInt64Dictionary *)otherDictionary;
- - (void)setValue:(uint64_t)value forKey:(uint32_t)key;
- - (void)removeValueForKey:(uint32_t)aKey;
- - (void)removeAll;
- @end
- #pragma mark - UInt32 -> Int64
- @interface GPBUInt32Int64Dictionary : NSObject <NSCopying>
- @property(nonatomic, readonly) NSUInteger count;
- + (instancetype)dictionary;
- + (instancetype)dictionaryWithValue:(int64_t)value
- forKey:(uint32_t)key;
- + (instancetype)dictionaryWithValues:(const int64_t [])values
- forKeys:(const uint32_t [])keys
- count:(NSUInteger)count;
- + (instancetype)dictionaryWithDictionary:(GPBUInt32Int64Dictionary *)dictionary;
- + (instancetype)dictionaryWithCapacity:(NSUInteger)numItems;
- - (instancetype)initWithValues:(const int64_t [])values
- forKeys:(const uint32_t [])keys
- count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
- - (instancetype)initWithDictionary:(GPBUInt32Int64Dictionary *)dictionary;
- - (instancetype)initWithCapacity:(NSUInteger)numItems;
- - (BOOL)valueForKey:(uint32_t)key value:(int64_t *)value;
- - (void)enumerateKeysAndValuesUsingBlock:
- (void (^)(uint32_t key, int64_t value, BOOL *stop))block;
- - (void)addEntriesFromDictionary:(GPBUInt32Int64Dictionary *)otherDictionary;
- - (void)setValue:(int64_t)value forKey:(uint32_t)key;
- - (void)removeValueForKey:(uint32_t)aKey;
- - (void)removeAll;
- @end
- #pragma mark - UInt32 -> Bool
- @interface GPBUInt32BoolDictionary : NSObject <NSCopying>
- @property(nonatomic, readonly) NSUInteger count;
- + (instancetype)dictionary;
- + (instancetype)dictionaryWithValue:(BOOL)value
- forKey:(uint32_t)key;
- + (instancetype)dictionaryWithValues:(const BOOL [])values
- forKeys:(const uint32_t [])keys
- count:(NSUInteger)count;
- + (instancetype)dictionaryWithDictionary:(GPBUInt32BoolDictionary *)dictionary;
- + (instancetype)dictionaryWithCapacity:(NSUInteger)numItems;
- - (instancetype)initWithValues:(const BOOL [])values
- forKeys:(const uint32_t [])keys
- count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
- - (instancetype)initWithDictionary:(GPBUInt32BoolDictionary *)dictionary;
- - (instancetype)initWithCapacity:(NSUInteger)numItems;
- - (BOOL)valueForKey:(uint32_t)key value:(BOOL *)value;
- - (void)enumerateKeysAndValuesUsingBlock:
- (void (^)(uint32_t key, BOOL value, BOOL *stop))block;
- - (void)addEntriesFromDictionary:(GPBUInt32BoolDictionary *)otherDictionary;
- - (void)setValue:(BOOL)value forKey:(uint32_t)key;
- - (void)removeValueForKey:(uint32_t)aKey;
- - (void)removeAll;
- @end
- #pragma mark - UInt32 -> Float
- @interface GPBUInt32FloatDictionary : NSObject <NSCopying>
- @property(nonatomic, readonly) NSUInteger count;
- + (instancetype)dictionary;
- + (instancetype)dictionaryWithValue:(float)value
- forKey:(uint32_t)key;
- + (instancetype)dictionaryWithValues:(const float [])values
- forKeys:(const uint32_t [])keys
- count:(NSUInteger)count;
- + (instancetype)dictionaryWithDictionary:(GPBUInt32FloatDictionary *)dictionary;
- + (instancetype)dictionaryWithCapacity:(NSUInteger)numItems;
- - (instancetype)initWithValues:(const float [])values
- forKeys:(const uint32_t [])keys
- count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
- - (instancetype)initWithDictionary:(GPBUInt32FloatDictionary *)dictionary;
- - (instancetype)initWithCapacity:(NSUInteger)numItems;
- - (BOOL)valueForKey:(uint32_t)key value:(float *)value;
- - (void)enumerateKeysAndValuesUsingBlock:
- (void (^)(uint32_t key, float value, BOOL *stop))block;
- - (void)addEntriesFromDictionary:(GPBUInt32FloatDictionary *)otherDictionary;
- - (void)setValue:(float)value forKey:(uint32_t)key;
- - (void)removeValueForKey:(uint32_t)aKey;
- - (void)removeAll;
- @end
- #pragma mark - UInt32 -> Double
- @interface GPBUInt32DoubleDictionary : NSObject <NSCopying>
- @property(nonatomic, readonly) NSUInteger count;
- + (instancetype)dictionary;
- + (instancetype)dictionaryWithValue:(double)value
- forKey:(uint32_t)key;
- + (instancetype)dictionaryWithValues:(const double [])values
- forKeys:(const uint32_t [])keys
- count:(NSUInteger)count;
- + (instancetype)dictionaryWithDictionary:(GPBUInt32DoubleDictionary *)dictionary;
- + (instancetype)dictionaryWithCapacity:(NSUInteger)numItems;
- - (instancetype)initWithValues:(const double [])values
- forKeys:(const uint32_t [])keys
- count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
- - (instancetype)initWithDictionary:(GPBUInt32DoubleDictionary *)dictionary;
- - (instancetype)initWithCapacity:(NSUInteger)numItems;
- - (BOOL)valueForKey:(uint32_t)key value:(double *)value;
- - (void)enumerateKeysAndValuesUsingBlock:
- (void (^)(uint32_t key, double value, BOOL *stop))block;
- - (void)addEntriesFromDictionary:(GPBUInt32DoubleDictionary *)otherDictionary;
- - (void)setValue:(double)value forKey:(uint32_t)key;
- - (void)removeValueForKey:(uint32_t)aKey;
- - (void)removeAll;
- @end
- #pragma mark - UInt32 -> Enum
- @interface GPBUInt32EnumDictionary : NSObject <NSCopying>
- @property(nonatomic, readonly) NSUInteger count;
- @property(nonatomic, readonly) GPBEnumValidationFunc validationFunc;
- + (instancetype)dictionary;
- + (instancetype)dictionaryWithValidationFunction:(GPBEnumValidationFunc)func;
- + (instancetype)dictionaryWithValidationFunction:(GPBEnumValidationFunc)func
- rawValue:(int32_t)rawValue
- forKey:(uint32_t)key;
- + (instancetype)dictionaryWithValidationFunction:(GPBEnumValidationFunc)func
- rawValues:(const int32_t [])values
- forKeys:(const uint32_t [])keys
- count:(NSUInteger)count;
- + (instancetype)dictionaryWithDictionary:(GPBUInt32EnumDictionary *)dictionary;
- + (instancetype)dictionaryWithValidationFunction:(GPBEnumValidationFunc)func
- capacity:(NSUInteger)numItems;
- - (instancetype)initWithValidationFunction:(GPBEnumValidationFunc)func;
- - (instancetype)initWithValidationFunction:(GPBEnumValidationFunc)func
- rawValues:(const int32_t [])values
- forKeys:(const uint32_t [])keys
- count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
- - (instancetype)initWithDictionary:(GPBUInt32EnumDictionary *)dictionary;
- - (instancetype)initWithValidationFunction:(GPBEnumValidationFunc)func
- capacity:(NSUInteger)numItems;
- // These will return kGPBUnrecognizedEnumeratorValue if the value for the key
- // is not a valid enumerator as defined by validationFunc. If the actual value is
- // desired, use "raw" version of the method.
- - (BOOL)valueForKey:(uint32_t)key value:(int32_t *)value;
- - (void)enumerateKeysAndValuesUsingBlock:
- (void (^)(uint32_t key, int32_t value, BOOL *stop))block;
- // These methods bypass the validationFunc to provide access to values that were not
- // known at the time the binary was compiled.
- - (BOOL)valueForKey:(uint32_t)key rawValue:(int32_t *)rawValue;
- - (void)enumerateKeysAndRawValuesUsingBlock:
- (void (^)(uint32_t key, int32_t rawValue, BOOL *stop))block;
- - (void)addRawEntriesFromDictionary:(GPBUInt32EnumDictionary *)otherDictionary;
- // If value is not a valid enumerator as defined by validationFunc, these
- // methods will assert in debug, and will log in release and assign the value
- // to the default value. Use the rawValue methods below to assign non enumerator
- // values.
- - (void)setValue:(int32_t)value forKey:(uint32_t)key;
- // This method bypass the validationFunc to provide setting of values that were not
- // known at the time the binary was compiled.
- - (void)setRawValue:(int32_t)rawValue forKey:(uint32_t)key;
- // No validation applies to these methods.
- - (void)removeValueForKey:(uint32_t)aKey;
- - (void)removeAll;
- @end
- #pragma mark - UInt32 -> Object
- @interface GPBUInt32ObjectDictionary : NSObject <NSCopying>
- @property(nonatomic, readonly) NSUInteger count;
- + (instancetype)dictionary;
- + (instancetype)dictionaryWithValue:(id)value
- forKey:(uint32_t)key;
- + (instancetype)dictionaryWithValues:(const id GPB_UNSAFE_UNRETAINED [])values
- forKeys:(const uint32_t [])keys
- count:(NSUInteger)count;
- + (instancetype)dictionaryWithDictionary:(GPBUInt32ObjectDictionary *)dictionary;
- + (instancetype)dictionaryWithCapacity:(NSUInteger)numItems;
- - (instancetype)initWithValues:(const id GPB_UNSAFE_UNRETAINED [])values
- forKeys:(const uint32_t [])keys
- count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
- - (instancetype)initWithDictionary:(GPBUInt32ObjectDictionary *)dictionary;
- - (instancetype)initWithCapacity:(NSUInteger)numItems;
- - (id)valueForKey:(uint32_t)key;
- - (void)enumerateKeysAndValuesUsingBlock:
- (void (^)(uint32_t key, id value, BOOL *stop))block;
- - (void)addEntriesFromDictionary:(GPBUInt32ObjectDictionary *)otherDictionary;
- - (void)setValue:(id)value forKey:(uint32_t)key;
- - (void)removeValueForKey:(uint32_t)aKey;
- - (void)removeAll;
- @end
- #pragma mark - Int32 -> UInt32
- @interface GPBInt32UInt32Dictionary : NSObject <NSCopying>
- @property(nonatomic, readonly) NSUInteger count;
- + (instancetype)dictionary;
- + (instancetype)dictionaryWithValue:(uint32_t)value
- forKey:(int32_t)key;
- + (instancetype)dictionaryWithValues:(const uint32_t [])values
- forKeys:(const int32_t [])keys
- count:(NSUInteger)count;
- + (instancetype)dictionaryWithDictionary:(GPBInt32UInt32Dictionary *)dictionary;
- + (instancetype)dictionaryWithCapacity:(NSUInteger)numItems;
- - (instancetype)initWithValues:(const uint32_t [])values
- forKeys:(const int32_t [])keys
- count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
- - (instancetype)initWithDictionary:(GPBInt32UInt32Dictionary *)dictionary;
- - (instancetype)initWithCapacity:(NSUInteger)numItems;
- - (BOOL)valueForKey:(int32_t)key value:(uint32_t *)value;
- - (void)enumerateKeysAndValuesUsingBlock:
- (void (^)(int32_t key, uint32_t value, BOOL *stop))block;
- - (void)addEntriesFromDictionary:(GPBInt32UInt32Dictionary *)otherDictionary;
- - (void)setValue:(uint32_t)value forKey:(int32_t)key;
- - (void)removeValueForKey:(int32_t)aKey;
- - (void)removeAll;
- @end
- #pragma mark - Int32 -> Int32
- @interface GPBInt32Int32Dictionary : NSObject <NSCopying>
- @property(nonatomic, readonly) NSUInteger count;
- + (instancetype)dictionary;
- + (instancetype)dictionaryWithValue:(int32_t)value
- forKey:(int32_t)key;
- + (instancetype)dictionaryWithValues:(const int32_t [])values
- forKeys:(const int32_t [])keys
- count:(NSUInteger)count;
- + (instancetype)dictionaryWithDictionary:(GPBInt32Int32Dictionary *)dictionary;
- + (instancetype)dictionaryWithCapacity:(NSUInteger)numItems;
- - (instancetype)initWithValues:(const int32_t [])values
- forKeys:(const int32_t [])keys
- count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
- - (instancetype)initWithDictionary:(GPBInt32Int32Dictionary *)dictionary;
- - (instancetype)initWithCapacity:(NSUInteger)numItems;
- - (BOOL)valueForKey:(int32_t)key value:(int32_t *)value;
- - (void)enumerateKeysAndValuesUsingBlock:
- (void (^)(int32_t key, int32_t value, BOOL *stop))block;
- - (void)addEntriesFromDictionary:(GPBInt32Int32Dictionary *)otherDictionary;
- - (void)setValue:(int32_t)value forKey:(int32_t)key;
- - (void)removeValueForKey:(int32_t)aKey;
- - (void)removeAll;
- @end
- #pragma mark - Int32 -> UInt64
- @interface GPBInt32UInt64Dictionary : NSObject <NSCopying>
- @property(nonatomic, readonly) NSUInteger count;
- + (instancetype)dictionary;
- + (instancetype)dictionaryWithValue:(uint64_t)value
- forKey:(int32_t)key;
- + (instancetype)dictionaryWithValues:(const uint64_t [])values
- forKeys:(const int32_t [])keys
- count:(NSUInteger)count;
- + (instancetype)dictionaryWithDictionary:(GPBInt32UInt64Dictionary *)dictionary;
- + (instancetype)dictionaryWithCapacity:(NSUInteger)numItems;
- - (instancetype)initWithValues:(const uint64_t [])values
- forKeys:(const int32_t [])keys
- count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
- - (instancetype)initWithDictionary:(GPBInt32UInt64Dictionary *)dictionary;
- - (instancetype)initWithCapacity:(NSUInteger)numItems;
- - (BOOL)valueForKey:(int32_t)key value:(uint64_t *)value;
- - (void)enumerateKeysAndValuesUsingBlock:
- (void (^)(int32_t key, uint64_t value, BOOL *stop))block;
- - (void)addEntriesFromDictionary:(GPBInt32UInt64Dictionary *)otherDictionary;
- - (void)setValue:(uint64_t)value forKey:(int32_t)key;
- - (void)removeValueForKey:(int32_t)aKey;
- - (void)removeAll;
- @end
- #pragma mark - Int32 -> Int64
- @interface GPBInt32Int64Dictionary : NSObject <NSCopying>
- @property(nonatomic, readonly) NSUInteger count;
- + (instancetype)dictionary;
- + (instancetype)dictionaryWithValue:(int64_t)value
- forKey:(int32_t)key;
- + (instancetype)dictionaryWithValues:(const int64_t [])values
- forKeys:(const int32_t [])keys
- count:(NSUInteger)count;
- + (instancetype)dictionaryWithDictionary:(GPBInt32Int64Dictionary *)dictionary;
- + (instancetype)dictionaryWithCapacity:(NSUInteger)numItems;
- - (instancetype)initWithValues:(const int64_t [])values
- forKeys:(const int32_t [])keys
- count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
- - (instancetype)initWithDictionary:(GPBInt32Int64Dictionary *)dictionary;
- - (instancetype)initWithCapacity:(NSUInteger)numItems;
- - (BOOL)valueForKey:(int32_t)key value:(int64_t *)value;
- - (void)enumerateKeysAndValuesUsingBlock:
- (void (^)(int32_t key, int64_t value, BOOL *stop))block;
- - (void)addEntriesFromDictionary:(GPBInt32Int64Dictionary *)otherDictionary;
- - (void)setValue:(int64_t)value forKey:(int32_t)key;
- - (void)removeValueForKey:(int32_t)aKey;
- - (void)removeAll;
- @end
- #pragma mark - Int32 -> Bool
- @interface GPBInt32BoolDictionary : NSObject <NSCopying>
- @property(nonatomic, readonly) NSUInteger count;
- + (instancetype)dictionary;
- + (instancetype)dictionaryWithValue:(BOOL)value
- forKey:(int32_t)key;
- + (instancetype)dictionaryWithValues:(const BOOL [])values
- forKeys:(const int32_t [])keys
- count:(NSUInteger)count;
- + (instancetype)dictionaryWithDictionary:(GPBInt32BoolDictionary *)dictionary;
- + (instancetype)dictionaryWithCapacity:(NSUInteger)numItems;
- - (instancetype)initWithValues:(const BOOL [])values
- forKeys:(const int32_t [])keys
- count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
- - (instancetype)initWithDictionary:(GPBInt32BoolDictionary *)dictionary;
- - (instancetype)initWithCapacity:(NSUInteger)numItems;
- - (BOOL)valueForKey:(int32_t)key value:(BOOL *)value;
- - (void)enumerateKeysAndValuesUsingBlock:
- (void (^)(int32_t key, BOOL value, BOOL *stop))block;
- - (void)addEntriesFromDictionary:(GPBInt32BoolDictionary *)otherDictionary;
- - (void)setValue:(BOOL)value forKey:(int32_t)key;
- - (void)removeValueForKey:(int32_t)aKey;
- - (void)removeAll;
- @end
- #pragma mark - Int32 -> Float
- @interface GPBInt32FloatDictionary : NSObject <NSCopying>
- @property(nonatomic, readonly) NSUInteger count;
- + (instancetype)dictionary;
- + (instancetype)dictionaryWithValue:(float)value
- forKey:(int32_t)key;
- + (instancetype)dictionaryWithValues:(const float [])values
- forKeys:(const int32_t [])keys
- count:(NSUInteger)count;
- + (instancetype)dictionaryWithDictionary:(GPBInt32FloatDictionary *)dictionary;
- + (instancetype)dictionaryWithCapacity:(NSUInteger)numItems;
- - (instancetype)initWithValues:(const float [])values
- forKeys:(const int32_t [])keys
- count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
- - (instancetype)initWithDictionary:(GPBInt32FloatDictionary *)dictionary;
- - (instancetype)initWithCapacity:(NSUInteger)numItems;
- - (BOOL)valueForKey:(int32_t)key value:(float *)value;
- - (void)enumerateKeysAndValuesUsingBlock:
- (void (^)(int32_t key, float value, BOOL *stop))block;
- - (void)addEntriesFromDictionary:(GPBInt32FloatDictionary *)otherDictionary;
- - (void)setValue:(float)value forKey:(int32_t)key;
- - (void)removeValueForKey:(int32_t)aKey;
- - (void)removeAll;
- @end
- #pragma mark - Int32 -> Double
- @interface GPBInt32DoubleDictionary : NSObject <NSCopying>
- @property(nonatomic, readonly) NSUInteger count;
- + (instancetype)dictionary;
- + (instancetype)dictionaryWithValue:(double)value
- forKey:(int32_t)key;
- + (instancetype)dictionaryWithValues:(const double [])values
- forKeys:(const int32_t [])keys
- count:(NSUInteger)count;
- + (instancetype)dictionaryWithDictionary:(GPBInt32DoubleDictionary *)dictionary;
- + (instancetype)dictionaryWithCapacity:(NSUInteger)numItems;
- - (instancetype)initWithValues:(const double [])values
- forKeys:(const int32_t [])keys
- count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
- - (instancetype)initWithDictionary:(GPBInt32DoubleDictionary *)dictionary;
- - (instancetype)initWithCapacity:(NSUInteger)numItems;
- - (BOOL)valueForKey:(int32_t)key value:(double *)value;
- - (void)enumerateKeysAndValuesUsingBlock:
- (void (^)(int32_t key, double value, BOOL *stop))block;
- - (void)addEntriesFromDictionary:(GPBInt32DoubleDictionary *)otherDictionary;
- - (void)setValue:(double)value forKey:(int32_t)key;
- - (void)removeValueForKey:(int32_t)aKey;
- - (void)removeAll;
- @end
- #pragma mark - Int32 -> Enum
- @interface GPBInt32EnumDictionary : NSObject <NSCopying>
- @property(nonatomic, readonly) NSUInteger count;
- @property(nonatomic, readonly) GPBEnumValidationFunc validationFunc;
- + (instancetype)dictionary;
- + (instancetype)dictionaryWithValidationFunction:(GPBEnumValidationFunc)func;
- + (instancetype)dictionaryWithValidationFunction:(GPBEnumValidationFunc)func
- rawValue:(int32_t)rawValue
- forKey:(int32_t)key;
- + (instancetype)dictionaryWithValidationFunction:(GPBEnumValidationFunc)func
- rawValues:(const int32_t [])values
- forKeys:(const int32_t [])keys
- count:(NSUInteger)count;
- + (instancetype)dictionaryWithDictionary:(GPBInt32EnumDictionary *)dictionary;
- + (instancetype)dictionaryWithValidationFunction:(GPBEnumValidationFunc)func
- capacity:(NSUInteger)numItems;
- - (instancetype)initWithValidationFunction:(GPBEnumValidationFunc)func;
- - (instancetype)initWithValidationFunction:(GPBEnumValidationFunc)func
- rawValues:(const int32_t [])values
- forKeys:(const int32_t [])keys
- count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
- - (instancetype)initWithDictionary:(GPBInt32EnumDictionary *)dictionary;
- - (instancetype)initWithValidationFunction:(GPBEnumValidationFunc)func
- capacity:(NSUInteger)numItems;
- // These will return kGPBUnrecognizedEnumeratorValue if the value for the key
- // is not a valid enumerator as defined by validationFunc. If the actual value is
- // desired, use "raw" version of the method.
- - (BOOL)valueForKey:(int32_t)key value:(int32_t *)value;
- - (void)enumerateKeysAndValuesUsingBlock:
- (void (^)(int32_t key, int32_t value, BOOL *stop))block;
- // These methods bypass the validationFunc to provide access to values that were not
- // known at the time the binary was compiled.
- - (BOOL)valueForKey:(int32_t)key rawValue:(int32_t *)rawValue;
- - (void)enumerateKeysAndRawValuesUsingBlock:
- (void (^)(int32_t key, int32_t rawValue, BOOL *stop))block;
- - (void)addRawEntriesFromDictionary:(GPBInt32EnumDictionary *)otherDictionary;
- // If value is not a valid enumerator as defined by validationFunc, these
- // methods will assert in debug, and will log in release and assign the value
- // to the default value. Use the rawValue methods below to assign non enumerator
- // values.
- - (void)setValue:(int32_t)value forKey:(int32_t)key;
- // This method bypass the validationFunc to provide setting of values that were not
- // known at the time the binary was compiled.
- - (void)setRawValue:(int32_t)rawValue forKey:(int32_t)key;
- // No validation applies to these methods.
- - (void)removeValueForKey:(int32_t)aKey;
- - (void)removeAll;
- @end
- #pragma mark - Int32 -> Object
- @interface GPBInt32ObjectDictionary : NSObject <NSCopying>
- @property(nonatomic, readonly) NSUInteger count;
- + (instancetype)dictionary;
- + (instancetype)dictionaryWithValue:(id)value
- forKey:(int32_t)key;
- + (instancetype)dictionaryWithValues:(const id GPB_UNSAFE_UNRETAINED [])values
- forKeys:(const int32_t [])keys
- count:(NSUInteger)count;
- + (instancetype)dictionaryWithDictionary:(GPBInt32ObjectDictionary *)dictionary;
- + (instancetype)dictionaryWithCapacity:(NSUInteger)numItems;
- - (instancetype)initWithValues:(const id GPB_UNSAFE_UNRETAINED [])values
- forKeys:(const int32_t [])keys
- count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
- - (instancetype)initWithDictionary:(GPBInt32ObjectDictionary *)dictionary;
- - (instancetype)initWithCapacity:(NSUInteger)numItems;
- - (id)valueForKey:(int32_t)key;
- - (void)enumerateKeysAndValuesUsingBlock:
- (void (^)(int32_t key, id value, BOOL *stop))block;
- - (void)addEntriesFromDictionary:(GPBInt32ObjectDictionary *)otherDictionary;
- - (void)setValue:(id)value forKey:(int32_t)key;
- - (void)removeValueForKey:(int32_t)aKey;
- - (void)removeAll;
- @end
- #pragma mark - UInt64 -> UInt32
- @interface GPBUInt64UInt32Dictionary : NSObject <NSCopying>
- @property(nonatomic, readonly) NSUInteger count;
- + (instancetype)dictionary;
- + (instancetype)dictionaryWithValue:(uint32_t)value
- forKey:(uint64_t)key;
- + (instancetype)dictionaryWithValues:(const uint32_t [])values
- forKeys:(const uint64_t [])keys
- count:(NSUInteger)count;
- + (instancetype)dictionaryWithDictionary:(GPBUInt64UInt32Dictionary *)dictionary;
- + (instancetype)dictionaryWithCapacity:(NSUInteger)numItems;
- - (instancetype)initWithValues:(const uint32_t [])values
- forKeys:(const uint64_t [])keys
- count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
- - (instancetype)initWithDictionary:(GPBUInt64UInt32Dictionary *)dictionary;
- - (instancetype)initWithCapacity:(NSUInteger)numItems;
- - (BOOL)valueForKey:(uint64_t)key value:(uint32_t *)value;
- - (void)enumerateKeysAndValuesUsingBlock:
- (void (^)(uint64_t key, uint32_t value, BOOL *stop))block;
- - (void)addEntriesFromDictionary:(GPBUInt64UInt32Dictionary *)otherDictionary;
- - (void)setValue:(uint32_t)value forKey:(uint64_t)key;
- - (void)removeValueForKey:(uint64_t)aKey;
- - (void)removeAll;
- @end
- #pragma mark - UInt64 -> Int32
- @interface GPBUInt64Int32Dictionary : NSObject <NSCopying>
- @property(nonatomic, readonly) NSUInteger count;
- + (instancetype)dictionary;
- + (instancetype)dictionaryWithValue:(int32_t)value
- forKey:(uint64_t)key;
- + (instancetype)dictionaryWithValues:(const int32_t [])values
- forKeys:(const uint64_t [])keys
- count:(NSUInteger)count;
- + (instancetype)dictionaryWithDictionary:(GPBUInt64Int32Dictionary *)dictionary;
- + (instancetype)dictionaryWithCapacity:(NSUInteger)numItems;
- - (instancetype)initWithValues:(const int32_t [])values
- forKeys:(const uint64_t [])keys
- count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
- - (instancetype)initWithDictionary:(GPBUInt64Int32Dictionary *)dictionary;
- - (instancetype)initWithCapacity:(NSUInteger)numItems;
- - (BOOL)valueForKey:(uint64_t)key value:(int32_t *)value;
- - (void)enumerateKeysAndValuesUsingBlock:
- (void (^)(uint64_t key, int32_t value, BOOL *stop))block;
- - (void)addEntriesFromDictionary:(GPBUInt64Int32Dictionary *)otherDictionary;
- - (void)setValue:(int32_t)value forKey:(uint64_t)key;
- - (void)removeValueForKey:(uint64_t)aKey;
- - (void)removeAll;
- @end
- #pragma mark - UInt64 -> UInt64
- @interface GPBUInt64UInt64Dictionary : NSObject <NSCopying>
- @property(nonatomic, readonly) NSUInteger count;
- + (instancetype)dictionary;
- + (instancetype)dictionaryWithValue:(uint64_t)value
- forKey:(uint64_t)key;
- + (instancetype)dictionaryWithValues:(const uint64_t [])values
- forKeys:(const uint64_t [])keys
- count:(NSUInteger)count;
- + (instancetype)dictionaryWithDictionary:(GPBUInt64UInt64Dictionary *)dictionary;
- + (instancetype)dictionaryWithCapacity:(NSUInteger)numItems;
- - (instancetype)initWithValues:(const uint64_t [])values
- forKeys:(const uint64_t [])keys
- count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
- - (instancetype)initWithDictionary:(GPBUInt64UInt64Dictionary *)dictionary;
- - (instancetype)initWithCapacity:(NSUInteger)numItems;
- - (BOOL)valueForKey:(uint64_t)key value:(uint64_t *)value;
- - (void)enumerateKeysAndValuesUsingBlock:
- (void (^)(uint64_t key, uint64_t value, BOOL *stop))block;
- - (void)addEntriesFromDictionary:(GPBUInt64UInt64Dictionary *)otherDictionary;
- - (void)setValue:(uint64_t)value forKey:(uint64_t)key;
- - (void)removeValueForKey:(uint64_t)aKey;
- - (void)removeAll;
- @end
- #pragma mark - UInt64 -> Int64
- @interface GPBUInt64Int64Dictionary : NSObject <NSCopying>
- @property(nonatomic, readonly) NSUInteger count;
- + (instancetype)dictionary;
- + (instancetype)dictionaryWithValue:(int64_t)value
- forKey:(uint64_t)key;
- + (instancetype)dictionaryWithValues:(const int64_t [])values
- forKeys:(const uint64_t [])keys
- count:(NSUInteger)count;
- + (instancetype)dictionaryWithDictionary:(GPBUInt64Int64Dictionary *)dictionary;
- + (instancetype)dictionaryWithCapacity:(NSUInteger)numItems;
- - (instancetype)initWithValues:(const int64_t [])values
- forKeys:(const uint64_t [])keys
- count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
- - (instancetype)initWithDictionary:(GPBUInt64Int64Dictionary *)dictionary;
- - (instancetype)initWithCapacity:(NSUInteger)numItems;
- - (BOOL)valueForKey:(uint64_t)key value:(int64_t *)value;
- - (void)enumerateKeysAndValuesUsingBlock:
- (void (^)(uint64_t key, int64_t value, BOOL *stop))block;
- - (void)addEntriesFromDictionary:(GPBUInt64Int64Dictionary *)otherDictionary;
- - (void)setValue:(int64_t)value forKey:(uint64_t)key;
- - (void)removeValueForKey:(uint64_t)aKey;
- - (void)removeAll;
- @end
- #pragma mark - UInt64 -> Bool
- @interface GPBUInt64BoolDictionary : NSObject <NSCopying>
- @property(nonatomic, readonly) NSUInteger count;
- + (instancetype)dictionary;
- + (instancetype)dictionaryWithValue:(BOOL)value
- forKey:(uint64_t)key;
- + (instancetype)dictionaryWithValues:(const BOOL [])values
- forKeys:(const uint64_t [])keys
- count:(NSUInteger)count;
- + (instancetype)dictionaryWithDictionary:(GPBUInt64BoolDictionary *)dictionary;
- + (instancetype)dictionaryWithCapacity:(NSUInteger)numItems;
- - (instancetype)initWithValues:(const BOOL [])values
- forKeys:(const uint64_t [])keys
- count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
- - (instancetype)initWithDictionary:(GPBUInt64BoolDictionary *)dictionary;
- - (instancetype)initWithCapacity:(NSUInteger)numItems;
- - (BOOL)valueForKey:(uint64_t)key value:(BOOL *)value;
- - (void)enumerateKeysAndValuesUsingBlock:
- (void (^)(uint64_t key, BOOL value, BOOL *stop))block;
- - (void)addEntriesFromDictionary:(GPBUInt64BoolDictionary *)otherDictionary;
- - (void)setValue:(BOOL)value forKey:(uint64_t)key;
- - (void)removeValueForKey:(uint64_t)aKey;
- - (void)removeAll;
- @end
- #pragma mark - UInt64 -> Float
- @interface GPBUInt64FloatDictionary : NSObject <NSCopying>
- @property(nonatomic, readonly) NSUInteger count;
- + (instancetype)dictionary;
- + (instancetype)dictionaryWithValue:(float)value
- forKey:(uint64_t)key;
- + (instancetype)dictionaryWithValues:(const float [])values
- forKeys:(const uint64_t [])keys
- count:(NSUInteger)count;
- + (instancetype)dictionaryWithDictionary:(GPBUInt64FloatDictionary *)dictionary;
- + (instancetype)dictionaryWithCapacity:(NSUInteger)numItems;
- - (instancetype)initWithValues:(const float [])values
- forKeys:(const uint64_t [])keys
- count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
- - (instancetype)initWithDictionary:(GPBUInt64FloatDictionary *)dictionary;
- - (instancetype)initWithCapacity:(NSUInteger)numItems;
- - (BOOL)valueForKey:(uint64_t)key value:(float *)value;
- - (void)enumerateKeysAndValuesUsingBlock:
- (void (^)(uint64_t key, float value, BOOL *stop))block;
- - (void)addEntriesFromDictionary:(GPBUInt64FloatDictionary *)otherDictionary;
- - (void)setValue:(float)value forKey:(uint64_t)key;
- - (void)removeValueForKey:(uint64_t)aKey;
- - (void)removeAll;
- @end
- #pragma mark - UInt64 -> Double
- @interface GPBUInt64DoubleDictionary : NSObject <NSCopying>
- @property(nonatomic, readonly) NSUInteger count;
- + (instancetype)dictionary;
- + (instancetype)dictionaryWithValue:(double)value
- forKey:(uint64_t)key;
- + (instancetype)dictionaryWithValues:(const double [])values
- forKeys:(const uint64_t [])keys
- count:(NSUInteger)count;
- + (instancetype)dictionaryWithDictionary:(GPBUInt64DoubleDictionary *)dictionary;
- + (instancetype)dictionaryWithCapacity:(NSUInteger)numItems;
- - (instancetype)initWithValues:(const double [])values
- forKeys:(const uint64_t [])keys
- count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
- - (instancetype)initWithDictionary:(GPBUInt64DoubleDictionary *)dictionary;
- - (instancetype)initWithCapacity:(NSUInteger)numItems;
- - (BOOL)valueForKey:(uint64_t)key value:(double *)value;
- - (void)enumerateKeysAndValuesUsingBlock:
- (void (^)(uint64_t key, double value, BOOL *stop))block;
- - (void)addEntriesFromDictionary:(GPBUInt64DoubleDictionary *)otherDictionary;
- - (void)setValue:(double)value forKey:(uint64_t)key;
- - (void)removeValueForKey:(uint64_t)aKey;
- - (void)removeAll;
- @end
- #pragma mark - UInt64 -> Enum
- @interface GPBUInt64EnumDictionary : NSObject <NSCopying>
- @property(nonatomic, readonly) NSUInteger count;
- @property(nonatomic, readonly) GPBEnumValidationFunc validationFunc;
- + (instancetype)dictionary;
- + (instancetype)dictionaryWithValidationFunction:(GPBEnumValidationFunc)func;
- + (instancetype)dictionaryWithValidationFunction:(GPBEnumValidationFunc)func
- rawValue:(int32_t)rawValue
- forKey:(uint64_t)key;
- + (instancetype)dictionaryWithValidationFunction:(GPBEnumValidationFunc)func
- rawValues:(const int32_t [])values
- forKeys:(const uint64_t [])keys
- count:(NSUInteger)count;
- + (instancetype)dictionaryWithDictionary:(GPBUInt64EnumDictionary *)dictionary;
- + (instancetype)dictionaryWithValidationFunction:(GPBEnumValidationFunc)func
- capacity:(NSUInteger)numItems;
- - (instancetype)initWithValidationFunction:(GPBEnumValidationFunc)func;
- - (instancetype)initWithValidationFunction:(GPBEnumValidationFunc)func
- rawValues:(const int32_t [])values
- forKeys:(const uint64_t [])keys
- count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
- - (instancetype)initWithDictionary:(GPBUInt64EnumDictionary *)dictionary;
- - (instancetype)initWithValidationFunction:(GPBEnumValidationFunc)func
- capacity:(NSUInteger)numItems;
- // These will return kGPBUnrecognizedEnumeratorValue if the value for the key
- // is not a valid enumerator as defined by validationFunc. If the actual value is
- // desired, use "raw" version of the method.
- - (BOOL)valueForKey:(uint64_t)key value:(int32_t *)value;
- - (void)enumerateKeysAndValuesUsingBlock:
- (void (^)(uint64_t key, int32_t value, BOOL *stop))block;
- // These methods bypass the validationFunc to provide access to values that were not
- // known at the time the binary was compiled.
- - (BOOL)valueForKey:(uint64_t)key rawValue:(int32_t *)rawValue;
- - (void)enumerateKeysAndRawValuesUsingBlock:
- (void (^)(uint64_t key, int32_t rawValue, BOOL *stop))block;
- - (void)addRawEntriesFromDictionary:(GPBUInt64EnumDictionary *)otherDictionary;
- // If value is not a valid enumerator as defined by validationFunc, these
- // methods will assert in debug, and will log in release and assign the value
- // to the default value. Use the rawValue methods below to assign non enumerator
- // values.
- - (void)setValue:(int32_t)value forKey:(uint64_t)key;
- // This method bypass the validationFunc to provide setting of values that were not
- // known at the time the binary was compiled.
- - (void)setRawValue:(int32_t)rawValue forKey:(uint64_t)key;
- // No validation applies to these methods.
- - (void)removeValueForKey:(uint64_t)aKey;
- - (void)removeAll;
- @end
- #pragma mark - UInt64 -> Object
- @interface GPBUInt64ObjectDictionary : NSObject <NSCopying>
- @property(nonatomic, readonly) NSUInteger count;
- + (instancetype)dictionary;
- + (instancetype)dictionaryWithValue:(id)value
- forKey:(uint64_t)key;
- + (instancetype)dictionaryWithValues:(const id GPB_UNSAFE_UNRETAINED [])values
- forKeys:(const uint64_t [])keys
- count:(NSUInteger)count;
- + (instancetype)dictionaryWithDictionary:(GPBUInt64ObjectDictionary *)dictionary;
- + (instancetype)dictionaryWithCapacity:(NSUInteger)numItems;
- - (instancetype)initWithValues:(const id GPB_UNSAFE_UNRETAINED [])values
- forKeys:(const uint64_t [])keys
- count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
- - (instancetype)initWithDictionary:(GPBUInt64ObjectDictionary *)dictionary;
- - (instancetype)initWithCapacity:(NSUInteger)numItems;
- - (id)valueForKey:(uint64_t)key;
- - (void)enumerateKeysAndValuesUsingBlock:
- (void (^)(uint64_t key, id value, BOOL *stop))block;
- - (void)addEntriesFromDictionary:(GPBUInt64ObjectDictionary *)otherDictionary;
- - (void)setValue:(id)value forKey:(uint64_t)key;
- - (void)removeValueForKey:(uint64_t)aKey;
- - (void)removeAll;
- @end
- #pragma mark - Int64 -> UInt32
- @interface GPBInt64UInt32Dictionary : NSObject <NSCopying>
- @property(nonatomic, readonly) NSUInteger count;
- + (instancetype)dictionary;
- + (instancetype)dictionaryWithValue:(uint32_t)value
- forKey:(int64_t)key;
- + (instancetype)dictionaryWithValues:(const uint32_t [])values
- forKeys:(const int64_t [])keys
- count:(NSUInteger)count;
- + (instancetype)dictionaryWithDictionary:(GPBInt64UInt32Dictionary *)dictionary;
- + (instancetype)dictionaryWithCapacity:(NSUInteger)numItems;
- - (instancetype)initWithValues:(const uint32_t [])values
- forKeys:(const int64_t [])keys
- count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
- - (instancetype)initWithDictionary:(GPBInt64UInt32Dictionary *)dictionary;
- - (instancetype)initWithCapacity:(NSUInteger)numItems;
- - (BOOL)valueForKey:(int64_t)key value:(uint32_t *)value;
- - (void)enumerateKeysAndValuesUsingBlock:
- (void (^)(int64_t key, uint32_t value, BOOL *stop))block;
- - (void)addEntriesFromDictionary:(GPBInt64UInt32Dictionary *)otherDictionary;
- - (void)setValue:(uint32_t)value forKey:(int64_t)key;
- - (void)removeValueForKey:(int64_t)aKey;
- - (void)removeAll;
- @end
- #pragma mark - Int64 -> Int32
- @interface GPBInt64Int32Dictionary : NSObject <NSCopying>
- @property(nonatomic, readonly) NSUInteger count;
- + (instancetype)dictionary;
- + (instancetype)dictionaryWithValue:(int32_t)value
- forKey:(int64_t)key;
- + (instancetype)dictionaryWithValues:(const int32_t [])values
- forKeys:(const int64_t [])keys
- count:(NSUInteger)count;
- + (instancetype)dictionaryWithDictionary:(GPBInt64Int32Dictionary *)dictionary;
- + (instancetype)dictionaryWithCapacity:(NSUInteger)numItems;
- - (instancetype)initWithValues:(const int32_t [])values
- forKeys:(const int64_t [])keys
- count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
- - (instancetype)initWithDictionary:(GPBInt64Int32Dictionary *)dictionary;
- - (instancetype)initWithCapacity:(NSUInteger)numItems;
- - (BOOL)valueForKey:(int64_t)key value:(int32_t *)value;
- - (void)enumerateKeysAndValuesUsingBlock:
- (void (^)(int64_t key, int32_t value, BOOL *stop))block;
- - (void)addEntriesFromDictionary:(GPBInt64Int32Dictionary *)otherDictionary;
- - (void)setValue:(int32_t)value forKey:(int64_t)key;
- - (void)removeValueForKey:(int64_t)aKey;
- - (void)removeAll;
- @end
- #pragma mark - Int64 -> UInt64
- @interface GPBInt64UInt64Dictionary : NSObject <NSCopying>
- @property(nonatomic, readonly) NSUInteger count;
- + (instancetype)dictionary;
- + (instancetype)dictionaryWithValue:(uint64_t)value
- forKey:(int64_t)key;
- + (instancetype)dictionaryWithValues:(const uint64_t [])values
- forKeys:(const int64_t [])keys
- count:(NSUInteger)count;
- + (instancetype)dictionaryWithDictionary:(GPBInt64UInt64Dictionary *)dictionary;
- + (instancetype)dictionaryWithCapacity:(NSUInteger)numItems;
- - (instancetype)initWithValues:(const uint64_t [])values
- forKeys:(const int64_t [])keys
- count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
- - (instancetype)initWithDictionary:(GPBInt64UInt64Dictionary *)dictionary;
- - (instancetype)initWithCapacity:(NSUInteger)numItems;
- - (BOOL)valueForKey:(int64_t)key value:(uint64_t *)value;
- - (void)enumerateKeysAndValuesUsingBlock:
- (void (^)(int64_t key, uint64_t value, BOOL *stop))block;
- - (void)addEntriesFromDictionary:(GPBInt64UInt64Dictionary *)otherDictionary;
- - (void)setValue:(uint64_t)value forKey:(int64_t)key;
- - (void)removeValueForKey:(int64_t)aKey;
- - (void)removeAll;
- @end
- #pragma mark - Int64 -> Int64
- @interface GPBInt64Int64Dictionary : NSObject <NSCopying>
- @property(nonatomic, readonly) NSUInteger count;
- + (instancetype)dictionary;
- + (instancetype)dictionaryWithValue:(int64_t)value
- forKey:(int64_t)key;
- + (instancetype)dictionaryWithValues:(const int64_t [])values
- forKeys:(const int64_t [])keys
- count:(NSUInteger)count;
- + (instancetype)dictionaryWithDictionary:(GPBInt64Int64Dictionary *)dictionary;
- + (instancetype)dictionaryWithCapacity:(NSUInteger)numItems;
- - (instancetype)initWithValues:(const int64_t [])values
- forKeys:(const int64_t [])keys
- count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
- - (instancetype)initWithDictionary:(GPBInt64Int64Dictionary *)dictionary;
- - (instancetype)initWithCapacity:(NSUInteger)numItems;
- - (BOOL)valueForKey:(int64_t)key value:(int64_t *)value;
- - (void)enumerateKeysAndValuesUsingBlock:
- (void (^)(int64_t key, int64_t value, BOOL *stop))block;
- - (void)addEntriesFromDictionary:(GPBInt64Int64Dictionary *)otherDictionary;
- - (void)setValue:(int64_t)value forKey:(int64_t)key;
- - (void)removeValueForKey:(int64_t)aKey;
- - (void)removeAll;
- @end
- #pragma mark - Int64 -> Bool
- @interface GPBInt64BoolDictionary : NSObject <NSCopying>
- @property(nonatomic, readonly) NSUInteger count;
- + (instancetype)dictionary;
- + (instancetype)dictionaryWithValue:(BOOL)value
- forKey:(int64_t)key;
- + (instancetype)dictionaryWithValues:(const BOOL [])values
- forKeys:(const int64_t [])keys
- count:(NSUInteger)count;
- + (instancetype)dictionaryWithDictionary:(GPBInt64BoolDictionary *)dictionary;
- + (instancetype)dictionaryWithCapacity:(NSUInteger)numItems;
- - (instancetype)initWithValues:(const BOOL [])values
- forKeys:(const int64_t [])keys
- count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
- - (instancetype)initWithDictionary:(GPBInt64BoolDictionary *)dictionary;
- - (instancetype)initWithCapacity:(NSUInteger)numItems;
- - (BOOL)valueForKey:(int64_t)key value:(BOOL *)value;
- - (void)enumerateKeysAndValuesUsingBlock:
- (void (^)(int64_t key, BOOL value, BOOL *stop))block;
- - (void)addEntriesFromDictionary:(GPBInt64BoolDictionary *)otherDictionary;
- - (void)setValue:(BOOL)value forKey:(int64_t)key;
- - (void)removeValueForKey:(int64_t)aKey;
- - (void)removeAll;
- @end
- #pragma mark - Int64 -> Float
- @interface GPBInt64FloatDictionary : NSObject <NSCopying>
- @property(nonatomic, readonly) NSUInteger count;
- + (instancetype)dictionary;
- + (instancetype)dictionaryWithValue:(float)value
- forKey:(int64_t)key;
- + (instancetype)dictionaryWithValues:(const float [])values
- forKeys:(const int64_t [])keys
- count:(NSUInteger)count;
- + (instancetype)dictionaryWithDictionary:(GPBInt64FloatDictionary *)dictionary;
- + (instancetype)dictionaryWithCapacity:(NSUInteger)numItems;
- - (instancetype)initWithValues:(const float [])values
- forKeys:(const int64_t [])keys
- count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
- - (instancetype)initWithDictionary:(GPBInt64FloatDictionary *)dictionary;
- - (instancetype)initWithCapacity:(NSUInteger)numItems;
- - (BOOL)valueForKey:(int64_t)key value:(float *)value;
- - (void)enumerateKeysAndValuesUsingBlock:
- (void (^)(int64_t key, float value, BOOL *stop))block;
- - (void)addEntriesFromDictionary:(GPBInt64FloatDictionary *)otherDictionary;
- - (void)setValue:(float)value forKey:(int64_t)key;
- - (void)removeValueForKey:(int64_t)aKey;
- - (void)removeAll;
- @end
- #pragma mark - Int64 -> Double
- @interface GPBInt64DoubleDictionary : NSObject <NSCopying>
- @property(nonatomic, readonly) NSUInteger count;
- + (instancetype)dictionary;
- + (instancetype)dictionaryWithValue:(double)value
- forKey:(int64_t)key;
- + (instancetype)dictionaryWithValues:(const double [])values
- forKeys:(const int64_t [])keys
- count:(NSUInteger)count;
- + (instancetype)dictionaryWithDictionary:(GPBInt64DoubleDictionary *)dictionary;
- + (instancetype)dictionaryWithCapacity:(NSUInteger)numItems;
- - (instancetype)initWithValues:(const double [])values
- forKeys:(const int64_t [])keys
- count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
- - (instancetype)initWithDictionary:(GPBInt64DoubleDictionary *)dictionary;
- - (instancetype)initWithCapacity:(NSUInteger)numItems;
- - (BOOL)valueForKey:(int64_t)key value:(double *)value;
- - (void)enumerateKeysAndValuesUsingBlock:
- (void (^)(int64_t key, double value, BOOL *stop))block;
- - (void)addEntriesFromDictionary:(GPBInt64DoubleDictionary *)otherDictionary;
- - (void)setValue:(double)value forKey:(int64_t)key;
- - (void)removeValueForKey:(int64_t)aKey;
- - (void)removeAll;
- @end
- #pragma mark - Int64 -> Enum
- @interface GPBInt64EnumDictionary : NSObject <NSCopying>
- @property(nonatomic, readonly) NSUInteger count;
- @property(nonatomic, readonly) GPBEnumValidationFunc validationFunc;
- + (instancetype)dictionary;
- + (instancetype)dictionaryWithValidationFunction:(GPBEnumValidationFunc)func;
- + (instancetype)dictionaryWithValidationFunction:(GPBEnumValidationFunc)func
- rawValue:(int32_t)rawValue
- forKey:(int64_t)key;
- + (instancetype)dictionaryWithValidationFunction:(GPBEnumValidationFunc)func
- rawValues:(const int32_t [])values
- forKeys:(const int64_t [])keys
- count:(NSUInteger)count;
- + (instancetype)dictionaryWithDictionary:(GPBInt64EnumDictionary *)dictionary;
- + (instancetype)dictionaryWithValidationFunction:(GPBEnumValidationFunc)func
- capacity:(NSUInteger)numItems;
- - (instancetype)initWithValidationFunction:(GPBEnumValidationFunc)func;
- - (instancetype)initWithValidationFunction:(GPBEnumValidationFunc)func
- rawValues:(const int32_t [])values
- forKeys:(const int64_t [])keys
- count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
- - (instancetype)initWithDictionary:(GPBInt64EnumDictionary *)dictionary;
- - (instancetype)initWithValidationFunction:(GPBEnumValidationFunc)func
- capacity:(NSUInteger)numItems;
- // These will return kGPBUnrecognizedEnumeratorValue if the value for the key
- // is not a valid enumerator as defined by validationFunc. If the actual value is
- // desired, use "raw" version of the method.
- - (BOOL)valueForKey:(int64_t)key value:(int32_t *)value;
- - (void)enumerateKeysAndValuesUsingBlock:
- (void (^)(int64_t key, int32_t value, BOOL *stop))block;
- // These methods bypass the validationFunc to provide access to values that were not
- // known at the time the binary was compiled.
- - (BOOL)valueForKey:(int64_t)key rawValue:(int32_t *)rawValue;
- - (void)enumerateKeysAndRawValuesUsingBlock:
- (void (^)(int64_t key, int32_t rawValue, BOOL *stop))block;
- - (void)addRawEntriesFromDictionary:(GPBInt64EnumDictionary *)otherDictionary;
- // If value is not a valid enumerator as defined by validationFunc, these
- // methods will assert in debug, and will log in release and assign the value
- // to the default value. Use the rawValue methods below to assign non enumerator
- // values.
- - (void)setValue:(int32_t)value forKey:(int64_t)key;
- // This method bypass the validationFunc to provide setting of values that were not
- // known at the time the binary was compiled.
- - (void)setRawValue:(int32_t)rawValue forKey:(int64_t)key;
- // No validation applies to these methods.
- - (void)removeValueForKey:(int64_t)aKey;
- - (void)removeAll;
- @end
- #pragma mark - Int64 -> Object
- @interface GPBInt64ObjectDictionary : NSObject <NSCopying>
- @property(nonatomic, readonly) NSUInteger count;
- + (instancetype)dictionary;
- + (instancetype)dictionaryWithValue:(id)value
- forKey:(int64_t)key;
- + (instancetype)dictionaryWithValues:(const id GPB_UNSAFE_UNRETAINED [])values
- forKeys:(const int64_t [])keys
- count:(NSUInteger)count;
- + (instancetype)dictionaryWithDictionary:(GPBInt64ObjectDictionary *)dictionary;
- + (instancetype)dictionaryWithCapacity:(NSUInteger)numItems;
- - (instancetype)initWithValues:(const id GPB_UNSAFE_UNRETAINED [])values
- forKeys:(const int64_t [])keys
- count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
- - (instancetype)initWithDictionary:(GPBInt64ObjectDictionary *)dictionary;
- - (instancetype)initWithCapacity:(NSUInteger)numItems;
- - (id)valueForKey:(int64_t)key;
- - (void)enumerateKeysAndValuesUsingBlock:
- (void (^)(int64_t key, id value, BOOL *stop))block;
- - (void)addEntriesFromDictionary:(GPBInt64ObjectDictionary *)otherDictionary;
- - (void)setValue:(id)value forKey:(int64_t)key;
- - (void)removeValueForKey:(int64_t)aKey;
- - (void)removeAll;
- @end
- #pragma mark - Bool -> UInt32
- @interface GPBBoolUInt32Dictionary : NSObject <NSCopying>
- @property(nonatomic, readonly) NSUInteger count;
- + (instancetype)dictionary;
- + (instancetype)dictionaryWithValue:(uint32_t)value
- forKey:(BOOL)key;
- + (instancetype)dictionaryWithValues:(const uint32_t [])values
- forKeys:(const BOOL [])keys
- count:(NSUInteger)count;
- + (instancetype)dictionaryWithDictionary:(GPBBoolUInt32Dictionary *)dictionary;
- + (instancetype)dictionaryWithCapacity:(NSUInteger)numItems;
- - (instancetype)initWithValues:(const uint32_t [])values
- forKeys:(const BOOL [])keys
- count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
- - (instancetype)initWithDictionary:(GPBBoolUInt32Dictionary *)dictionary;
- - (instancetype)initWithCapacity:(NSUInteger)numItems;
- - (BOOL)valueForKey:(BOOL)key value:(uint32_t *)value;
- - (void)enumerateKeysAndValuesUsingBlock:
- (void (^)(BOOL key, uint32_t value, BOOL *stop))block;
- - (void)addEntriesFromDictionary:(GPBBoolUInt32Dictionary *)otherDictionary;
- - (void)setValue:(uint32_t)value forKey:(BOOL)key;
- - (void)removeValueForKey:(BOOL)aKey;
- - (void)removeAll;
- @end
- #pragma mark - Bool -> Int32
- @interface GPBBoolInt32Dictionary : NSObject <NSCopying>
- @property(nonatomic, readonly) NSUInteger count;
- + (instancetype)dictionary;
- + (instancetype)dictionaryWithValue:(int32_t)value
- forKey:(BOOL)key;
- + (instancetype)dictionaryWithValues:(const int32_t [])values
- forKeys:(const BOOL [])keys
- count:(NSUInteger)count;
- + (instancetype)dictionaryWithDictionary:(GPBBoolInt32Dictionary *)dictionary;
- + (instancetype)dictionaryWithCapacity:(NSUInteger)numItems;
- - (instancetype)initWithValues:(const int32_t [])values
- forKeys:(const BOOL [])keys
- count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
- - (instancetype)initWithDictionary:(GPBBoolInt32Dictionary *)dictionary;
- - (instancetype)initWithCapacity:(NSUInteger)numItems;
- - (BOOL)valueForKey:(BOOL)key value:(int32_t *)value;
- - (void)enumerateKeysAndValuesUsingBlock:
- (void (^)(BOOL key, int32_t value, BOOL *stop))block;
- - (void)addEntriesFromDictionary:(GPBBoolInt32Dictionary *)otherDictionary;
- - (void)setValue:(int32_t)value forKey:(BOOL)key;
- - (void)removeValueForKey:(BOOL)aKey;
- - (void)removeAll;
- @end
- #pragma mark - Bool -> UInt64
- @interface GPBBoolUInt64Dictionary : NSObject <NSCopying>
- @property(nonatomic, readonly) NSUInteger count;
- + (instancetype)dictionary;
- + (instancetype)dictionaryWithValue:(uint64_t)value
- forKey:(BOOL)key;
- + (instancetype)dictionaryWithValues:(const uint64_t [])values
- forKeys:(const BOOL [])keys
- count:(NSUInteger)count;
- + (instancetype)dictionaryWithDictionary:(GPBBoolUInt64Dictionary *)dictionary;
- + (instancetype)dictionaryWithCapacity:(NSUInteger)numItems;
- - (instancetype)initWithValues:(const uint64_t [])values
- forKeys:(const BOOL [])keys
- count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
- - (instancetype)initWithDictionary:(GPBBoolUInt64Dictionary *)dictionary;
- - (instancetype)initWithCapacity:(NSUInteger)numItems;
- - (BOOL)valueForKey:(BOOL)key value:(uint64_t *)value;
- - (void)enumerateKeysAndValuesUsingBlock:
- (void (^)(BOOL key, uint64_t value, BOOL *stop))block;
- - (void)addEntriesFromDictionary:(GPBBoolUInt64Dictionary *)otherDictionary;
- - (void)setValue:(uint64_t)value forKey:(BOOL)key;
- - (void)removeValueForKey:(BOOL)aKey;
- - (void)removeAll;
- @end
- #pragma mark - Bool -> Int64
- @interface GPBBoolInt64Dictionary : NSObject <NSCopying>
- @property(nonatomic, readonly) NSUInteger count;
- + (instancetype)dictionary;
- + (instancetype)dictionaryWithValue:(int64_t)value
- forKey:(BOOL)key;
- + (instancetype)dictionaryWithValues:(const int64_t [])values
- forKeys:(const BOOL [])keys
- count:(NSUInteger)count;
- + (instancetype)dictionaryWithDictionary:(GPBBoolInt64Dictionary *)dictionary;
- + (instancetype)dictionaryWithCapacity:(NSUInteger)numItems;
- - (instancetype)initWithValues:(const int64_t [])values
- forKeys:(const BOOL [])keys
- count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
- - (instancetype)initWithDictionary:(GPBBoolInt64Dictionary *)dictionary;
- - (instancetype)initWithCapacity:(NSUInteger)numItems;
- - (BOOL)valueForKey:(BOOL)key value:(int64_t *)value;
- - (void)enumerateKeysAndValuesUsingBlock:
- (void (^)(BOOL key, int64_t value, BOOL *stop))block;
- - (void)addEntriesFromDictionary:(GPBBoolInt64Dictionary *)otherDictionary;
- - (void)setValue:(int64_t)value forKey:(BOOL)key;
- - (void)removeValueForKey:(BOOL)aKey;
- - (void)removeAll;
- @end
- #pragma mark - Bool -> Bool
- @interface GPBBoolBoolDictionary : NSObject <NSCopying>
- @property(nonatomic, readonly) NSUInteger count;
- + (instancetype)dictionary;
- + (instancetype)dictionaryWithValue:(BOOL)value
- forKey:(BOOL)key;
- + (instancetype)dictionaryWithValues:(const BOOL [])values
- forKeys:(const BOOL [])keys
- count:(NSUInteger)count;
- + (instancetype)dictionaryWithDictionary:(GPBBoolBoolDictionary *)dictionary;
- + (instancetype)dictionaryWithCapacity:(NSUInteger)numItems;
- - (instancetype)initWithValues:(const BOOL [])values
- forKeys:(const BOOL [])keys
- count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
- - (instancetype)initWithDictionary:(GPBBoolBoolDictionary *)dictionary;
- - (instancetype)initWithCapacity:(NSUInteger)numItems;
- - (BOOL)valueForKey:(BOOL)key value:(BOOL *)value;
- - (void)enumerateKeysAndValuesUsingBlock:
- (void (^)(BOOL key, BOOL value, BOOL *stop))block;
- - (void)addEntriesFromDictionary:(GPBBoolBoolDictionary *)otherDictionary;
- - (void)setValue:(BOOL)value forKey:(BOOL)key;
- - (void)removeValueForKey:(BOOL)aKey;
- - (void)removeAll;
- @end
- #pragma mark - Bool -> Float
- @interface GPBBoolFloatDictionary : NSObject <NSCopying>
- @property(nonatomic, readonly) NSUInteger count;
- + (instancetype)dictionary;
- + (instancetype)dictionaryWithValue:(float)value
- forKey:(BOOL)key;
- + (instancetype)dictionaryWithValues:(const float [])values
- forKeys:(const BOOL [])keys
- count:(NSUInteger)count;
- + (instancetype)dictionaryWithDictionary:(GPBBoolFloatDictionary *)dictionary;
- + (instancetype)dictionaryWithCapacity:(NSUInteger)numItems;
- - (instancetype)initWithValues:(const float [])values
- forKeys:(const BOOL [])keys
- count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
- - (instancetype)initWithDictionary:(GPBBoolFloatDictionary *)dictionary;
- - (instancetype)initWithCapacity:(NSUInteger)numItems;
- - (BOOL)valueForKey:(BOOL)key value:(float *)value;
- - (void)enumerateKeysAndValuesUsingBlock:
- (void (^)(BOOL key, float value, BOOL *stop))block;
- - (void)addEntriesFromDictionary:(GPBBoolFloatDictionary *)otherDictionary;
- - (void)setValue:(float)value forKey:(BOOL)key;
- - (void)removeValueForKey:(BOOL)aKey;
- - (void)removeAll;
- @end
- #pragma mark - Bool -> Double
- @interface GPBBoolDoubleDictionary : NSObject <NSCopying>
- @property(nonatomic, readonly) NSUInteger count;
- + (instancetype)dictionary;
- + (instancetype)dictionaryWithValue:(double)value
- forKey:(BOOL)key;
- + (instancetype)dictionaryWithValues:(const double [])values
- forKeys:(const BOOL [])keys
- count:(NSUInteger)count;
- + (instancetype)dictionaryWithDictionary:(GPBBoolDoubleDictionary *)dictionary;
- + (instancetype)dictionaryWithCapacity:(NSUInteger)numItems;
- - (instancetype)initWithValues:(const double [])values
- forKeys:(const BOOL [])keys
- count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
- - (instancetype)initWithDictionary:(GPBBoolDoubleDictionary *)dictionary;
- - (instancetype)initWithCapacity:(NSUInteger)numItems;
- - (BOOL)valueForKey:(BOOL)key value:(double *)value;
- - (void)enumerateKeysAndValuesUsingBlock:
- (void (^)(BOOL key, double value, BOOL *stop))block;
- - (void)addEntriesFromDictionary:(GPBBoolDoubleDictionary *)otherDictionary;
- - (void)setValue:(double)value forKey:(BOOL)key;
- - (void)removeValueForKey:(BOOL)aKey;
- - (void)removeAll;
- @end
- #pragma mark - Bool -> Enum
- @interface GPBBoolEnumDictionary : NSObject <NSCopying>
- @property(nonatomic, readonly) NSUInteger count;
- @property(nonatomic, readonly) GPBEnumValidationFunc validationFunc;
- + (instancetype)dictionary;
- + (instancetype)dictionaryWithValidationFunction:(GPBEnumValidationFunc)func;
- + (instancetype)dictionaryWithValidationFunction:(GPBEnumValidationFunc)func
- rawValue:(int32_t)rawValue
- forKey:(BOOL)key;
- + (instancetype)dictionaryWithValidationFunction:(GPBEnumValidationFunc)func
- rawValues:(const int32_t [])values
- forKeys:(const BOOL [])keys
- count:(NSUInteger)count;
- + (instancetype)dictionaryWithDictionary:(GPBBoolEnumDictionary *)dictionary;
- + (instancetype)dictionaryWithValidationFunction:(GPBEnumValidationFunc)func
- capacity:(NSUInteger)numItems;
- - (instancetype)initWithValidationFunction:(GPBEnumValidationFunc)func;
- - (instancetype)initWithValidationFunction:(GPBEnumValidationFunc)func
- rawValues:(const int32_t [])values
- forKeys:(const BOOL [])keys
- count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
- - (instancetype)initWithDictionary:(GPBBoolEnumDictionary *)dictionary;
- - (instancetype)initWithValidationFunction:(GPBEnumValidationFunc)func
- capacity:(NSUInteger)numItems;
- // These will return kGPBUnrecognizedEnumeratorValue if the value for the key
- // is not a valid enumerator as defined by validationFunc. If the actual value is
- // desired, use "raw" version of the method.
- - (BOOL)valueForKey:(BOOL)key value:(int32_t *)value;
- - (void)enumerateKeysAndValuesUsingBlock:
- (void (^)(BOOL key, int32_t value, BOOL *stop))block;
- // These methods bypass the validationFunc to provide access to values that were not
- // known at the time the binary was compiled.
- - (BOOL)valueForKey:(BOOL)key rawValue:(int32_t *)rawValue;
- - (void)enumerateKeysAndRawValuesUsingBlock:
- (void (^)(BOOL key, int32_t rawValue, BOOL *stop))block;
- - (void)addRawEntriesFromDictionary:(GPBBoolEnumDictionary *)otherDictionary;
- // If value is not a valid enumerator as defined by validationFunc, these
- // methods will assert in debug, and will log in release and assign the value
- // to the default value. Use the rawValue methods below to assign non enumerator
- // values.
- - (void)setValue:(int32_t)value forKey:(BOOL)key;
- // This method bypass the validationFunc to provide setting of values that were not
- // known at the time the binary was compiled.
- - (void)setRawValue:(int32_t)rawValue forKey:(BOOL)key;
- // No validation applies to these methods.
- - (void)removeValueForKey:(BOOL)aKey;
- - (void)removeAll;
- @end
- #pragma mark - Bool -> Object
- @interface GPBBoolObjectDictionary : NSObject <NSCopying>
- @property(nonatomic, readonly) NSUInteger count;
- + (instancetype)dictionary;
- + (instancetype)dictionaryWithValue:(id)value
- forKey:(BOOL)key;
- + (instancetype)dictionaryWithValues:(const id GPB_UNSAFE_UNRETAINED [])values
- forKeys:(const BOOL [])keys
- count:(NSUInteger)count;
- + (instancetype)dictionaryWithDictionary:(GPBBoolObjectDictionary *)dictionary;
- + (instancetype)dictionaryWithCapacity:(NSUInteger)numItems;
- - (instancetype)initWithValues:(const id GPB_UNSAFE_UNRETAINED [])values
- forKeys:(const BOOL [])keys
- count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
- - (instancetype)initWithDictionary:(GPBBoolObjectDictionary *)dictionary;
- - (instancetype)initWithCapacity:(NSUInteger)numItems;
- - (id)valueForKey:(BOOL)key;
- - (void)enumerateKeysAndValuesUsingBlock:
- (void (^)(BOOL key, id value, BOOL *stop))block;
- - (void)addEntriesFromDictionary:(GPBBoolObjectDictionary *)otherDictionary;
- - (void)setValue:(id)value forKey:(BOOL)key;
- - (void)removeValueForKey:(BOOL)aKey;
- - (void)removeAll;
- @end
- #pragma mark - String -> UInt32
- @interface GPBStringUInt32Dictionary : NSObject <NSCopying>
- @property(nonatomic, readonly) NSUInteger count;
- + (instancetype)dictionary;
- + (instancetype)dictionaryWithValue:(uint32_t)value
- forKey:(NSString *)key;
- + (instancetype)dictionaryWithValues:(const uint32_t [])values
- forKeys:(const NSString * GPB_UNSAFE_UNRETAINED [])keys
- count:(NSUInteger)count;
- + (instancetype)dictionaryWithDictionary:(GPBStringUInt32Dictionary *)dictionary;
- + (instancetype)dictionaryWithCapacity:(NSUInteger)numItems;
- - (instancetype)initWithValues:(const uint32_t [])values
- forKeys:(const NSString * GPB_UNSAFE_UNRETAINED [])keys
- count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
- - (instancetype)initWithDictionary:(GPBStringUInt32Dictionary *)dictionary;
- - (instancetype)initWithCapacity:(NSUInteger)numItems;
- - (BOOL)valueForKey:(NSString *)key value:(uint32_t *)value;
- - (void)enumerateKeysAndValuesUsingBlock:
- (void (^)(NSString *key, uint32_t value, BOOL *stop))block;
- - (void)addEntriesFromDictionary:(GPBStringUInt32Dictionary *)otherDictionary;
- - (void)setValue:(uint32_t)value forKey:(NSString *)key;
- - (void)removeValueForKey:(NSString *)aKey;
- - (void)removeAll;
- @end
- #pragma mark - String -> Int32
- @interface GPBStringInt32Dictionary : NSObject <NSCopying>
- @property(nonatomic, readonly) NSUInteger count;
- + (instancetype)dictionary;
- + (instancetype)dictionaryWithValue:(int32_t)value
- forKey:(NSString *)key;
- + (instancetype)dictionaryWithValues:(const int32_t [])values
- forKeys:(const NSString * GPB_UNSAFE_UNRETAINED [])keys
- count:(NSUInteger)count;
- + (instancetype)dictionaryWithDictionary:(GPBStringInt32Dictionary *)dictionary;
- + (instancetype)dictionaryWithCapacity:(NSUInteger)numItems;
- - (instancetype)initWithValues:(const int32_t [])values
- forKeys:(const NSString * GPB_UNSAFE_UNRETAINED [])keys
- count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
- - (instancetype)initWithDictionary:(GPBStringInt32Dictionary *)dictionary;
- - (instancetype)initWithCapacity:(NSUInteger)numItems;
- - (BOOL)valueForKey:(NSString *)key value:(int32_t *)value;
- - (void)enumerateKeysAndValuesUsingBlock:
- (void (^)(NSString *key, int32_t value, BOOL *stop))block;
- - (void)addEntriesFromDictionary:(GPBStringInt32Dictionary *)otherDictionary;
- - (void)setValue:(int32_t)value forKey:(NSString *)key;
- - (void)removeValueForKey:(NSString *)aKey;
- - (void)removeAll;
- @end
- #pragma mark - String -> UInt64
- @interface GPBStringUInt64Dictionary : NSObject <NSCopying>
- @property(nonatomic, readonly) NSUInteger count;
- + (instancetype)dictionary;
- + (instancetype)dictionaryWithValue:(uint64_t)value
- forKey:(NSString *)key;
- + (instancetype)dictionaryWithValues:(const uint64_t [])values
- forKeys:(const NSString * GPB_UNSAFE_UNRETAINED [])keys
- count:(NSUInteger)count;
- + (instancetype)dictionaryWithDictionary:(GPBStringUInt64Dictionary *)dictionary;
- + (instancetype)dictionaryWithCapacity:(NSUInteger)numItems;
- - (instancetype)initWithValues:(const uint64_t [])values
- forKeys:(const NSString * GPB_UNSAFE_UNRETAINED [])keys
- count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
- - (instancetype)initWithDictionary:(GPBStringUInt64Dictionary *)dictionary;
- - (instancetype)initWithCapacity:(NSUInteger)numItems;
- - (BOOL)valueForKey:(NSString *)key value:(uint64_t *)value;
- - (void)enumerateKeysAndValuesUsingBlock:
- (void (^)(NSString *key, uint64_t value, BOOL *stop))block;
- - (void)addEntriesFromDictionary:(GPBStringUInt64Dictionary *)otherDictionary;
- - (void)setValue:(uint64_t)value forKey:(NSString *)key;
- - (void)removeValueForKey:(NSString *)aKey;
- - (void)removeAll;
- @end
- #pragma mark - String -> Int64
- @interface GPBStringInt64Dictionary : NSObject <NSCopying>
- @property(nonatomic, readonly) NSUInteger count;
- + (instancetype)dictionary;
- + (instancetype)dictionaryWithValue:(int64_t)value
- forKey:(NSString *)key;
- + (instancetype)dictionaryWithValues:(const int64_t [])values
- forKeys:(const NSString * GPB_UNSAFE_UNRETAINED [])keys
- count:(NSUInteger)count;
- + (instancetype)dictionaryWithDictionary:(GPBStringInt64Dictionary *)dictionary;
- + (instancetype)dictionaryWithCapacity:(NSUInteger)numItems;
- - (instancetype)initWithValues:(const int64_t [])values
- forKeys:(const NSString * GPB_UNSAFE_UNRETAINED [])keys
- count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
- - (instancetype)initWithDictionary:(GPBStringInt64Dictionary *)dictionary;
- - (instancetype)initWithCapacity:(NSUInteger)numItems;
- - (BOOL)valueForKey:(NSString *)key value:(int64_t *)value;
- - (void)enumerateKeysAndValuesUsingBlock:
- (void (^)(NSString *key, int64_t value, BOOL *stop))block;
- - (void)addEntriesFromDictionary:(GPBStringInt64Dictionary *)otherDictionary;
- - (void)setValue:(int64_t)value forKey:(NSString *)key;
- - (void)removeValueForKey:(NSString *)aKey;
- - (void)removeAll;
- @end
- #pragma mark - String -> Bool
- @interface GPBStringBoolDictionary : NSObject <NSCopying>
- @property(nonatomic, readonly) NSUInteger count;
- + (instancetype)dictionary;
- + (instancetype)dictionaryWithValue:(BOOL)value
- forKey:(NSString *)key;
- + (instancetype)dictionaryWithValues:(const BOOL [])values
- forKeys:(const NSString * GPB_UNSAFE_UNRETAINED [])keys
- count:(NSUInteger)count;
- + (instancetype)dictionaryWithDictionary:(GPBStringBoolDictionary *)dictionary;
- + (instancetype)dictionaryWithCapacity:(NSUInteger)numItems;
- - (instancetype)initWithValues:(const BOOL [])values
- forKeys:(const NSString * GPB_UNSAFE_UNRETAINED [])keys
- count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
- - (instancetype)initWithDictionary:(GPBStringBoolDictionary *)dictionary;
- - (instancetype)initWithCapacity:(NSUInteger)numItems;
- - (BOOL)valueForKey:(NSString *)key value:(BOOL *)value;
- - (void)enumerateKeysAndValuesUsingBlock:
- (void (^)(NSString *key, BOOL value, BOOL *stop))block;
- - (void)addEntriesFromDictionary:(GPBStringBoolDictionary *)otherDictionary;
- - (void)setValue:(BOOL)value forKey:(NSString *)key;
- - (void)removeValueForKey:(NSString *)aKey;
- - (void)removeAll;
- @end
- #pragma mark - String -> Float
- @interface GPBStringFloatDictionary : NSObject <NSCopying>
- @property(nonatomic, readonly) NSUInteger count;
- + (instancetype)dictionary;
- + (instancetype)dictionaryWithValue:(float)value
- forKey:(NSString *)key;
- + (instancetype)dictionaryWithValues:(const float [])values
- forKeys:(const NSString * GPB_UNSAFE_UNRETAINED [])keys
- count:(NSUInteger)count;
- + (instancetype)dictionaryWithDictionary:(GPBStringFloatDictionary *)dictionary;
- + (instancetype)dictionaryWithCapacity:(NSUInteger)numItems;
- - (instancetype)initWithValues:(const float [])values
- forKeys:(const NSString * GPB_UNSAFE_UNRETAINED [])keys
- count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
- - (instancetype)initWithDictionary:(GPBStringFloatDictionary *)dictionary;
- - (instancetype)initWithCapacity:(NSUInteger)numItems;
- - (BOOL)valueForKey:(NSString *)key value:(float *)value;
- - (void)enumerateKeysAndValuesUsingBlock:
- (void (^)(NSString *key, float value, BOOL *stop))block;
- - (void)addEntriesFromDictionary:(GPBStringFloatDictionary *)otherDictionary;
- - (void)setValue:(float)value forKey:(NSString *)key;
- - (void)removeValueForKey:(NSString *)aKey;
- - (void)removeAll;
- @end
- #pragma mark - String -> Double
- @interface GPBStringDoubleDictionary : NSObject <NSCopying>
- @property(nonatomic, readonly) NSUInteger count;
- + (instancetype)dictionary;
- + (instancetype)dictionaryWithValue:(double)value
- forKey:(NSString *)key;
- + (instancetype)dictionaryWithValues:(const double [])values
- forKeys:(const NSString * GPB_UNSAFE_UNRETAINED [])keys
- count:(NSUInteger)count;
- + (instancetype)dictionaryWithDictionary:(GPBStringDoubleDictionary *)dictionary;
- + (instancetype)dictionaryWithCapacity:(NSUInteger)numItems;
- - (instancetype)initWithValues:(const double [])values
- forKeys:(const NSString * GPB_UNSAFE_UNRETAINED [])keys
- count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
- - (instancetype)initWithDictionary:(GPBStringDoubleDictionary *)dictionary;
- - (instancetype)initWithCapacity:(NSUInteger)numItems;
- - (BOOL)valueForKey:(NSString *)key value:(double *)value;
- - (void)enumerateKeysAndValuesUsingBlock:
- (void (^)(NSString *key, double value, BOOL *stop))block;
- - (void)addEntriesFromDictionary:(GPBStringDoubleDictionary *)otherDictionary;
- - (void)setValue:(double)value forKey:(NSString *)key;
- - (void)removeValueForKey:(NSString *)aKey;
- - (void)removeAll;
- @end
- #pragma mark - String -> Enum
- @interface GPBStringEnumDictionary : NSObject <NSCopying>
- @property(nonatomic, readonly) NSUInteger count;
- @property(nonatomic, readonly) GPBEnumValidationFunc validationFunc;
- + (instancetype)dictionary;
- + (instancetype)dictionaryWithValidationFunction:(GPBEnumValidationFunc)func;
- + (instancetype)dictionaryWithValidationFunction:(GPBEnumValidationFunc)func
- rawValue:(int32_t)rawValue
- forKey:(NSString *)key;
- + (instancetype)dictionaryWithValidationFunction:(GPBEnumValidationFunc)func
- rawValues:(const int32_t [])values
- forKeys:(const NSString * GPB_UNSAFE_UNRETAINED [])keys
- count:(NSUInteger)count;
- + (instancetype)dictionaryWithDictionary:(GPBStringEnumDictionary *)dictionary;
- + (instancetype)dictionaryWithValidationFunction:(GPBEnumValidationFunc)func
- capacity:(NSUInteger)numItems;
- - (instancetype)initWithValidationFunction:(GPBEnumValidationFunc)func;
- - (instancetype)initWithValidationFunction:(GPBEnumValidationFunc)func
- rawValues:(const int32_t [])values
- forKeys:(const NSString * GPB_UNSAFE_UNRETAINED [])keys
- count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
- - (instancetype)initWithDictionary:(GPBStringEnumDictionary *)dictionary;
- - (instancetype)initWithValidationFunction:(GPBEnumValidationFunc)func
- capacity:(NSUInteger)numItems;
- // These will return kGPBUnrecognizedEnumeratorValue if the value for the key
- // is not a valid enumerator as defined by validationFunc. If the actual value is
- // desired, use "raw" version of the method.
- - (BOOL)valueForKey:(NSString *)key value:(int32_t *)value;
- - (void)enumerateKeysAndValuesUsingBlock:
- (void (^)(NSString *key, int32_t value, BOOL *stop))block;
- // These methods bypass the validationFunc to provide access to values that were not
- // known at the time the binary was compiled.
- - (BOOL)valueForKey:(NSString *)key rawValue:(int32_t *)rawValue;
- - (void)enumerateKeysAndRawValuesUsingBlock:
- (void (^)(NSString *key, int32_t rawValue, BOOL *stop))block;
- - (void)addRawEntriesFromDictionary:(GPBStringEnumDictionary *)otherDictionary;
- // If value is not a valid enumerator as defined by validationFunc, these
- // methods will assert in debug, and will log in release and assign the value
- // to the default value. Use the rawValue methods below to assign non enumerator
- // values.
- - (void)setValue:(int32_t)value forKey:(NSString *)key;
- // This method bypass the validationFunc to provide setting of values that were not
- // known at the time the binary was compiled.
- - (void)setRawValue:(int32_t)rawValue forKey:(NSString *)key;
- // No validation applies to these methods.
- - (void)removeValueForKey:(NSString *)aKey;
- - (void)removeAll;
- @end
- //%PDDM-EXPAND-END DECLARE_DICTIONARIES()
- //%PDDM-DEFINE DECLARE_DICTIONARIES()
- //%DICTIONARY_INTERFACES_FOR_POD_KEY(UInt32, uint32_t)
- //%DICTIONARY_INTERFACES_FOR_POD_KEY(Int32, int32_t)
- //%DICTIONARY_INTERFACES_FOR_POD_KEY(UInt64, uint64_t)
- //%DICTIONARY_INTERFACES_FOR_POD_KEY(Int64, int64_t)
- //%DICTIONARY_INTERFACES_FOR_POD_KEY(Bool, BOOL)
- //%DICTIONARY_POD_INTERFACES_FOR_KEY(String, NSString, *, OBJECT)
- //%PDDM-DEFINE DICTIONARY_INTERFACES_FOR_POD_KEY(KEY_NAME, KEY_TYPE)
- //%DICTIONARY_POD_INTERFACES_FOR_KEY(KEY_NAME, KEY_TYPE, , POD)
- //%DICTIONARY_POD_KEY_TO_OBJECT_INTERFACE(KEY_NAME, KEY_TYPE, Object, id)
- //%PDDM-DEFINE DICTIONARY_POD_INTERFACES_FOR_KEY(KEY_NAME, KEY_TYPE, KisP, KHELPER)
- //%DICTIONARY_KEY_TO_POD_INTERFACE(KEY_NAME, KEY_TYPE, KisP, KHELPER, UInt32, uint32_t)
- //%DICTIONARY_KEY_TO_POD_INTERFACE(KEY_NAME, KEY_TYPE, KisP, KHELPER, Int32, int32_t)
- //%DICTIONARY_KEY_TO_POD_INTERFACE(KEY_NAME, KEY_TYPE, KisP, KHELPER, UInt64, uint64_t)
- //%DICTIONARY_KEY_TO_POD_INTERFACE(KEY_NAME, KEY_TYPE, KisP, KHELPER, Int64, int64_t)
- //%DICTIONARY_KEY_TO_POD_INTERFACE(KEY_NAME, KEY_TYPE, KisP, KHELPER, Bool, BOOL)
- //%DICTIONARY_KEY_TO_POD_INTERFACE(KEY_NAME, KEY_TYPE, KisP, KHELPER, Float, float)
- //%DICTIONARY_KEY_TO_POD_INTERFACE(KEY_NAME, KEY_TYPE, KisP, KHELPER, Double, double)
- //%DICTIONARY_KEY_TO_ENUM_INTERFACE(KEY_NAME, KEY_TYPE, KisP, KHELPER, Enum, int32_t)
- //%PDDM-DEFINE DICTIONARY_KEY_TO_POD_INTERFACE(KEY_NAME, KEY_TYPE, KisP, KHELPER, VALUE_NAME, VALUE_TYPE)
- //%DICTIONARY_COMMON_INTERFACE(KEY_NAME, KEY_TYPE, KisP, KHELPER, VALUE_NAME, VALUE_TYPE, POD)
- //%PDDM-DEFINE DICTIONARY_POD_KEY_TO_OBJECT_INTERFACE(KEY_NAME, KEY_TYPE, VALUE_NAME, VALUE_TYPE)
- //%DICTIONARY_COMMON_INTERFACE(KEY_NAME, KEY_TYPE, , POD, VALUE_NAME, VALUE_TYPE, OBJECT)
- //%PDDM-DEFINE VALUE_FOR_KEY_POD(KEY_TYPE, VALUE_TYPE)
- //%- (BOOL)valueForKey:(KEY_TYPE)key value:(VALUE_TYPE *)value;
- //%PDDM-DEFINE VALUE_FOR_KEY_OBJECT(KEY_TYPE, VALUE_TYPE)
- //%- (VALUE_TYPE)valueForKey:(KEY_TYPE)key;
- //%PDDM-DEFINE VALUE_FOR_KEY_Enum(KEY_TYPE, VALUE_TYPE)
- //%VALUE_FOR_KEY_POD(KEY_TYPE, VALUE_TYPE)
- //%PDDM-DEFINE ARRAY_ARG_MODIFIERPOD()
- // Nothing
- //%PDDM-DEFINE ARRAY_ARG_MODIFIEREnum()
- // Nothing
- //%PDDM-DEFINE ARRAY_ARG_MODIFIEROBJECT()
- //%GPB_UNSAFE_UNRETAINED ##
- //%PDDM-DEFINE DICTIONARY_COMMON_INTERFACE(KEY_NAME, KEY_TYPE, KisP, KHELPER, VALUE_NAME, VALUE_TYPE, VHELPER)
- //%#pragma mark - KEY_NAME -> VALUE_NAME
- //%
- //%@interface GPB##KEY_NAME##VALUE_NAME##Dictionary : NSObject <NSCopying>
- //%
- //%@property(nonatomic, readonly) NSUInteger count;
- //%
- //%+ (instancetype)dictionary;
- //%+ (instancetype)dictionaryWithValue:(VALUE_TYPE)value
- //% forKey:(KEY_TYPE##KisP$S##KisP)key;
- //%+ (instancetype)dictionaryWithValues:(const VALUE_TYPE ARRAY_ARG_MODIFIER##VHELPER()[])values
- //% forKeys:(const KEY_TYPE##KisP$S##KisP ARRAY_ARG_MODIFIER##KHELPER()[])keys
- //% count:(NSUInteger)count;
- //%+ (instancetype)dictionaryWithDictionary:(GPB##KEY_NAME##VALUE_NAME##Dictionary *)dictionary;
- //%+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems;
- //%
- //%- (instancetype)initWithValues:(const VALUE_TYPE ARRAY_ARG_MODIFIER##VHELPER()[])values
- //% forKeys:(const KEY_TYPE##KisP$S##KisP ARRAY_ARG_MODIFIER##KHELPER()[])keys
- //% count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
- //%- (instancetype)initWithDictionary:(GPB##KEY_NAME##VALUE_NAME##Dictionary *)dictionary;
- //%- (instancetype)initWithCapacity:(NSUInteger)numItems;
- //%
- //%DICTIONARY_IMMUTABLE_INTERFACE(KEY_NAME, KEY_TYPE, KisP, VALUE_NAME, VALUE_TYPE, VHELPER)
- //%
- //%- (void)addEntriesFromDictionary:(GPB##KEY_NAME##VALUE_NAME##Dictionary *)otherDictionary;
- //%
- //%DICTIONARY_MUTABLE_INTERFACE(KEY_NAME, KEY_TYPE, KisP, VALUE_NAME, VALUE_TYPE, VHELPER)
- //%
- //%@end
- //%
- //%PDDM-DEFINE DICTIONARY_KEY_TO_ENUM_INTERFACE(KEY_NAME, KEY_TYPE, KisP, KHELPER, VALUE_NAME, VALUE_TYPE)
- //%DICTIONARY_KEY_TO_ENUM_INTERFACE2(KEY_NAME, KEY_TYPE, KisP, KHELPER, VALUE_NAME, VALUE_TYPE, Enum)
- //%PDDM-DEFINE DICTIONARY_KEY_TO_ENUM_INTERFACE2(KEY_NAME, KEY_TYPE, KisP, KHELPER, VALUE_NAME, VALUE_TYPE, VHELPER)
- //%#pragma mark - KEY_NAME -> VALUE_NAME
- //%
- //%@interface GPB##KEY_NAME##VALUE_NAME##Dictionary : NSObject <NSCopying>
- //%
- //%@property(nonatomic, readonly) NSUInteger count;
- //%@property(nonatomic, readonly) GPBEnumValidationFunc validationFunc;
- //%
- //%+ (instancetype)dictionary;
- //%+ (instancetype)dictionaryWithValidationFunction:(GPBEnumValidationFunc)func;
- //%+ (instancetype)dictionaryWithValidationFunction:(GPBEnumValidationFunc)func
- //% rawValue:(VALUE_TYPE)rawValue
- //% forKey:(KEY_TYPE##KisP$S##KisP)key;
- //%+ (instancetype)dictionaryWithValidationFunction:(GPBEnumValidationFunc)func
- //% rawValues:(const VALUE_TYPE ARRAY_ARG_MODIFIER##VHELPER()[])values
- //% forKeys:(const KEY_TYPE##KisP$S##KisP ARRAY_ARG_MODIFIER##KHELPER()[])keys
- //% count:(NSUInteger)count;
- //%+ (instancetype)dictionaryWithDictionary:(GPB##KEY_NAME##VALUE_NAME##Dictionary *)dictionary;
- //%+ (instancetype)dictionaryWithValidationFunction:(GPBEnumValidationFunc)func
- //% capacity:(NSUInteger)numItems;
- //%
- //%- (instancetype)initWithValidationFunction:(GPBEnumValidationFunc)func;
- //%- (instancetype)initWithValidationFunction:(GPBEnumValidationFunc)func
- //% rawValues:(const VALUE_TYPE ARRAY_ARG_MODIFIER##VHELPER()[])values
- //% forKeys:(const KEY_TYPE##KisP$S##KisP ARRAY_ARG_MODIFIER##KHELPER()[])keys
- //% count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
- //%- (instancetype)initWithDictionary:(GPB##KEY_NAME##VALUE_NAME##Dictionary *)dictionary;
- //%- (instancetype)initWithValidationFunction:(GPBEnumValidationFunc)func
- //% capacity:(NSUInteger)numItems;
- //%
- //%// These will return kGPBUnrecognizedEnumeratorValue if the value for the key
- //%// is not a valid enumerator as defined by validationFunc. If the actual value is
- //%// desired, use "raw" version of the method.
- //%
- //%DICTIONARY_IMMUTABLE_INTERFACE(KEY_NAME, KEY_TYPE, KisP, VALUE_NAME, VALUE_TYPE, VHELPER)
- //%
- //%// These methods bypass the validationFunc to provide access to values that were not
- //%// known at the time the binary was compiled.
- //%
- //%- (BOOL)valueForKey:(KEY_TYPE##KisP$S##KisP)key rawValue:(VALUE_TYPE *)rawValue;
- //%
- //%- (void)enumerateKeysAndRawValuesUsingBlock:
- //% (void (^)(KEY_TYPE KisP##key, VALUE_TYPE rawValue, BOOL *stop))block;
- //%
- //%- (void)addRawEntriesFromDictionary:(GPB##KEY_NAME##VALUE_NAME##Dictionary *)otherDictionary;
- //%
- //%// If value is not a valid enumerator as defined by validationFunc, these
- //%// methods will assert in debug, and will log in release and assign the value
- //%// to the default value. Use the rawValue methods below to assign non enumerator
- //%// values.
- //%
- //%DICTIONARY_MUTABLE_INTERFACE(KEY_NAME, KEY_TYPE, KisP, VALUE_NAME, VALUE_TYPE, VHELPER)
- //%
- //%@end
- //%
- //%PDDM-DEFINE DICTIONARY_IMMUTABLE_INTERFACE(KEY_NAME, KEY_TYPE, KisP, VALUE_NAME, VALUE_TYPE, VHELPER)
- //%VALUE_FOR_KEY_##VHELPER(KEY_TYPE##KisP$S##KisP, VALUE_TYPE)
- //%
- //%- (void)enumerateKeysAndValuesUsingBlock:
- //% (void (^)(KEY_TYPE KisP##key, VALUE_TYPE value, BOOL *stop))block;
- //%PDDM-DEFINE DICTIONARY_MUTABLE_INTERFACE(KEY_NAME, KEY_TYPE, KisP, VALUE_NAME, VALUE_TYPE, VHELPER)
- //%- (void)setValue:(VALUE_TYPE)value forKey:(KEY_TYPE##KisP$S##KisP)key;
- //%DICTIONARY_EXTRA_MUTABLE_METHODS_##VHELPER(KEY_NAME, KEY_TYPE, KisP, VALUE_NAME, VALUE_TYPE)
- //%- (void)removeValueForKey:(KEY_TYPE##KisP$S##KisP)aKey;
- //%- (void)removeAll;
- //%PDDM-DEFINE DICTIONARY_EXTRA_MUTABLE_METHODS_POD(KEY_NAME, KEY_TYPE, KisP, VALUE_NAME, VALUE_TYPE)
- // Empty
- //%PDDM-DEFINE DICTIONARY_EXTRA_MUTABLE_METHODS_OBJECT(KEY_NAME, KEY_TYPE, KisP, VALUE_NAME, VALUE_TYPE)
- // Empty
- //%PDDM-DEFINE DICTIONARY_EXTRA_MUTABLE_METHODS_Enum(KEY_NAME, KEY_TYPE, KisP, VALUE_NAME, VALUE_TYPE)
- //%
- //%// This method bypass the validationFunc to provide setting of values that were not
- //%// known at the time the binary was compiled.
- //%- (void)setRawValue:(VALUE_TYPE)rawValue forKey:(KEY_TYPE##KisP$S##KisP)key;
- //%
- //%// No validation applies to these methods.
- //%
|