Pin
Classes | Functions
Utilities for formatting strings

Classes

struct  LEVEL_BASE::DECSTR
 
struct  LEVEL_BASE::HEXSTR
 
struct  LEVEL_BASE::FLTSTR
 

Functions

VOID LEVEL_BASE::SetAddress0x (BOOL val)
 
BOOL LEVEL_BASE::CharIsSpace (CHAR c)
 
CHAR LEVEL_BASE::CharToUpper (CHAR c)
 
std::string LEVEL_BASE::ptrstr (const VOID *val)
 
std::string LEVEL_BASE::StringFromAddrint (ADDRINT l)
 
std::string LEVEL_BASE::StringFromUint64 (UINT64 l)
 
std::string LEVEL_BASE::StringDec (UINT64 l, UINT32 digits, CHAR padding)
 
std::string LEVEL_BASE::StringDecSigned (INT64 l, UINT32 digits, CHAR padding)
 
std::string LEVEL_BASE::StringBignum (INT64 l, UINT32 digits, CHAR padding)
 
std::string LEVEL_BASE::Reformat (const std::string &s, const std::string &prefix, UINT32 min_line, UINT32 max_line)
 
std::string LEVEL_BASE::StringHex32 (UINT32 l, UINT32 digits, BOOL prefix_0x)
 
std::string LEVEL_BASE::StringBool (BOOL b)
 
std::string LEVEL_BASE::StringTri (TRI t)
 
std::string LEVEL_BASE::StringHex (UINT32 l, UINT32 digits, BOOL prefix_0x=TRUE)
 
std::string LEVEL_BASE::decstr (INT64 val, UINT32 width=0)
 
std::string LEVEL_BASE::decstr (INT32 val, UINT32 width=0)
 
std::string LEVEL_BASE::decstr (INT16 val, UINT32 width=0)
 
std::string LEVEL_BASE::decstr (UINT64 val, UINT32 width=0)
 
std::string LEVEL_BASE::decstr (UINT32 val, UINT32 width=0)
 
std::string LEVEL_BASE::decstr (UINT16 val, UINT32 width=0)
 
std::string LEVEL_BASE::hexstr (INT64 val, UINT32 width=0)
 
std::string LEVEL_BASE::hexstr (INT32 val, UINT32 width=0)
 
std::string LEVEL_BASE::hexstr (INT16 val, UINT32 width=0)
 
std::string LEVEL_BASE::hexstr (UINT64 val, UINT32 width=0)
 
std::string LEVEL_BASE::hexstr (VOID *p, UINT32 width=0)
 
std::string LEVEL_BASE::hexstr (const VOID *p, UINT32 width=0)
 
std::string LEVEL_BASE::hexstr (UINT32 val, UINT32 width=0)
 
std::string LEVEL_BASE::hexstr (UINT16 val, UINT32 width=0)
 
std::string LEVEL_BASE::ljstr (const std::string &s, UINT32 width, CHAR padding=' ')
 
std::string LEVEL_BASE::StringFlt (FLT64 val, UINT32 precision, UINT32 width)
 
std::string LEVEL_BASE::fltstr (FLT64 val, UINT32 prec=0, UINT32 width=0)
 

Detailed Description

Availability:
Mode: JIT & Probe
O/S: Linux & Windows
CPU: All

Function Documentation

◆ CharIsSpace()

BOOL LEVEL_BASE::CharIsSpace ( CHAR  c)

ctype::isspace alternative (avoids complications from including ctype.h).

◆ CharToUpper()

CHAR LEVEL_BASE::CharToUpper ( CHAR  c)

ctype::toupper alternative (avoids complications from including ctype.h).

◆ decstr() [1/6]

std::string LEVEL_BASE::decstr ( INT64  val,
UINT32  width = 0 
)

Create a string containing the given decimal integer.

◆ decstr() [2/6]

std::string LEVEL_BASE::decstr ( INT32  val,
UINT32  width = 0 
)

Create a string containing the given decimal integer.

◆ decstr() [3/6]

std::string LEVEL_BASE::decstr ( INT16  val,
UINT32  width = 0 
)

Create a string containing the given decimal integer.

◆ decstr() [4/6]

std::string LEVEL_BASE::decstr ( UINT64  val,
UINT32  width = 0 
)

Create a string containing the given decimal integer.

◆ decstr() [5/6]

std::string LEVEL_BASE::decstr ( UINT32  val,
UINT32  width = 0 
)

Create a string containing the given decimal integer.

◆ decstr() [6/6]

