示例#1
0
文件: TEncoder.cpp 项目: x414e54/nano
	// Encode the object
	void EncodeSelf(NEncoder &theEncoder) const
	{	NArray			theArray;
		NDictionary		theDict;
		NData			theData;
		
		theData = NData(NN_ARRAY_SIZE(kValueData), kValueData);

		theArray.AppendValue(kValueBoolean1);
		theArray.AppendValue(kValueNumber1);
		theArray.AppendValue(kValueString);

		theDict.SetValue(kKeyBoolean1,  kValueBoolean1);
		theDict.SetValue(kKeyNumber1,   kValueNumber1);
		theDict.SetValue(kKeyString,    kValueString);
		theDict.SetValue(kKeyPoint,     kValuePoint);
		theDict.SetValue(kKeySize,      kValueSize);
		theDict.SetValue(kKeyRectangle, kValueRectangle);
	
		theEncoder.EncodeBoolean(kKeyBoolean1,   kValueBoolean1);
		theEncoder.EncodeBoolean(kKeyBoolean2,   kValueBoolean2);
		theEncoder.EncodeNumber( kKeyNumber1,    kValueNumber1);
		theEncoder.EncodeNumber( kKeyNumber2,    kValueNumber2);
		theEncoder.EncodeNumber( kKeyNumber3,    kValueNumber3);
		theEncoder.EncodeNumber( kKeyNumber4,    kValueNumber4);
		theEncoder.EncodeString( kKeyString,     kValueString);
		theEncoder.EncodeData(   kKeyData,       theData);
		theEncoder.EncodeObject( kKeyArray,      theArray);
		theEncoder.EncodeObject( kKeyDictionary, theDict);
	}
示例#2
0
文件: NURL.cpp 项目: refnum/nano
//============================================================================
//      NURL::EncodeSelf : Encode the object.
//----------------------------------------------------------------------------
void NURL::EncodeSelf(NEncoder &theEncoder) const
{


	// Encode the object
	theEncoder.EncodeString(kNEncoderValueKey, mValue);
}