File diff r25112:699b6bc8aeaa → r25113:f0d6acc5740e
src/misc/array.hpp
Show inline comments
 
@@ -8,13 +8,13 @@
 
/** @file array.hpp Array without an explicit maximum size. */
 

	
 
#ifndef ARRAY_HPP
 
#define ARRAY_HPP
 

	
 
#include "fixedsizearray.hpp"
 
#include "str.hpp"
 
#include "../string_func.h"
 

	
 
/**
 
 * Flexible array with size limit. Implemented as fixed size
 
 *  array of fixed size arrays
 
 */
 
template <class T, uint B = 1024, uint N = B>
 
@@ -100,19 +100,19 @@ public:
 
	/**
 
	 * Helper for creating a human readable output of this data.
 
	 * @param dmp The location to dump to.
 
	 */
 
	template <typename D> void Dump(D &dmp) const
 
	{
 
		dmp.WriteLine("capacity = %d", Tcapacity);
 
		dmp.WriteValue("capacity", Tcapacity);
 
		uint num_items = Length();
 
		dmp.WriteLine("num_items = %d", num_items);
 
		CStrA name;
 
		dmp.WriteValue("num_items", num_items);
 
		for (uint i = 0; i < num_items; i++) {
 
			const T &item = (*this)[i];
 
			name.Format("item[%d]", i);
 
			dmp.WriteStructT(name.Data(), &item);
 
			char name[32];
 
			seprintf(name, lastof(name), "item[%d]", i);
 
			dmp.WriteStructT(name, &item);
 
		}
 
	}
 
};
 

	
 
#endif /* ARRAY_HPP */