MIRA
Hexdump.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012 by
3  * MetraLabs GmbH (MLAB), GERMANY
4  * and
5  * Neuroinformatics and Cognitive Robotics Labs (NICR) at TU Ilmenau, GERMANY
6  * All rights reserved.
7  *
8  * Redistribution and modification of this code is strictly prohibited.
9  *
10  * IN NO EVENT SHALL "MLAB" OR "NICR" BE LIABLE TO ANY PARTY FOR DIRECT,
11  * INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF
12  * THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF "MLAB" OR
13  * "NICR" HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14  *
15  * "MLAB" AND "NICR" SPECIFICALLY DISCLAIM ANY WARRANTIES, INCLUDING,
16  * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
17  * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
18  * ON AN "AS IS" BASIS, AND "MLAB" AND "NICR" HAVE NO OBLIGATION TO
19  * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS OR MODIFICATIONS.
20  */
21 
30 #ifndef _MIRA_HEXDUMP_H_
31 #define _MIRA_HEXDUMP_H_
32 
33 #include <iostream>
34 #include <utils/Buffer.h>
35 
36 namespace mira {
37 
39 
45 MIRA_BASE_EXPORT void hexdump(std::ostream& stream, const uint8* bytes, std::size_t length);
46 
50 template <typename T>
51 inline void hexdump(std::ostream& stream, const Buffer<T>& buffer) {
52  hexdump(stream, (uint8*)buffer.data(), buffer.sizeInBytes());
53 }
54 
56 
57 } // namespace
58 
59 #endif
specialize cv::DataType for our ImgPixel and inherit from cv::DataType<Vec>
Definition: IOService.h:67
size_type sizeInBytes() const
Returns the used size in bytes.
Definition: Buffer.h:298
pointer data()
Returns a pointer to the underlying data.
Definition: Buffer.h:514
Generic buffer class that can be used as a replacement for std::vector whenever copying and reallocat...
Definition: Buffer.h:84
#define MIRA_BASE_EXPORT
This is required because on windows there is a macro defined called ERROR.
Definition: Platform.h:153
Generic buffer class that can be used as a replacement for std::vector.
MIRA_BASE_EXPORT void hexdump(std::ostream &stream, const uint8 *bytes, std::size_t length)
Prints a buffer as hexdump to the specified stream.