Add some documentation about the workings of the attribute system.

(I hope I figured it out all correct)


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5574 dfc29bdd-3216-0410-991c-e03cc46cb475
master
cutealien 2017-11-08 22:19:35 +00:00
parent 7a87a77a8a
commit 413a5b2504
3 changed files with 11 additions and 2 deletions

View File

@ -13,7 +13,7 @@ namespace io
{ {
/* /*
basic types Basic types, check documentation in IAttribute.h to see how they generally work.
*/ */
// Attribute implemented for boolean values // Attribute implemented for boolean values

View File

@ -31,6 +31,15 @@ namespace irr
namespace io namespace io
{ {
// All derived attribute types implement at least getter/setter for their own type (like CBoolAttribute will have setBool/getBool).
// Simple types will also implement getStringW and setString, but don't expect it to work for all types.
// String serialization makes no sense for some attribute-types (like stringw arrays or pointers), but is still useful for many types.
// (Note: I do _not_ know yet why the default string serialization is asymmetric with char* in set and wchar_t* in get).
// Additionally many attribute types will implement conversion functions like CBoolAttribute has p.E. getInt/setInt().
// The reason for conversion functions is likely to make reading old formats easier which have changed in the meantime. For example
// an old xml can contain a bool attribute which is an int in a newer format. You can still call getInt() even thought the attribute has the wrong type.
// And please do _not_ confuse these attributes here with the ones used in the xml-reader (aka SAttribute which is just a key-value pair).
class IAttribute : public virtual IReferenceCounted class IAttribute : public virtual IReferenceCounted
{ {
public: public:

View File

@ -1,4 +1,4 @@
Tests finished. 1 test of 1 passed. Tests finished. 1 test of 1 passed.
Compiled as DEBUG Compiled as DEBUG
Test suite pass at GMT Tue Nov 7 00:00:50 2017 Test suite pass at GMT Tue Nov 7 00:42:08 2017