Exemplo n.º 1
0
void AMFWriter::beginObject(const string& type,bool externalizable) {
	(UInt32&)lastReference=0;
	if(!_amf3) {
		if(amf0Preference && !externalizable) {
			_lastObjectReferences.push_back(0);
			if(type.empty())
				writer.write8(AMF_BEGIN_OBJECT);
			else {
				writer.write8(AMF_BEGIN_TYPED_OBJECT);
				write(type);
			}
			return;
		}
		writer.write8(AMF_AVMPLUS_OBJECT);
		_amf3=true;
	}
	writer.write8(AMF3_OBJECT);
	_references.push_back(AMF3_OBJECT);
	(UInt32&)lastReference=_references.size();
	_lastObjectReferences.push_back(lastReference);


	UInt32 flags = 1; // inner object
	
	// ClassDef always inline (because never hard properties, all is dynamic)
	// _references.push_back(0);
	flags|=(1<<1);
	if(externalizable)
		flags|=(1<<2);
	else
		flags|=(1<<3); // Always dynamic, but can't be externalizable AND dynamic!


	/* TODO?
	if(externalizable) {
		// What follows is the value of the “inner” object
	} else if(hardProperties>0 && !pClassDef) {
		// The remaining integer-data represents the number of class members that exist.
		// If there is a class-def reference there are no property names and the number of values is equal to the number of properties in the class-def
		flags |= (hardProperties<<4);
	}*/

	writer.write7BitValue(flags);
	writePropertyName(type);
}
Exemplo n.º 2
0
void DataWriter::writeStringProperty(const string& name,const string& value) {
	writePropertyName(name);
	writeString(value);
}
Exemplo n.º 3
0
void DataWriter::writeBooleanProperty(const string& name,bool value) {
	writePropertyName(name);
	writeBoolean(value);
}
Exemplo n.º 4
0
void DataWriter::writeNumberProperty(const string& name,double value) {
	writePropertyName(name);
	writeNumber(value);
}
Exemplo n.º 5
0
void DataWriter::writeDateProperty(const string& name,const Time& date) {
	writePropertyName(name);
	writeDate(date);
}
Exemplo n.º 6
0
void DataWriter::writeNullProperty(const string& name) {
	writePropertyName(name);
	writeNull();
}
Exemplo n.º 7
0
void AMFWriter::writeObjectProperty(const string& name) {
	writePropertyName(name);
	writeNull();
}
Exemplo n.º 8
0
void AMFWriter::writeObjectProperty(const string& name,const string& value) {
	writePropertyName(name);
	write(value);
}
Exemplo n.º 9
0
void AMFWriter::writeObjectProperty(const string& name,const vector<UInt8>& data) {
	writePropertyName(name);
	writeByteArray(data);
}
Exemplo n.º 10
0
void AMFWriter::writeObjectProperty(const string& name,Int32 value) {
	writePropertyName(name);
	writeInteger(value);
}
Exemplo n.º 11
0
void AMFWriter::writeObjectProperty(const string& name,double value) {
	writePropertyName(name);
	writeNumber(value);
}
Exemplo n.º 12
0
void AMFWriter::writeObjectProperty(const string& name,const Timestamp& date) {
	writePropertyName(name);
	writeDate(date);
}