std::string LEVEL_BASE::decstr ( UINT16  val,
UINT32  width = 0 
)

Create a string containing the given decimal integer.

◆ fltstr()

std::string LEVEL_BASE::fltstr ( FLT64  val,
UINT32  prec = 0,
UINT32  width = 0 
)

Create a string containing the given floating point number.

◆ hexstr() [1/8]

std::string LEVEL_BASE::hexstr ( INT64  val,
UINT32  width = 0 
)

Create a string with a hexadecimal prefix containing the given hexadecimal integer.

◆ hexstr() [2/8]

std::string LEVEL_BASE::hexstr ( INT32  val,
UINT32  width = 0 
)

Create a string with a hexadecimal prefix containing the given hexadecimal integer.

◆ hexstr() [3/8]

std::string LEVEL_BASE::hexstr ( INT16  val,
UINT32  width = 0 
)

Create a string with a hexadecimal prefix containing the given hexadecimal integer.

◆ hexstr() [4/8]

std::string LEVEL_BASE::hexstr ( UINT64  val,
UINT32  width = 0 
)

Create a string with a hexadecimal prefix containing the given hexadecimal integer.

◆ hexstr() [5/8]

std::string LEVEL_BASE::hexstr ( VOID *  p,
UINT32  width = 0 
)

Create a string with a hexadecimal prefix containing the given hexadecimal integer.

◆ hexstr() [6/8]

std::string LEVEL_BASE::hexstr ( const VOID *  p,
UINT32  width = 0 
)

Create a string with a hexadecimal prefix containing the given hexadecimal integer.

◆ hexstr() [7/8]

std::string LEVEL_BASE::hexstr ( UINT32  val,
UINT32  width = 0 
)

Create a string with a hexadecimal prefix containing the given hexadecimal integer.

◆ hexstr() [8/8]

std::string LEVEL_BASE::hexstr ( UINT16  val,
UINT32  width = 0 
)

Create a string with a hexadecimal prefix containing the given hexadecimal integer.

◆ ljstr()

std::string LEVEL_BASE::ljstr ( const std::string &  s,
UINT32  width,
CHAR  padding = ' ' 
)

Left justify string.

◆ ptrstr()

std::string LEVEL_BASE::ptrstr ( const VOID *  val)

Print pointer.

◆ Reformat()

std::string LEVEL_BASE::Reformat ( const std::string &  s,
const std::string &  prefix,
UINT32  min_line,
UINT32  max_line 
)

Add new lines to string to make it fit given line width restrictions.

◆ SetAddress0x()

VOID LEVEL_BASE::SetAddress0x ( BOOL  val)

Set mode for printing of addresses, two formats are available either 0x12345678 or #1234_5678.

◆ StringBignum()

std::string LEVEL_BASE::StringBignum ( INT64  l,
UINT32  digits,
CHAR  padding 
)

Convert a INT64 into a dec string with 1000 separation . Padding can be specified as well.

◆ StringBool()

std::string LEVEL_BASE::StringBool ( BOOL  b)

Convert a BOOL into a string.

◆ StringDec()

std::string LEVEL_BASE::StringDec ( UINT64  l,
UINT32  digits,
CHAR  padding 
)

Convert a UINT64 into a dec string. Padding can be specified as well.

◆ StringDecSigned()

std::string LEVEL_BASE::StringDecSigned ( INT64  l,
UINT32  digits,
CHAR  padding 
)

Convert a INT64 into a dec string. Padding can be specified as well.

◆ StringFlt()

std::string LEVEL_BASE::StringFlt ( FLT64  val,
UINT32  precision,
UINT32  width 
)

Convert a FLT64 into a string. Padding can be specified as well.

◆ StringFromAddrint()

std::string LEVEL_BASE::StringFromAddrint ( ADDRINT  l)

Convert a ADDRINT into a string using the hex address format.

◆ StringFromUint64()

std::string LEVEL_BASE::StringFromUint64 ( UINT64  l)

Convert a UINT64 into a string using the hex address format.

◆ StringHex()

std::string LEVEL_BASE::StringHex ( UINT32  l,
UINT32  digits,
BOOL  prefix_0x = TRUE 
)

Create a string with a hexadecimal prefix containing the given hexadecimal integer.

◆ StringHex32()

std::string LEVEL_BASE::StringHex32 ( UINT32  l,
UINT32  digits,
BOOL  prefix_0x 
)

Convert a UINT32 into a hex string. Padding can be specified as well.

◆ StringTri()

std::string LEVEL_BASE::StringTri ( TRI  t)

Convert a TRI into a string.