diff options
Diffstat (limited to 'lout/identity.cc')
-rw-r--r-- | lout/identity.cc | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/lout/identity.cc b/lout/identity.cc index 6fe679b4..c9cb7ece 100644 --- a/lout/identity.cc +++ b/lout/identity.cc @@ -17,8 +17,6 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ - - #include "identity.hh" #include <stdio.h> @@ -41,6 +39,22 @@ IdentifiableObject::Class::Class (IdentifiableObject::Class *parent, int id, this->className = className; } +void IdentifiableObject::Class::intoStringBuffer(misc::StringBuffer *sb) +{ + sb->append ("<class "); + sb->append (className); + sb->append (" ("); + sb->appendInt (id); + sb->append (")"); + + if (parent) { + sb->append (", parent: "); + parent->intoStringBuffer (sb); + } + + sb->append (">"); +} + HashTable <ConstString, IdentifiableObject::Class> *IdentifiableObject::classesByName = new HashTable<ConstString, IdentifiableObject::Class> (true, true); @@ -78,6 +92,7 @@ void IdentifiableObject::registerName (const char *className, int *classId) } this->classId = klass->id; + *classId = klass->id; currentlyConstructedClass = klass; } |