summaryrefslogtreecommitdiff
path: root/src/misc
diff options
context:
space:
mode:
authorKUDr <kudr@openttd.org>2007-06-29 23:45:13 +0000
committerKUDr <kudr@openttd.org>2007-06-29 23:45:13 +0000
commitc37dc87ad2392c52628b24a2c281f784852372b0 (patch)
treee40b1c0408670ce5543e72064145c4f7559c5004 /src/misc
parenta88a1b6f5305971f1f357048c636d3a85b23cb70 (diff)
downloadopenttd-c37dc87ad2392c52628b24a2c281f784852372b0.tar.xz
(svn r10392) -Add [YAPF]: added structured dump support into some essential YAPF classes (node-list, nodes, keys, etc.) and CArrayT
Diffstat (limited to 'src/misc')
-rw-r--r--src/misc/array.hpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/misc/array.hpp b/src/misc/array.hpp
index 220082da5..a88b6cbe9 100644
--- a/src/misc/array.hpp
+++ b/src/misc/array.hpp
@@ -68,6 +68,19 @@ public:
const Titem& item = sa [idx % Tblock_size];
return item;
}
+
+ template <typename D> void Dump(D &dmp) const
+ {
+ dmp.WriteLine("capacity = %d", Tcapacity);
+ int num_items = Size();
+ dmp.WriteLine("num_items = %d", num_items);
+ CStrA name;
+ for (int i = 0; i < num_items; i++) {
+ const Titem& item = (*this)[i];
+ name.Format("item[%d]", i);
+ dmp.WriteStructT(name.Data(), &item);
+ }
+ }
};
#endif /* ARRAY_HPP */