VR-Link API Documentation for HLA 1.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
vlPrintUtil.h
Go to the documentation of this file.
1 /*********************************************************************
2 ** Copyright (c) 1992-2010 VT MAK
3 ** All rights reserved.
4 *********************************************************************/
8 #pragma once
9 
10 #include "vlMachineTypes.h"
11 #include "vlString.h"
12 #include <iostream>
13 
14 #ifdef DtUSE_UTILITIES_NAMESPACE
15 namespace DtUSE_UTILITIES_NAMESPACE
16 {
17 #endif
18 
19 class DtString;
20 
27  std::ostream &stream, const DtString& string, int padTo = 20);
28 
32 template <typename T>
33 void DtPrintAttribute(std::ostream &stream, const char* label,T obj)
34 {
35  DtPrintAndIndent(stream, label);
36  stream << obj << std::endl;
37 }
38 
41 DT_DLL_VLUTIL void DtPrintAttribute(std::ostream &stream, const char* label, bool obj);
42 
45 DT_DLL_VLUTIL void DtPrintAttribute(std::ostream& stream, const char* label, DtU8 obj);
46 
49 DT_DLL_VLUTIL void DtPrintAttribute(std::ostream &stream, const char *label, const char *enumStr, int enumNum);
50 
51 
55 DT_DLL_VLUTIL void DtDumpHexBytes(const char *label, const void *bytes, int size);
58  std::ostream &stream, const char*label, const void *bytes, int size);
59 
63 DT_DLL_VLUTIL void DtDumpLineOfHex(std::ostream& stream, DtU8 *address, size_t num_bytes);
67 DT_DLL_VLUTIL void DtDumpHex(std::ostream& str, const char * address, size_t num_bytes);
68 
72  std::ostream &stream, const char *label, DtU32 word);
73 
77 DT_DLL_VLUTIL void DtDumpHexWord(const char *label, DtU32 word);
78 
85 DT_DLL_VLUTIL void DtDumpEnum(const char *label, const char *enumStr, int enumNum);
86 
90 DT_DLL_VLUTIL void DtDumpInteger(const char *label, long i);
91 
96 DT_DLL_VLUTIL void DtDumpFloat(const char *label, double f);
97 
102 DT_DLL_VLUTIL void DtDumpString(const char *label, const char *string);
103 
108 DT_DLL_VLUTIL void DtDumpString(const char *label, const DtString &string);
109 
110 
115 DT_DLL_VLUTIL void DtDumpBoolean(const char *label, bool val, int onlyIfTrue = 0);
116 
117 #ifdef DtUSE_UTILITIES_NAMESPACE
118 }
119 #endif
120 
121 
122 
123 
124 
125 
126 
127 
128 
129 
130 
void DtDumpHex(std::ostream &str, const char *address, size_t num_bytes)
Prints to stream a byte buffer, neatly seperating bytes and putting only 4 bytes on a line...
Contains the DtString class declaration.
void DtDumpString(const char *label, const char *string)
formats and prints a string next to a label using the DtInfo Stream.
void DtPrintAttribute(std::ostream &stream, const char *label, T obj)
Prints out a value of type T with a label.
Definition: vlPrintUtil.h:33
void DtDumpInteger(const char *label, long i)
formats and prints an integer next to a label using the DtInfo Stream.
void DtDumpHexBytes(const char *label, const void *bytes, int size)
These functions DtDumpHexBytes and DtDumpHexWord print hex output to the DtInfo stream.
void DtDumpFloat(const char *label, double f)
formats and prints a floating point value next to a label using the DtInfo Stream.
void DtPrintAttributeHex(std::ostream &stream, const char *label, const void *bytes, int size)
void DtPrintAndIndent(std::ostream &stream, const DtString &string, int padTo=20)
prints the string to the stream, then it adds spaces to fill to padTo.
unsigned char DtU8
An eight bit unsigned integer value.
Definition: vlMachineTypes.h:137
void DtDumpBoolean(const char *label, bool val, int onlyIfTrue=0)
formats and prints a boolean value next to a label using the DtInfo Stream.
void DtDumpEnum(const char *label, const char *enumStr, int enumNum)
DtDumpEnum prints a label, a enumeration string, and an enumeration value.
unsigned long DtU32
A 32 bit unsigned integer value.
Definition: vlMachineTypes.h:153
void DtDumpHexWord(const char *label, DtU32 word)
Prints a DtU32 word to DtInfo.
Instances of DtString are used to represent strings.
Definition: vlString.h:29
virtual int size() const
size() - returns the length of the string not including the terminating &#39;\0&#39;
void DtDumpLineOfHex(std::ostream &stream, DtU8 *address, size_t num_bytes)
Prints to stream one line (with a newline at the end) of hex data grouped by bytes.
This file contains typedefs for machine dependant types.
#define DT_DLL_VLUTIL
Definition: vlMachineTypes.h:109

Document ID: Generated on Mon Apr 25 03:39:01 EDT 2022 from SVN revision 242502
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)