libassa
3.5.1
Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
assa
MemDump.h
Go to the documentation of this file.
1
// -*- c++ -*-
2
//------------------------------------------------------------------------------
3
// MemDump.h
4
//------------------------------------------------------------------------------
5
// Copyright (c) 1995 by Vladislav Grinchenko
6
//
7
// This library is free software; you can redistribute it and/or
8
// modify it under the terms of the GNU Library General Public
9
// License as published by the Free Software Foundation; either
10
// version 2 of the License, or (at your option) any later version.
11
//
12
// Permission to use, copy, modify, and distribute this software
13
// and its documentation for any purpose and without fee is hereby
14
// granted, provided that the above copyright notice appear in all
15
// copies. The author makes no representations about the suitability
16
// of this software for any purpose. It is provided "as is" without
17
// express or implied warranty.
18
//------------------------------------------------------------------------------
19
// Creation Date: November 25, 1995
20
//------------------------------------------------------------------------------
21
#ifndef MEM_DUMP_H
22
#define MEM_DUMP_H
23
24
#include <stdio.h>
25
#include <string.h>
26
27
namespace
ASSA {
28
40
class
MemDump
41
{
42
private
:
44
char
*
m_dump
;
45
47
static
const
char
m_empty_str
[];
48
49
public
:
58
MemDump
(
const
char
* msg_,
int
len_);
59
61
~MemDump
();
62
66
const
char
*
getMemDump
()
const
;
67
75
static
void
dump_to_log
(
unsigned
long
mask_,
76
const
char
* info_,
77
const
char
* msg_,
78
int
len_);
79
};
80
81
82
inline
83
MemDump::
84
~MemDump
()
85
{
86
if
(
m_dump
&&
m_dump
!=
m_empty_str
) {
87
delete
[]
m_dump
;
88
}
89
m_dump
= NULL;
90
}
91
92
inline
const
char
*
93
MemDump::
94
getMemDump
()
const
95
{
96
return
(
m_dump
? (
const
char
*)
m_dump
:
m_empty_str
);
97
}
98
99
}
// end namespace ASSA
100
101
#endif
/* MEM_DUMP_H */
Generated on Tue Jun 19 2012 09:59:46 for libassa by
1.8.1.1