File tree Expand file tree Collapse file tree 3 files changed +24
-0
lines changed
Expand file tree Collapse file tree 3 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -135,6 +135,22 @@ Value * Value::valueWithUnsignedCharValue(unsigned char value)
135135
136136// /////////////////////
137137
138+ Value * Value::valueWithShortValue (short value)
139+ {
140+ Value * result = new Value ();
141+ result->mType = VALUE_TYPE_SHORT_VALUE;
142+ result->mValue .shortValue = value;
143+ return (Value *) result->autorelease ();
144+ }
145+
146+ Value * Value::valueWithUnsignedShortValue (unsigned short value)
147+ {
148+ Value * result = new Value ();
149+ result->mType = VALUE_TYPE_UNSIGNED_SHORT_VALUE;
150+ result->mValue .unsignedShortValue = value;
151+ return (Value *) result->autorelease ();
152+ }
153+
138154Value * Value::valueWithIntValue (int value)
139155{
140156 Value * result = new Value ();
Original file line number Diff line number Diff line change @@ -36,6 +36,8 @@ namespace mailcore {
3636 static Value * valueWithBoolValue (bool value);
3737 static Value * valueWithCharValue (char value);
3838 static Value * valueWithUnsignedCharValue (unsigned char value);
39+ static Value * valueWithShortValue (short value);
40+ static Value * valueWithUnsignedShortValue (unsigned short value);
3941 static Value * valueWithIntValue (int value);
4042 static Value * valueWithUnsignedIntValue (unsigned int value);
4143 static Value * valueWithLongValue (long value);
Original file line number Diff line number Diff line change @@ -72,6 +72,12 @@ + (NSNumber *) mco_valueWithMCValue:(mailcore::Value *)value
7272 else if (strcmp ([self objCType ], @encode (unsigned char )) == 0 ) {
7373 return mailcore::Value::valueWithUnsignedCharValue ([nb unsignedCharValue ]);
7474 }
75+ else if (strcmp ([self objCType ], @encode (short )) == 0 ) {
76+ return mailcore::Value::valueWithShortValue ([nb shortValue ]);
77+ }
78+ else if (strcmp ([self objCType ], @encode (unsigned short )) == 0 ) {
79+ return mailcore::Value::valueWithUnsignedShortValue ([nb unsignedShortValue ]);
80+ }
7581 else if (strcmp ([self objCType ], @encode (int )) == 0 ) {
7682 return mailcore::Value::valueWithIntValue ([nb intValue ]);
7783 }
You can’t perform that action at this time.
0 commit comments