当前位置: 首页>>代码示例>>C++>>正文


C++ ObjectOutputStream::writeInt方法代码示例

本文整理汇总了C++中ObjectOutputStream::writeInt方法的典型用法代码示例。如果您正苦于以下问题:C++ ObjectOutputStream::writeInt方法的具体用法?C++ ObjectOutputStream::writeInt怎么用?C++ ObjectOutputStream::writeInt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ObjectOutputStream的用法示例。


在下文中一共展示了ObjectOutputStream::writeInt方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: changeVariableData

ObjectOutputStream* ObjectVersionUpdateManager::changeVariableData(const uint32& variableHashCode, ObjectInputStream* object, Stream* newVariableData) {
	int offset = getVariableDataOffset(variableHashCode, object);

	if (offset == -1)
		return NULL;

	ObjectOutputStream* newData = new ObjectOutputStream(object->size());
	object->copy(newData);

	object->reset();
	newData->reset();
	object->shiftOffset(offset - 4);
	uint32 dataSize = object->readInt();

	newData->shiftOffset(offset); //we go data length

	if (dataSize > 0)
		newData->removeRange(offset, offset + dataSize);

	newData->writeInt(offset - 4, newVariableData->size());
	newData->insertStream(newVariableData, newVariableData->size(), offset);

	object->reset();
	//newData->reset();

	return newData;
}
开发者ID:Mesagoppinmypants,项目名称:mtgserver,代码行数:27,代码来源:ObjectVersionUpdateManager.cpp

示例2: serializeElement

void Element::serializeElement(ObjectOutputStream& out)
{
	XOJ_CHECK_TYPE(Element);

	out.writeObject("Element");

	out.writeDouble(this->x);
	out.writeDouble(this->y);
	out.writeInt(this->color);

	out.endObject();
}
开发者ID:project-renard-survey,项目名称:xournalpp,代码行数:12,代码来源:Element.cpp

示例3: serialize

void EditSelection::serialize(ObjectOutputStream & out) {
	out.writeObject("EditSelection");

	out.writeDouble(this->x);
	out.writeDouble(this->y);
	out.writeDouble(this->width);
	out.writeDouble(this->height);

	out << this->contents;
	out.endObject();

	ListIterator<Element *> it = this->getElements();
	int count = it.getLength();
	out.writeInt(count);

	while (it.hasNext()) {
		Element * e = it.next();
		out << e;
	}
}
开发者ID:wbrenna,项目名称:xournalpp,代码行数:20,代码来源:EditSelection.cpp

示例4: addVariable

ObjectOutputStream* ObjectVersionUpdateManager::addVariable(String variableName, ObjectInputStream* object, Stream* newVariableData){
	object->reset();

	uint16 oldVariableCount = object->readShort();
	//info("first variable count is " + String::valueOf(oldVariableCount),true);
	ObjectOutputStream* newData = new ObjectOutputStream(object->size());
	object->copy(newData, 0);

	newData->writeShort(0, oldVariableCount + 1);
	newData->setOffset(newData->size());


	uint32 _nameHashCode = variableName.hashCode();
	TypeInfo<uint32>::toBinaryStream(&_nameHashCode, newData);
	newData->writeInt(newVariableData->size());
	newData->writeStream(newVariableData);

	return newData;


}
开发者ID:Mesagoppinmypants,项目名称:mtgserver,代码行数:21,代码来源:ObjectVersionUpdateManager.cpp

示例5: writeObject

void DObject::writeObject (ObjectOutputStream& out) const
{
    out.writeInt(oid);
}
开发者ID:691739159,项目名称:narya,代码行数:4,代码来源:DObject.cpp


注:本文中的ObjectOutputStream::writeInt方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。