0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-11-30 00:56:44 +01:00
mongodb/util/goodies.h
2007-11-04 16:35:08 -05:00

26 lines
450 B
C++

// goodies.h
// miscellaneous junk
#pragma once
#include "../stdafx.h"
inline void dumpmemory(const char *data, int len) {
try {
const char *q = data;
const char *p = q;
while( len > 0 ) {
for( int i = 0; i < 16; i++ ) {
cout << (*p >= 32 && *p <= 126) ? *p : '.';
p++;
}
cout << " ";
for( int i = 0; i < 16; i++ )
cout << (unsigned) *p << ' ';
cout << endl;
len -= 16;
}
} catch(...) { }
}