OCCT 8.0.1
OCCT documentation

Search guides and API reference

Enter at least two characters.

    Open CASCADE Technology Reference Manual 8.0.1
    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.
    static TCollection_AsciiString FormatJson (const Standard_SStream &theStream, const int theIndent=3)
     Converts stream value to string value. Improves the text presentation with the following cases:
    static bool SplitJson (const TCollection_AsciiString &theStreamStr, NCollection_IndexedDataMap< TCollection_AsciiString, Standard_DumpValue > &theKeyToValues)
     Converts stream into map of values.
    static NCollection_List< int > HierarchicalValueIndices (const NCollection_IndexedDataMap< TCollection_AsciiString, TCollection_AsciiString > &theValues)
     Returns container of indices in values, that has hierarchical value.
    static bool HasChildKey (const TCollection_AsciiString &theSourceValue)
     Returns true if the value has bracket key.
    static const char * JsonKeyToString (const Standard_JsonKey theKey)
     Returns key value for enum type.
    static int JsonKeyLength (const Standard_JsonKey theKey)
     Returns length value for enum type.
    static void AddValuesSeparator (Standard_OStream &theOStream)
    static TCollection_AsciiString GetPointerPrefix ()
     Returns default prefix added for each pointer info string if short presentation of pointer used.
    static TCollection_AsciiString GetPointerInfo (const occ::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.
    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.
    static void DumpKeyToClass (Standard_OStream &theOStream, const TCollection_AsciiString &theKey, const TCollection_AsciiString &theField)
     Append into output value: "Name": { Field }.
    static void DumpCharacterValues (Standard_OStream &theOStream, int theCount,...)
     Unite values in one value using template: "value_1", "value_2", ..., "value_n".
    static void DumpRealValues (Standard_OStream &theOStream, int theCount,...)
     Unite values in one value using template: value_1, value_2, ..., value_n.
    static bool ProcessStreamName (const TCollection_AsciiString &theStreamStr, const TCollection_AsciiString &theName, int &theStreamPos)
     Check whether the parameter name is equal to the name in the stream at position.
    static bool ProcessFieldName (const TCollection_AsciiString &theStreamStr, const TCollection_AsciiString &theName, int &theStreamPos)
     Check whether the field name is equal to the name in the stream at position.
    static bool InitRealValues (const TCollection_AsciiString &theStreamStr, int &theStreamPos, int theCount,...)
     Unite values in one value using template: value_1, value_2, ..., value_n.
    static bool InitValue (const TCollection_AsciiString &theStreamStr, int &theStreamPos, TCollection_AsciiString &theValue)
     Returns real value.
    static TCollection_AsciiString DumpFieldToName (const TCollection_AsciiString &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.

    Detailed Description

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

    Member Function Documentation

    ◆ AddValuesSeparator()

    void Standard_Dump::AddValuesSeparator ( Standard_OStream & theOStream)
    static
    Parameters
    theOStreamsource value

    ◆ DumpCharacterValues()

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

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

    Parameters
    [out]theOStreamstream to be fill with values
    [in]theCountnumber of values

    ◆ DumpFieldToName()

    TCollection_AsciiString Standard_Dump::DumpFieldToName ( const TCollection_AsciiString & 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

    ◆ DumpKeyToClass()

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

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

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

    ◆ DumpRealValues()

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

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

    Parameters
    [out]theOStreamstream to be fill with values
    [in]theCountnumber of values

    ◆ FormatJson()

    TCollection_AsciiString Standard_Dump::FormatJson ( const Standard_SStream & theStream,
    const int 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 Covers result with opened and closed brackets on the top level, if it has no symbols there.
      Parameters
      theStreamsource value
      theIndentcount of ' ' symbols to apply hierarchical indent of the text values
      Returns
      text presentation

    ◆ GetPointerInfo() [1/2]

    TCollection_AsciiString Standard_Dump::GetPointerInfo ( const occ::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]

    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()

    TCollection_AsciiString Standard_Dump::GetPointerPrefix ( )
    inlinestatic

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

    ◆ HasChildKey()

    bool Standard_Dump::HasChildKey ( const TCollection_AsciiString & theSourceValue)
    static

    Returns true if the value has bracket key.

    ◆ HierarchicalValueIndices()

    NCollection_List< int > Standard_Dump::HierarchicalValueIndices ( const NCollection_IndexedDataMap< TCollection_AsciiString, TCollection_AsciiString > & theValues)
    static

    Returns container of indices in values, that has hierarchical value.

    ◆ InitRealValues()

    bool Standard_Dump::InitRealValues ( const TCollection_AsciiString & theStreamStr,
    int & theStreamPos,
    int theCount,
    ... )
    static

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

    Parameters
    [in]theStreamStrstream with values
    [out]theStreamPoscurrent position in the stream
    [in]theCountnumber of values

    ◆ InitValue()

    bool Standard_Dump::InitValue ( const TCollection_AsciiString & theStreamStr,
    int & theStreamPos,
    TCollection_AsciiString & theValue )
    static

    Returns real value.

    Parameters
    [in]theStreamStrstream with values
    [out]theStreamPoscurrent position in the stream
    [out]theValuestream value

    ◆ JsonKeyLength()

    int Standard_Dump::JsonKeyLength ( const Standard_JsonKey theKey)
    static

    Returns length value for enum type.

    ◆ JsonKeyToString()

    const char * Standard_Dump::JsonKeyToString ( const Standard_JsonKey theKey)
    static

    Returns key value for enum type.

    ◆ ProcessFieldName()

    bool Standard_Dump::ProcessFieldName ( const TCollection_AsciiString & theStreamStr,
    const TCollection_AsciiString & theName,
    int & theStreamPos )
    static

    Check whether the field name is equal to the name in the stream at position.

    Parameters
    [in]theStreamStrstream with values
    [in]theNamestream key field value
    [out]theStreamPoscurrent position in the stream

    ◆ ProcessStreamName()

    bool Standard_Dump::ProcessStreamName ( const TCollection_AsciiString & theStreamStr,
    const TCollection_AsciiString & theName,
    int & theStreamPos )
    static

    Check whether the parameter name is equal to the name in the stream at position.

    Parameters
    [in]theStreamStrstream with values
    [in]theNamestream key value
    [out]theStreamPoscurrent position in the stream

    ◆ SplitJson()

    bool Standard_Dump::SplitJson ( const TCollection_AsciiString & theStreamStr,
    NCollection_IndexedDataMap< TCollection_AsciiString, Standard_DumpValue > & theKeyToValues )
    static

    Converts stream into map of values.

    The one level stream example: 'key_1: value_1, key_2: value_2' In output: values contain 'key_1: value_1' and 'key_2: value_2'.

    The two level stream example: 'key_1: value_1, key_2: value_2, key_3: {sublevel_key_1: sublevel_value_1}, key_4: value_4' In output values contain 'key_1: value_1', 'key_2: value_2', 'key_3: {sublevel_key_1: sublevel_value_1}' and 'key_4: value_4'. The sublevel value might be processed later using the same method.

    Parameters
    theStreamStrstream value
    [out]theKeyToValuescontainer of split values. It contains key to value and position of the value in the stream text

    ◆ Text()

    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: