Initial commit
This commit is contained in:
48
engines/dgds/debug_util.h
Normal file
48
engines/dgds/debug_util.h
Normal file
@@ -0,0 +1,48 @@
|
||||
/* ScummVM - Graphic Adventure Engine
|
||||
*
|
||||
* ScummVM is the legal property of its developers, whose names
|
||||
* are too numerous to list here. Please refer to the COPYRIGHT
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef DGDS_DEBUG_UTIL_H
|
||||
#define DGDS_DEBUG_UTIL_H
|
||||
|
||||
#include "common/str.h"
|
||||
|
||||
namespace Dgds {
|
||||
|
||||
namespace DebugUtil {
|
||||
|
||||
template<class C> static Common::String dumpStructList(const Common::String &indent, const Common::String &name, const C &list) {
|
||||
if (list.empty())
|
||||
return "";
|
||||
|
||||
const Common::String nextind = indent + " ";
|
||||
Common::String str = Common::String::format("\n%s%s=", Common::String(indent + " ").c_str(), name.c_str());
|
||||
for (const auto &s : list) {
|
||||
str += "\n";
|
||||
str += s.dump(nextind);
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
} // end namespace Dgds
|
||||
|
||||
#endif // DGDS_DEBUG_UTIL_H
|
||||
Reference in New Issue
Block a user