Open CASCADE Technology  7.4.0
Static Public Member Functions

Standard_Dump Class Reference

This interface has some tool methods for stream (in JSON format) processing. More...

#include <Standard_Dump.hxx>

Static Public Member Functions

static TCollection_AsciiString Text (const Standard_SStream &theStream)
 Converts stream value to string value. The result is original stream value. More...
 
static TCollection_AsciiString FormatJson (const Standard_SStream &theStream, const Standard_Integer theIndent=3)
 Converts stream value to string value. Improves the text presentation with the following cases: More...
 
static void AddValuesSeparator (Standard_OStream &theOStream)
 Add Json values separator if the stream last symbol is not an open brace. More...
 
static TCollection_AsciiString GetPointerPrefix ()
 Returns default prefix added for each pointer info string if short presentation of pointer used. More...
 
static TCollection_AsciiString GetPointerInfo (const Handle< Standard_Transient > &thePointer, const bool isShortInfo=true)
 Convert handle pointer to address of the pointer. If the handle is NULL, the result is an empty string. More...
 
static TCollection_AsciiString GetPointerInfo (const void *thePointer, const bool isShortInfo=true)
 Convert pointer to address of the pointer. If the handle is NULL, the result is an empty string. More...
 
static void DumpKeyToClass (Standard_OStream &theOStream, const char *theKey, const TCollection_AsciiString &theField)
 Append into output value: "Name": { Field }. More...
 
static void DumpCharacterValues (Standard_OStream &theOStream, int theCount,...)
 Unite values in one value using template: "value_1", "value_2", ..., "value_n". More...
 
static void DumpRealValues (Standard_OStream &theOStream, int theCount,...)
 Unite values in one value using template: value_1, value_2, ..., value_n. More...
 
static const char * DumpFieldToName (const char *theField)
 Convert field name into dump text value, removes "&" and "my" prefixes An example, for field myValue, theName is Value, for &myCLass, the name is Class. More...
 

Detailed Description

This interface has some tool methods for stream (in JSON format) processing.

Member Function Documentation

◆ AddValuesSeparator()

static void Standard_Dump::AddValuesSeparator ( Standard_OStream theOStream)
static

Add Json values separator if the stream last symbol is not an open brace.

Parameters
theStreamsource value

◆ DumpCharacterValues()

static void Standard_Dump::DumpCharacterValues ( Standard_OStream theOStream,
int  theCount,
  ... 
)
static

Unite values in one value using template: "value_1", "value_2", ..., "value_n".

Parameters
theOStream[out] stream to be fill with values
theCountnumer of values

◆ DumpFieldToName()

static const char* Standard_Dump::DumpFieldToName ( const char *  theField)
static

Convert field name into dump text value, removes "&" and "my" prefixes An example, for field myValue, theName is Value, for &myCLass, the name is Class.

Parameters
theFielda source value
theName[out] an updated name

◆ DumpKeyToClass()

static void Standard_Dump::DumpKeyToClass ( Standard_OStream theOStream,
const char *  theKey,
const TCollection_AsciiString theField 
)
static

Append into output value: "Name": { Field }.

Parameters
theOStream[out] stream to be fill with values
theKeya source value
theFieldstream value

◆ DumpRealValues()

static void Standard_Dump::DumpRealValues ( Standard_OStream theOStream,
int  theCount,
  ... 
)
static

Unite values in one value using template: value_1, value_2, ..., value_n.

Parameters
theOStream[out] stream to be fill with values
theCountnumer of values

◆ FormatJson()

static TCollection_AsciiString Standard_Dump::FormatJson ( const Standard_SStream theStream,
const Standard_Integer  theIndent = 3 
)
static

Converts stream value to string value. Improves the text presentation with the following cases:

  • for '{' append after '
    ' and indent to the next value, increment current indent value
  • for '}' append '
    ' and current indent before it, decrement indent value
  • for ',' append after '
    ' and indent to the next value. If the current symbol is in massive container [], do nothing
    Parameters
    theStreamsource value
    theIndentcount of ' ' symbols to apply hierarchical indent of the text values
    Returns
    text presentation

◆ GetPointerInfo() [1/2]

static TCollection_AsciiString Standard_Dump::GetPointerInfo ( const Handle< Standard_Transient > &  thePointer,
const bool  isShortInfo = true 
)
static

Convert handle pointer to address of the pointer. If the handle is NULL, the result is an empty string.

Parameters
thePointera pointer
isShortInfoif true, all '0' symbols in the beginning of the pointer are skipped
Returns
the string value

◆ GetPointerInfo() [2/2]

static TCollection_AsciiString Standard_Dump::GetPointerInfo ( const void *  thePointer,
const bool  isShortInfo = true 
)
static

Convert pointer to address of the pointer. If the handle is NULL, the result is an empty string.

Parameters
thePointera pointer
isShortInfoif true, all '0' symbols in the beginning of the pointer are skipped
Returns
the string value

◆ GetPointerPrefix()

static TCollection_AsciiString Standard_Dump::GetPointerPrefix ( )
inlinestatic

Returns default prefix added for each pointer info string if short presentation of pointer used.

◆ Text()

static TCollection_AsciiString Standard_Dump::Text ( const Standard_SStream theStream)
static

Converts stream value to string value. The result is original stream value.

Parameters
theStreamsource value
Returns
text presentation

The documentation for this class was generated from the following file: