大多数文件管理器调用都是针对所有受支持的数据类型重载的成员函数。还有其他函数(如以下示例中使用的函数)可用于支持自动类型转换。此类函数强制将参数视为指定类型,而不考虑其在内存中的实际类型。writeItem()writeInt32() 注意:如果类具有整数数据成员,则需要使用显式声明整数大小的读取和写入函数(例如,)。writeInt32
以下是以下示例代码:AsdkPoly::dwgOutFields() Acad::ErrorStatus AsdkPoly::dwgOutFields(AcDbDwgFiler* filer) const { assertReadEnabled(); Acad::ErrorStatus es; if ((es = AcDbCurve::dwgOutFields(filer)) != Acad::eOk) { return es; } // Object Version - must always be the first item. // Adesk::Int16 version = VERSION; filer->writeItem(version); filer->writePoint2d(mCenter); filer->writePoint2d(mStartPoint); filer->writeInt32(mNumSides); filer->writeVector3d(mPlaneNormal); filer->writeString(mpName); // mTextStyle is a hard pointer id, so filing it out to // the purge filer (kPurgeFiler) prevents purging of // this object. // filer->writeHardPointerId(mTextStyle); filer->writeDouble(mElevation); return filer->filerStatus(); } |
|Archiver|CAD开发者社区 ( 苏ICP备2022047690号-1 苏公网安备32011402011833)
GMT+8, 2025-1-8 19:24
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.