]> git.lizzy.rs Git - irrlicht.git/blob - include/IAttributeExchangingObject.h
Fix bug introduced in last merge from svn trunk
[irrlicht.git] / include / IAttributeExchangingObject.h
1 // Copyright (C) 2002-2012 Nikolaus Gebhardt\r
2 // This file is part of the "Irrlicht Engine".\r
3 // For conditions of distribution and use, see copyright notice in irrlicht.h\r
4 \r
5 #ifndef __I_ATTRIBUTE_EXCHANGING_OBJECT_H_INCLUDED__\r
6 #define __I_ATTRIBUTE_EXCHANGING_OBJECT_H_INCLUDED__\r
7 \r
8 #include "IReferenceCounted.h"\r
9 \r
10 \r
11 namespace irr\r
12 {\r
13 \r
14 namespace io\r
15 {\r
16 \r
17 class IAttributes;\r
18 \r
19 //! Enumeration flags passed through SAttributeReadWriteOptions to the IAttributeExchangingObject object\r
20 enum E_ATTRIBUTE_READ_WRITE_FLAGS\r
21 {\r
22         //! Serialization/Deserializion is done for an xml file\r
23         EARWF_FOR_FILE = 0x00000001,\r
24 \r
25         //! Serialization/Deserializion is done for an editor property box\r
26         EARWF_FOR_EDITOR = 0x00000002,\r
27 \r
28         //! When writing filenames, relative paths should be used\r
29         EARWF_USE_RELATIVE_PATHS = 0x00000004\r
30 };\r
31 \r
32 \r
33 //! struct holding data describing options\r
34 struct SAttributeReadWriteOptions\r
35 {\r
36         //! Constructor\r
37         SAttributeReadWriteOptions()\r
38                 : Flags(0), Filename(0)\r
39         {\r
40         }\r
41 \r
42         //! Combination of E_ATTRIBUTE_READ_WRITE_FLAGS or other, custom ones\r
43         s32 Flags;\r
44 \r
45         //! Optional filename\r
46         const fschar_t* Filename;\r
47 };\r
48 \r
49 \r
50 //! An object which is able to serialize and deserialize its attributes into an attributes object\r
51 class IAttributeExchangingObject : virtual public IReferenceCounted\r
52 {\r
53 public:\r
54 \r
55         //! Writes attributes of the object.\r
56         /** Implement this to expose the attributes of your scene node animator for\r
57         scripting languages, editors, debuggers or xml serialization purposes. */\r
58         virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options=0) const {}\r
59 \r
60         //! Reads attributes of the object.\r
61         /** Implement this to set the attributes of your scene node animator for\r
62         scripting languages, editors, debuggers or xml deserialization purposes. */\r
63         virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options=0) {}\r
64 \r
65 };\r
66 \r
67 } // end namespace io\r
68 } // end namespace irr\r
69 \r
70 #endif\r
71 \r