dbfiler.h 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695
  1. //
  2. #ifndef AD_DBFILER_H
  3. #define AD_DBFILER_H
  4. //
  5. //
  6. //////////////////////////////////////////////////////////////////////////////
  7. //
  8. // Copyright 2015 Autodesk, Inc. All rights reserved.
  9. //
  10. // Use of this software is subject to the terms of the Autodesk license
  11. // agreement provided at the time of installation or download, or which
  12. // otherwise accompanies this software in either electronic or hard copy form.
  13. //
  14. //////////////////////////////////////////////////////////////////////////////
  15. //
  16. // DBFILER.H -- AutoCAD Database Filer Definitions
  17. //
  18. // DESCRIPTION:
  19. //
  20. // This file contains "filer" class definitions, which are passed to
  21. // AcDbObject objects by their parent AcDbDatabase object to
  22. // perform I/O operations in various contexts.
  23. //
  24. // Common Filer Contracts are:
  25. //
  26. // 1. The Database object always controls the creation of the
  27. // filers, and passing them to objects. The Database object
  28. // itself surrounds filing calls with I/O of class name/ID/DXF_name
  29. // maps, and common object information such as class IDs/DXF names,
  30. // checksums, record lengths and other common record information.
  31. // The database object also handles file section and object
  32. // sentinels for database recovery purposes.
  33. //
  34. // 2. For different I/O contexts, 3 different sets of AcDbObject
  35. // members are defined: DXF, DWG File, and Paging
  36. // While DWG File and Paging members are supplied pagers of the
  37. // same abstract class, implementations of some members,
  38. // particularly those concerned with AcDbObjectId and AcDbHandle objects,
  39. // are very different. Usage contract differs as follows, reason being
  40. // that notification chains are NOT limited to database objects:
  41. //
  42. // Paging: For Notification chains, use "void" filer method to
  43. // save/restore pointer. Do not bother to pull out
  44. // of other notification chains.
  45. //
  46. // DWG file: Pull out of other notification chains, and record
  47. // what is needed for reconstruction.
  48. //
  49. // 3. The filer methods of AcDbObject subclasses are named the same
  50. // as the parent class's methods, with "Fields" appended (as in
  51. // dwgInFields()). Each such method (with a few exceptions in
  52. // class AcDbEntity) must invoke the same method in its parent
  53. // *before* performing any of its own filing actions.
  54. #include <stdarg.h>
  55. #include "AdAChar.h"
  56. #include "acdb.h"
  57. #include "gepnt2d.h"
  58. #include "gepnt3d.h"
  59. #include "gevec3d.h"
  60. #include "gescl3d.h"
  61. #include "adsdef.h"
  62. #include "AcString.h"
  63. #pragma pack (push, 8)
  64. class AcDbAuditInfo;
  65. class AcDbFilerController;
  66. class AcDbHandle;
  67. class AcDbIdRefQueue;
  68. class ADESK_NO_VTABLE AcDbDwgFiler: public AcRxObject
  69. //
  70. // Abstract class for DWG file and paging I/O. While protocol is virtually
  71. // the same, the implementations will be different, and so will usage. DWG
  72. // filer will do byte-reversal, and convert AcDbStub and AcDbHandle values
  73. // to/from char* values
  74. //
  75. // This will also stand as an abstract class for common R14, R13, and R12
  76. // backwards/forwards compatibility for DWG.
  77. //
  78. // The pager would presumably direct I/O, no conversions, and directly
  79. // copies"void*" values for things like pointers to reactor sets.
  80. //
  81. // Reactor sets will remain in memory when the underlying object is paged out,
  82. // while DWG I/O requires dissolution an entities presence on reactor chains
  83. // when written, and reconstruction of the same when read back in.
  84. //
  85. // For each filer data type Xxx, there is a pair of write functions
  86. // writeXxx(Xxx) and writeItem(Xxx). The writeItem() functions, defined
  87. // inline in terms of the writeXxx() functions, can be used when it is
  88. // convenient or appropriate to let the argument type determine which function
  89. // to call. The writeXxx() functions are pure-virtual, i.e., must be defined
  90. // by all concrete subclasses.
  91. //
  92. // The same applies to the read functions.
  93. //
  94. // Filers may also implement CRC accumulation.
  95. //
  96. {
  97. public:
  98. ACRX_DECLARE_MEMBERS(AcDbDwgFiler);
  99. AcDbDwgFiler();
  100. virtual ~AcDbDwgFiler();
  101. virtual Acad::ErrorStatus filerStatus() const = 0;
  102. virtual AcDb::FilerType filerType() const = 0;
  103. virtual void setFilerStatus(Acad::ErrorStatus es) = 0;
  104. virtual void resetFilerStatus() = 0;
  105. // version of the drawing file being read or written by this filer
  106. virtual Acad::ErrorStatus dwgVersion(AcDb::AcDbDwgVersion& ver,
  107. AcDb::MaintenanceReleaseVersion& maintVer) const;
  108. // readXxx() and writeXxx() functions
  109. //
  110. virtual Acad::ErrorStatus readHardOwnershipId(AcDbHardOwnershipId* pVal) = 0;
  111. virtual Acad::ErrorStatus writeHardOwnershipId(
  112. const AcDbHardOwnershipId& val) = 0;
  113. virtual Acad::ErrorStatus readSoftOwnershipId(AcDbSoftOwnershipId* pVal) = 0;
  114. virtual Acad::ErrorStatus writeSoftOwnershipId(
  115. const AcDbSoftOwnershipId& val) = 0;
  116. virtual Acad::ErrorStatus readHardPointerId(AcDbHardPointerId* pVal) = 0;
  117. virtual Acad::ErrorStatus writeHardPointerId(const AcDbHardPointerId& val) = 0;
  118. virtual Acad::ErrorStatus readSoftPointerId(AcDbSoftPointerId* pVal) = 0;
  119. virtual Acad::ErrorStatus writeSoftPointerId(const AcDbSoftPointerId& val) = 0;
  120. virtual Acad::ErrorStatus readInt8(Adesk::Int8* pVal) = 0;
  121. virtual Acad::ErrorStatus writeInt8(Adesk::Int8 val) = 0;
  122. // These are to be removed in a future release. Please use
  123. // readInt8 or writeInt8 instead.
  124. //
  125. // Todo: decide whether a readAChar() and writeAChar() are needed...
  126. inline Acad::ErrorStatus readChar(Adesk::Int8 *p) {
  127. return this->readInt8(p); }
  128. inline Acad::ErrorStatus writeChar(Adesk::Int8 c) {
  129. return this->writeInt8(c); }
  130. // Note: use of readString(ACHAR **) is discouraged, because
  131. // caller has to free the returned string. It may be phased
  132. // out in a future release.
  133. virtual Acad::ErrorStatus readString(ACHAR** pVal) = 0;
  134. virtual Acad::ErrorStatus writeString(const ACHAR* pVal) = 0;
  135. virtual Acad::ErrorStatus readString(AcString& val) = 0;
  136. virtual Acad::ErrorStatus writeString(const AcString& pVal) = 0;
  137. virtual Acad::ErrorStatus readBChunk(ads_binary* pVal) = 0;
  138. virtual Acad::ErrorStatus writeBChunk(const ads_binary&) = 0;
  139. virtual Acad::ErrorStatus readAcDbHandle(AcDbHandle* pVal) = 0;
  140. virtual Acad::ErrorStatus writeAcDbHandle(const AcDbHandle& val) = 0;
  141. virtual Acad::ErrorStatus readInt64(Adesk::Int64* pVal) = 0;
  142. virtual Acad::ErrorStatus writeInt64(Adesk::Int64 val) = 0;
  143. virtual Acad::ErrorStatus readInt32(Adesk::Int32* pVal) = 0;
  144. virtual Acad::ErrorStatus writeInt32(Adesk::Int32 val) = 0;
  145. virtual Acad::ErrorStatus readInt16(Adesk::Int16* pVal) = 0;
  146. virtual Acad::ErrorStatus writeInt16(Adesk::Int16 val) = 0;
  147. virtual Acad::ErrorStatus readUInt64(Adesk::UInt64* pVal) = 0;
  148. virtual Acad::ErrorStatus writeUInt64(Adesk::UInt64 val) = 0;
  149. virtual Acad::ErrorStatus readUInt32(Adesk::UInt32* pVal) = 0;
  150. virtual Acad::ErrorStatus writeUInt32(Adesk::UInt32 val) = 0;
  151. virtual Acad::ErrorStatus readUInt16(Adesk::UInt16* pVal) = 0;
  152. virtual Acad::ErrorStatus writeUInt16(Adesk::UInt16 val) = 0;
  153. virtual Acad::ErrorStatus readUInt8(Adesk::UInt8* pVal) = 0;
  154. virtual Acad::ErrorStatus writeUInt8(Adesk::UInt8 val) = 0;
  155. virtual Acad::ErrorStatus readBoolean(Adesk::Boolean* pVal) = 0;
  156. virtual Acad::ErrorStatus writeBoolean(Adesk::Boolean val) = 0;
  157. virtual Acad::ErrorStatus readBool(bool* pVal) = 0;
  158. virtual Acad::ErrorStatus writeBool(bool val) = 0;
  159. virtual Acad::ErrorStatus readDouble(double* pVal) = 0;
  160. virtual Acad::ErrorStatus writeDouble(double val) = 0;
  161. virtual Acad::ErrorStatus readPoint2d(AcGePoint2d* pVal) = 0;
  162. virtual Acad::ErrorStatus writePoint2d(const AcGePoint2d& val) = 0;
  163. virtual Acad::ErrorStatus readPoint3d(AcGePoint3d* pVal) = 0;
  164. virtual Acad::ErrorStatus writePoint3d(const AcGePoint3d& val) = 0;
  165. virtual Acad::ErrorStatus readVector2d(AcGeVector2d* pVal) = 0;
  166. virtual Acad::ErrorStatus writeVector2d(const AcGeVector2d& val) = 0;
  167. virtual Acad::ErrorStatus readVector3d(AcGeVector3d* pVal) = 0;
  168. virtual Acad::ErrorStatus writeVector3d(const AcGeVector3d& val) = 0;
  169. virtual Acad::ErrorStatus readScale3d(AcGeScale3d* pVal) = 0;
  170. virtual Acad::ErrorStatus writeScale3d(const AcGeScale3d& val) = 0;
  171. virtual Acad::ErrorStatus readBytes(void* pDest, Adesk::UIntPtr nBytes) = 0;
  172. virtual Acad::ErrorStatus writeBytes(const void* pSrc, Adesk::UIntPtr nBytes) = 0;
  173. virtual Acad::ErrorStatus readAddress(void ** pVal);
  174. virtual Acad::ErrorStatus writeAddress(const void * pVal);
  175. // readItem() and writeItem() functions
  176. //
  177. Acad::ErrorStatus readItem(AcDbHardOwnershipId* pId);
  178. Acad::ErrorStatus writeItem(const AcDbHardOwnershipId& id);
  179. Acad::ErrorStatus readItem(AcDbSoftOwnershipId* pId);
  180. Acad::ErrorStatus writeItem(const AcDbSoftOwnershipId& id);
  181. Acad::ErrorStatus readItem(AcDbHardPointerId* pId);
  182. Acad::ErrorStatus writeItem(const AcDbHardPointerId& id);
  183. Acad::ErrorStatus readItem(AcDbSoftPointerId* pId);
  184. Acad::ErrorStatus writeItem(const AcDbSoftPointerId& id);
  185. // Note: there are no filer methods for explicitly reading or
  186. // writing a single text character. There are readChar() and
  187. // writeChar(), but these do not do any code page translation
  188. // on the data. I.e., they treat it as a signed 8-bit
  189. // integer value. Since they are thus the same as readInt8()
  190. // and writeInt8(), they are being deprecated.
  191. //
  192. Acad::ErrorStatus readItem(ACHAR** pVal);
  193. Acad::ErrorStatus writeItem(const ACHAR* val);
  194. #ifndef _MSC_VER
  195. Acad::ErrorStatus writeItem(const AcString& val);
  196. Acad::ErrorStatus writeItem(const CString& val);
  197. #endif
  198. Acad::ErrorStatus readItem(ads_binary* pVal);
  199. Acad::ErrorStatus writeItem(const ads_binary& val);
  200. Acad::ErrorStatus readItem(AcDbHandle* pVal);
  201. Acad::ErrorStatus writeItem(const AcDbHandle& val);
  202. Acad::ErrorStatus readItem(Adesk::Int32* pVal);
  203. Acad::ErrorStatus writeItem(Adesk::Int32 val);
  204. Acad::ErrorStatus readItem(Adesk::Int16* pVal);
  205. Acad::ErrorStatus writeItem(Adesk::Int16 val);
  206. Acad::ErrorStatus readItem(Adesk::Int8* pVal);
  207. Acad::ErrorStatus writeItem(Adesk::Int8 val);
  208. Acad::ErrorStatus readItem(Adesk::UInt32* pVal);
  209. Acad::ErrorStatus writeItem(Adesk::UInt32 val);
  210. Acad::ErrorStatus readItem(Adesk::UInt16* pVal);
  211. Acad::ErrorStatus writeItem(Adesk::UInt16 val);
  212. Acad::ErrorStatus readItem(Adesk::UInt8* pVal);
  213. Acad::ErrorStatus writeItem(Adesk::UInt8 val);
  214. Acad::ErrorStatus readItem(Adesk::Boolean* pVal);
  215. Acad::ErrorStatus writeItem(Adesk::Boolean val);
  216. #if !defined(Adesk_Boolean_is_bool)
  217. // We only need this when Adesk_Boolean_is_bool is
  218. // not defined since we have it covered already in
  219. // the Adesk::Boolean overload.
  220. Acad::ErrorStatus readItem(bool* pVal);
  221. Acad::ErrorStatus writeItem(bool val);
  222. #endif
  223. Acad::ErrorStatus readItem(double* pVal);
  224. Acad::ErrorStatus writeItem(double val);
  225. Acad::ErrorStatus readItem(AcGePoint2d* pVal);
  226. Acad::ErrorStatus writeItem(const AcGePoint2d& val);
  227. Acad::ErrorStatus readItem(AcGePoint3d* pVal);
  228. Acad::ErrorStatus writeItem(const AcGePoint3d& val);
  229. Acad::ErrorStatus readItem(AcGeVector2d* pVal);
  230. Acad::ErrorStatus writeItem(const AcGeVector2d& val);
  231. Acad::ErrorStatus readItem(AcGeVector3d* pVal);
  232. Acad::ErrorStatus writeItem(const AcGeVector3d& val);
  233. Acad::ErrorStatus readItem(AcGeScale3d* pVal);
  234. Acad::ErrorStatus writeItem(const AcGeScale3d& val);
  235. Acad::ErrorStatus readItem(void* pDest, Adesk::UIntPtr nBytes);
  236. Acad::ErrorStatus writeItem(const void* pSrc, Adesk::UIntPtr nBytes);
  237. Acad::ErrorStatus readItem(void** pp);
  238. Acad::ErrorStatus writeItem(const void* p);
  239. virtual Acad::ErrorStatus seek(Adesk::Int64 nOffset, int nMethod) = 0;
  240. virtual Adesk::Int64 tell() const = 0;
  241. virtual Acad::ErrorStatus addReferences(AcDbIdRefQueue& /*qToAbsorb*/);
  242. virtual bool usesReferences() const;
  243. virtual AcDbAuditInfo * getAuditInfo() const;
  244. virtual AcDbFilerController& controller() const;
  245. private:
  246. AcDbDwgFiler & operator = (const AcDbDwgFiler &); // supress C4512 as we have a reference as data member
  247. AcDbFilerController& mController;
  248. };
  249. class ADESK_NO_VTABLE AcDbDxfFiler: public AcRxObject
  250. {
  251. public:
  252. ACRX_DECLARE_MEMBERS(AcDbDxfFiler);
  253. virtual int rewindFiler() = 0;
  254. virtual Acad::ErrorStatus filerStatus() const = 0;
  255. virtual void resetFilerStatus() = 0;
  256. virtual Acad::ErrorStatus setError(Acad::ErrorStatus es, const ACHAR* errMsg, ...);
  257. virtual Acad::ErrorStatus setError(const ACHAR* errMsg, ...);
  258. virtual const ACHAR* errorMessage() const;
  259. virtual AcDb::FilerType filerType() const = 0;
  260. // working database being read or written by this filer
  261. virtual AcDbDatabase* database() const = 0;
  262. // version of the drawing file being read or written by this filer
  263. virtual Acad::ErrorStatus dwgVersion(AcDb::AcDbDwgVersion& ver,
  264. AcDb::MaintenanceReleaseVersion& maintVer) const;
  265. virtual int precision() const;
  266. virtual void setPrecision(int prec);
  267. // Number of decimal digits printed in ASCII DXF file
  268. //
  269. enum { kDfltPrec = -1, kMaxPrec = 16 };
  270. // readXxx and writeXxx functions
  271. //
  272. virtual Acad::ErrorStatus readResBuf (resbuf* pRb);
  273. virtual Acad::ErrorStatus writeResBuf (const resbuf& rb);
  274. virtual Acad::ErrorStatus writeObjectId(AcDb::DxfCode code,
  275. const AcDbObjectId& id) = 0;
  276. virtual Acad::ErrorStatus writeInt8 (AcDb::DxfCode code, Adesk::Int8) = 0;
  277. // This is to be removed in a future release
  278. inline Acad::ErrorStatus writeChar (AcDb::DxfCode c, Adesk::Int8 n) {
  279. return this->writeInt8(c, n); }
  280. virtual Acad::ErrorStatus writeString (AcDb::DxfCode code, const ACHAR* pVal) = 0;
  281. virtual Acad::ErrorStatus writeString (AcDb::DxfCode code, const AcString& pVal) = 0;
  282. virtual Acad::ErrorStatus writeBChunk (AcDb::DxfCode code, const ads_binary& val) = 0;
  283. virtual Acad::ErrorStatus writeAcDbHandle(AcDb::DxfCode code,
  284. const AcDbHandle& val) = 0;
  285. virtual Acad::ErrorStatus writeInt64 (AcDb::DxfCode code, Adesk::Int64 val) = 0;
  286. virtual Acad::ErrorStatus writeInt32 (AcDb::DxfCode code, Adesk::Int32 val) = 0;
  287. virtual Acad::ErrorStatus writeInt16 (AcDb::DxfCode code, Adesk::Int16 val) = 0;
  288. virtual Acad::ErrorStatus writeUInt64 (AcDb::DxfCode code, Adesk::UInt64 val) = 0;
  289. virtual Acad::ErrorStatus writeUInt32 (AcDb::DxfCode code, Adesk::UInt32 val) = 0;
  290. virtual Acad::ErrorStatus writeUInt16 (AcDb::DxfCode code, Adesk::UInt16 val) = 0;
  291. virtual Acad::ErrorStatus writeUInt8 (AcDb::DxfCode code, Adesk::UInt8 val) = 0;
  292. virtual Acad::ErrorStatus writeBoolean (AcDb::DxfCode code, Adesk::Boolean val) = 0;
  293. virtual Acad::ErrorStatus writeBool (AcDb::DxfCode code, bool val) = 0;
  294. virtual Acad::ErrorStatus writeDouble (AcDb::DxfCode code, double val,
  295. int prec = kDfltPrec) = 0;
  296. virtual Acad::ErrorStatus writePoint2d (AcDb::DxfCode code, const AcGePoint2d& val,
  297. int prec = kDfltPrec) = 0;
  298. virtual Acad::ErrorStatus writePoint3d (AcDb::DxfCode code, const AcGePoint3d& val,
  299. int prec = kDfltPrec) = 0;
  300. virtual Acad::ErrorStatus writeVector2d(AcDb::DxfCode code, const AcGeVector2d& val,
  301. int prec = kDfltPrec) = 0;
  302. virtual Acad::ErrorStatus writeVector3d(AcDb::DxfCode code, const AcGeVector3d& val,
  303. int prec = kDfltPrec) = 0;
  304. virtual Acad::ErrorStatus writeScale3d (AcDb::DxfCode code, const AcGeScale3d& val,
  305. int prec = kDfltPrec) = 0;
  306. // readItem and writeItem functions
  307. //
  308. Acad::ErrorStatus readItem (resbuf* pItem);
  309. Acad::ErrorStatus writeItem (const resbuf& pItem);
  310. Acad::ErrorStatus writeItem (AcDb::DxfCode dc, const AcDbObjectId& id);
  311. Acad::ErrorStatus writeItem (AcDb::DxfCode dc, const ACHAR* val);
  312. #ifndef _MSC_VER
  313. Acad::ErrorStatus writeItem (AcDb::DxfCode dc, const AcString& val);
  314. Acad::ErrorStatus writeItem (AcDb::DxfCode dc, const CString& val);
  315. #endif
  316. Acad::ErrorStatus writeItem (AcDb::DxfCode dc, const ads_binary& val);
  317. Acad::ErrorStatus writeItem (AcDb::DxfCode dc, const AcDbHandle& val);
  318. Acad::ErrorStatus writeItem (AcDb::DxfCode dc, Adesk::Int32 val);
  319. Acad::ErrorStatus writeItem (AcDb::DxfCode dc, Adesk::Int16 val);
  320. Acad::ErrorStatus writeItem (AcDb::DxfCode dc, Adesk::Int8 val);
  321. Acad::ErrorStatus writeItem (AcDb::DxfCode dc, Adesk::UInt32 val);
  322. Acad::ErrorStatus writeItem (AcDb::DxfCode dc, Adesk::UInt16 val);
  323. Acad::ErrorStatus writeItem (AcDb::DxfCode dc, Adesk::UInt8 val);
  324. #ifndef Adesk_Boolean_is_bool
  325. // CAUTION: "int" parameters go to writeBoolean when Adesk_Boolean_is_bool
  326. // is not defined. When it is defined, the bool overload handles this
  327. // case.
  328. Acad::ErrorStatus writeItem (AcDb::DxfCode dc, Adesk::Boolean val);
  329. #endif
  330. Acad::ErrorStatus writeItem (AcDb::DxfCode dc, bool val);
  331. Acad::ErrorStatus writeItem (AcDb::DxfCode dc, double val, int = kDfltPrec);
  332. Acad::ErrorStatus writeItem (AcDb::DxfCode dc, const AcGePoint2d& val,
  333. int prec = kDfltPrec);
  334. Acad::ErrorStatus writeItem (AcDb::DxfCode dc, const AcGePoint3d& val,
  335. int prec = kDfltPrec);
  336. Acad::ErrorStatus writeItem (AcDb::DxfCode dc, const AcGeVector2d& val,
  337. int prec = kDfltPrec);
  338. Acad::ErrorStatus writeItem (AcDb::DxfCode dc, const AcGeVector3d& val,
  339. int prec = kDfltPrec);
  340. Acad::ErrorStatus writeItem (AcDb::DxfCode dc, const AcGeScale3d& val,
  341. int prec = kDfltPrec);
  342. virtual Acad::ErrorStatus writeXDataStart ();
  343. virtual bool includesDefaultValues() const = 0;
  344. virtual Acad::ErrorStatus pushBackItem();
  345. virtual bool atEOF();
  346. virtual bool atSubclassData(const ACHAR* subClassName);
  347. virtual bool atExtendedData();
  348. virtual bool atEndOfObject();
  349. virtual void haltAtClassBoundaries(bool halt);
  350. virtual Acad::ErrorStatus writeEmbeddedObjectStart();
  351. virtual bool atEmbeddedObjectStart();
  352. virtual double elevation() const;
  353. virtual double thickness() const;
  354. virtual bool isModifyingExistingObject() const;
  355. AcDbDxfFiler();
  356. virtual ~AcDbDxfFiler();
  357. AcDbFilerController& controller() const;
  358. private:
  359. AcDbDxfFiler & operator = (const AcDbDxfFiler &); // supress C4512 as we have a reference as data member
  360. AcDbFilerController& mController;
  361. virtual Acad::ErrorStatus setVAError(Acad::ErrorStatus, const ACHAR *,
  362. va_list);
  363. };
  364. inline Acad::ErrorStatus AcDbDwgFiler::readItem(AcDbHardOwnershipId* pId)
  365. { return readHardOwnershipId(pId); }
  366. inline Acad::ErrorStatus AcDbDwgFiler::writeItem(const AcDbHardOwnershipId& pId)
  367. { return writeHardOwnershipId(pId); }
  368. inline Acad::ErrorStatus AcDbDwgFiler::readItem(AcDbSoftOwnershipId* pId)
  369. { return readSoftOwnershipId(pId); }
  370. inline Acad::ErrorStatus AcDbDwgFiler::writeItem(const AcDbSoftOwnershipId& pId)
  371. { return writeSoftOwnershipId(pId); }
  372. inline Acad::ErrorStatus AcDbDwgFiler::readItem(AcDbHardPointerId* pId)
  373. { return readHardPointerId(pId); }
  374. inline Acad::ErrorStatus AcDbDwgFiler::writeItem(const AcDbHardPointerId& pId)
  375. { return writeHardPointerId(pId); }
  376. inline Acad::ErrorStatus AcDbDwgFiler::readItem(AcDbSoftPointerId* pId)
  377. { return readSoftPointerId(pId); }
  378. inline Acad::ErrorStatus AcDbDwgFiler::writeItem(const AcDbSoftPointerId& pId)
  379. { return writeSoftPointerId(pId); }
  380. inline Acad::ErrorStatus AcDbDwgFiler::readItem(ACHAR ** pVal)
  381. { return readString(pVal); }
  382. inline Acad::ErrorStatus AcDbDwgFiler::writeItem(const ACHAR * val)
  383. { return writeString(val); }
  384. inline Acad::ErrorStatus AcDbDwgFiler::readItem(ads_binary* pVal)
  385. { return readBChunk(pVal); }
  386. inline Acad::ErrorStatus AcDbDwgFiler::writeItem(const ads_binary& val)
  387. { return writeBChunk(val); }
  388. inline Acad::ErrorStatus AcDbDwgFiler::readItem(AcDbHandle* pVal)
  389. { return readAcDbHandle(pVal); }
  390. inline Acad::ErrorStatus AcDbDwgFiler::writeItem(const AcDbHandle& val)
  391. { return writeAcDbHandle(val); }
  392. inline Acad::ErrorStatus AcDbDwgFiler::readItem(Adesk::Int32* pVal)
  393. { return readInt32(pVal); }
  394. inline Acad::ErrorStatus AcDbDwgFiler::writeItem(Adesk::Int32 val)
  395. { return writeInt32(val); }
  396. inline Acad::ErrorStatus AcDbDwgFiler::readItem(Adesk::Int16* pVal)
  397. { return readInt16(pVal); }
  398. inline Acad::ErrorStatus AcDbDwgFiler::writeItem(Adesk::Int16 val)
  399. { return writeInt16(val); }
  400. inline Acad::ErrorStatus AcDbDwgFiler::readItem(Adesk::Int8 * pVal)
  401. { return this->readInt8(pVal); }
  402. inline Acad::ErrorStatus AcDbDwgFiler::writeItem(Adesk::Int8 val)
  403. { return this->writeInt8(val); }
  404. inline Acad::ErrorStatus AcDbDwgFiler::readItem(Adesk::UInt32* pVal)
  405. { return readUInt32(pVal); }
  406. inline Acad::ErrorStatus AcDbDwgFiler::writeItem(Adesk::UInt32 val)
  407. { return writeUInt32(val); }
  408. inline Acad::ErrorStatus AcDbDwgFiler::readItem(Adesk::UInt16* pVal)
  409. { return readUInt16(pVal); }
  410. inline Acad::ErrorStatus AcDbDwgFiler::writeItem(Adesk::UInt16 val)
  411. { return writeUInt16(val); }
  412. inline Acad::ErrorStatus AcDbDwgFiler::readItem(Adesk::UInt8* pVal)
  413. { return readUInt8(pVal); }
  414. inline Acad::ErrorStatus AcDbDwgFiler::writeItem(Adesk::UInt8 val)
  415. { return writeUInt8(val); }
  416. #if !defined(Adesk_Boolean_is_bool)
  417. inline Acad::ErrorStatus AcDbDwgFiler::readItem(Adesk::Boolean* pVal)
  418. { return readBoolean(pVal); }
  419. inline Acad::ErrorStatus AcDbDwgFiler::writeItem(Adesk::Boolean val)
  420. { return writeBoolean(val); }
  421. #endif
  422. inline Acad::ErrorStatus AcDbDwgFiler::readItem(bool* pVal)
  423. { return readBool(pVal); }
  424. inline Acad::ErrorStatus AcDbDwgFiler::writeItem(bool val)
  425. { return writeBool(val); }
  426. inline Acad::ErrorStatus AcDbDwgFiler::readItem(double* pVal)
  427. { return readDouble(pVal); }
  428. inline Acad::ErrorStatus AcDbDwgFiler::writeItem(double val)
  429. { return writeDouble(val); }
  430. inline Acad::ErrorStatus AcDbDwgFiler::readItem(AcGePoint2d* pVal)
  431. { return readPoint2d(pVal); }
  432. inline Acad::ErrorStatus AcDbDwgFiler::writeItem(const AcGePoint2d& val)
  433. { return writePoint2d(val); }
  434. inline Acad::ErrorStatus AcDbDwgFiler::readItem(AcGePoint3d* pVal)
  435. { return readPoint3d(pVal); }
  436. inline Acad::ErrorStatus AcDbDwgFiler::writeItem(const AcGePoint3d& val)
  437. { return writePoint3d(val); }
  438. inline Acad::ErrorStatus AcDbDwgFiler::readItem(AcGeVector2d* pVal)
  439. { return readVector2d(pVal); }
  440. inline Acad::ErrorStatus AcDbDwgFiler::writeItem(const AcGeVector2d& val)
  441. { return writeVector2d(val); }
  442. inline Acad::ErrorStatus AcDbDwgFiler::readItem(AcGeVector3d* pVal)
  443. { return readVector3d(pVal); }
  444. inline Acad::ErrorStatus AcDbDwgFiler::writeItem(const AcGeVector3d& val)
  445. { return writeVector3d(val); }
  446. inline Acad::ErrorStatus AcDbDwgFiler::readItem(AcGeScale3d* pVal)
  447. { return readScale3d(pVal); }
  448. inline Acad::ErrorStatus AcDbDwgFiler::writeItem(const AcGeScale3d& val)
  449. { return writeScale3d(val); }
  450. inline Acad::ErrorStatus AcDbDwgFiler::readItem(void *buf, Adesk::UIntPtr cnt)
  451. { return readBytes(buf, cnt); }
  452. inline Acad::ErrorStatus
  453. AcDbDwgFiler::writeItem(const void *buf, Adesk::UIntPtr cnt)
  454. { return writeBytes(buf, cnt); }
  455. inline Acad::ErrorStatus AcDbDwgFiler::readItem(void **pp)
  456. { return readAddress(pp); }
  457. inline Acad::ErrorStatus
  458. AcDbDwgFiler::writeItem(const void *p)
  459. { return writeAddress(p); }
  460. inline Acad::ErrorStatus
  461. AcDbDxfFiler::readItem(resbuf* pVal)
  462. { return readResBuf(pVal); }
  463. inline Acad::ErrorStatus
  464. AcDbDxfFiler::writeItem(const resbuf& val)
  465. { return writeResBuf(val); }
  466. inline Acad::ErrorStatus
  467. AcDbDxfFiler::writeItem(AcDb::DxfCode dc, const AcDbObjectId& id)
  468. { return writeObjectId(dc, id); }
  469. inline Acad::ErrorStatus
  470. AcDbDxfFiler::writeItem(AcDb::DxfCode dc, const ACHAR * val)
  471. { return writeString(dc, val); }
  472. inline Acad::ErrorStatus
  473. AcDbDxfFiler::writeItem(AcDb::DxfCode dc, const ads_binary& val)
  474. { return writeBChunk(dc, val); }
  475. inline Acad::ErrorStatus
  476. AcDbDxfFiler::writeItem(AcDb::DxfCode dc, const AcDbHandle& val)
  477. { return writeAcDbHandle(dc, val); }
  478. inline Acad::ErrorStatus
  479. AcDbDxfFiler::writeItem(AcDb::DxfCode dc, Adesk::Int32 val)
  480. { return writeInt32(dc, val); }
  481. inline Acad::ErrorStatus
  482. AcDbDxfFiler::writeItem(AcDb::DxfCode dc, Adesk::Int16 val)
  483. { return writeInt16(dc, val); }
  484. inline Acad::ErrorStatus
  485. AcDbDxfFiler::writeItem(AcDb::DxfCode dc, Adesk::Int8 val)
  486. { return this->writeInt8(dc, val); }
  487. inline Acad::ErrorStatus
  488. AcDbDxfFiler::writeItem(AcDb::DxfCode dc, Adesk::UInt32 val)
  489. { return writeUInt32(dc, val); }
  490. inline Acad::ErrorStatus
  491. AcDbDxfFiler::writeItem(AcDb::DxfCode dc, Adesk::UInt16 val)
  492. { return writeUInt16(dc, val); }
  493. inline Acad::ErrorStatus
  494. AcDbDxfFiler::writeItem(AcDb::DxfCode dc, Adesk::UInt8 val)
  495. { return writeUInt8(dc, val); }
  496. #if !defined(Adesk_Boolean_is_bool)
  497. inline Acad::ErrorStatus
  498. AcDbDxfFiler::writeItem(AcDb::DxfCode dc, Adesk::Boolean val)
  499. { return writeBoolean(dc, val); }
  500. #endif
  501. inline Acad::ErrorStatus
  502. AcDbDxfFiler::writeItem(AcDb::DxfCode dc, bool val)
  503. { return writeBool(dc, val); }
  504. inline Acad::ErrorStatus
  505. AcDbDxfFiler::writeItem(AcDb::DxfCode dc, double val, int prec)
  506. { return writeDouble(dc, val, prec); }
  507. inline Acad::ErrorStatus
  508. AcDbDxfFiler::writeItem(AcDb::DxfCode dc, const AcGePoint2d& val, int prec)
  509. { return writePoint2d(dc, val, prec); }
  510. inline Acad::ErrorStatus
  511. AcDbDxfFiler::writeItem(AcDb::DxfCode dc, const AcGePoint3d& val, int prec)
  512. { return writePoint3d(dc, val, prec); }
  513. inline Acad::ErrorStatus
  514. AcDbDxfFiler::writeItem(AcDb::DxfCode dc, const AcGeVector2d& val, int prec)
  515. { return writeVector2d(dc, val, prec); }
  516. inline Acad::ErrorStatus
  517. AcDbDxfFiler::writeItem(AcDb::DxfCode dc, const AcGeVector3d& val, int prec)
  518. { return writeVector3d(dc, val, prec); }
  519. inline Acad::ErrorStatus
  520. AcDbDxfFiler::writeItem(AcDb::DxfCode dc, const AcGeScale3d& val, int prec)
  521. { return writeScale3d(dc, val, prec); }
  522. #ifndef _MSC_VER
  523. inline Acad::ErrorStatus AcDbDwgFiler::writeItem(const AcString & val)
  524. { return writeString(val); }
  525. inline Acad::ErrorStatus AcDbDwgFiler::writeItem(const CString & val)
  526. { return writeString((const ACHAR*)val); }
  527. inline Acad::ErrorStatus
  528. AcDbDxfFiler::writeItem(AcDb::DxfCode dc, const AcString & val)
  529. { return writeString(dc, val); }
  530. inline Acad::ErrorStatus
  531. AcDbDxfFiler::writeItem(AcDb::DxfCode dc, const CString & val)
  532. { return writeString(dc, (const ACHAR*)val); }
  533. #endif
  534. #pragma pack (pop)
  535. #endif