]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/include/lldb/Core/IOStreamMacros.h
Merge llvm, clang, lld and lldb trunk r291274, and resolve conflicts.
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / lldb / include / lldb / Core / IOStreamMacros.h
1 //===-- IOStreamMacros.h ----------------------------------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 #ifndef liblldb_IOStreamMacros_h_
11 #define liblldb_IOStreamMacros_h_
12 #if defined(__cplusplus)
13
14 #include <iomanip>
15
16 #define RAW_HEXBASE std::setfill('0') << std::hex << std::right
17 #define HEXBASE '0' << 'x' << RAW_HEXBASE
18 #define RAWHEX8(x) RAW_HEXBASE << std::setw(2) << ((uint32_t)(x))
19 #define RAWHEX16 RAW_HEXBASE << std::setw(4)
20 #define RAWHEX32 RAW_HEXBASE << std::setw(8)
21 #define RAWHEX64 RAW_HEXBASE << std::setw(16)
22 #define HEX8(x) HEXBASE << std::setw(2) << ((uint32_t)(x))
23 #define HEX16 HEXBASE << std::setw(4)
24 #define HEX32 HEXBASE << std::setw(8)
25 #define HEX64 HEXBASE << std::setw(16)
26 #define RAW_HEX(x) RAW_HEXBASE << std::setw(sizeof(x) * 2) << (x)
27 #define HEX(x) HEXBASE << std::setw(sizeof(x) * 2) << (x)
28 #define HEX_SIZE(x, sz) HEXBASE << std::setw((sz)) << (x)
29 #define STRING_WIDTH(w) std::setfill(' ') << std::setw(w)
30 #define LEFT_STRING_WIDTH(s, w)                                                \
31   std::left << std::setfill(' ') << std::setw(w) << (s) << std::right
32 #define DECIMAL std::dec << std::setfill(' ')
33 #define DECIMAL_WIDTH(w) DECIMAL << std::setw(w)
34 //#define FLOAT(n, d)       std::setfill(' ') << std::setw((n)+(d)+1) <<
35 //std::setprecision(d) << std::showpoint << std::fixed
36 #define INDENT_WITH_SPACES(iword_idx)                                          \
37   std::setfill(' ') << std::setw((iword_idx)) << ""
38 #define INDENT_WITH_TABS(iword_idx)                                            \
39   std::setfill('\t') << std::setw((iword_idx)) << ""
40
41 #endif // #if defined(__cplusplus)
42 #endif // liblldb_IOStreamMacros_h_