Open CASCADE Technology 7.8.2.dev
|
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 Standard_Integer theIndent=3) |
Converts stream value to string value. Improves the text presentation with the following cases: | |
static Standard_Boolean | SplitJson (const TCollection_AsciiString &theStreamStr, NCollection_IndexedDataMap< TCollection_AsciiString, Standard_DumpValue > &theKeyToValues) |
Converts stream into map of values. | |
static NCollection_List< Standard_Integer > | HierarchicalValueIndices (const NCollection_IndexedDataMap< TCollection_AsciiString, TCollection_AsciiString > &theValues) |
Returns container of indices in values, that has hierarchical value. | |
static Standard_Boolean | HasChildKey (const TCollection_AsciiString &theSourceValue) |
Returns true if the value has bracket key. | |
static Standard_CString | JsonKeyToString (const Standard_JsonKey theKey) |
Returns key value for enum type. | |
static Standard_Integer | 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 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 Standard_Boolean | ProcessStreamName (const TCollection_AsciiString &theStreamStr, const TCollection_AsciiString &theName, Standard_Integer &theStreamPos) |
Check whether the parameter name is equal to the name in the stream at position. | |
static Standard_Boolean | ProcessFieldName (const TCollection_AsciiString &theStreamStr, const TCollection_AsciiString &theName, Standard_Integer &theStreamPos) |
Check whether the field name is equal to the name in the stream at position. | |
static Standard_Boolean | InitRealValues (const TCollection_AsciiString &theStreamStr, Standard_Integer &theStreamPos, int theCount,...) |
Unite values in one value using template: value_1, value_2, ..., value_n. | |
static Standard_Boolean | InitValue (const TCollection_AsciiString &theStreamStr, Standard_Integer &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. | |
This interface has some tool methods for stream (in JSON format) processing.
|
static |
theOStream | source value |
|
static |
Unite values in one value using template: "value_1", "value_2", ..., "value_n".
theOStream | [out] stream to be fill with values |
theCount | [in] number of values |
|
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.
theField | a source value |
|
static |
Append into output value: "Name": { Field }.
theOStream | [out] stream to be fill with values |
theKey | a source value |
theField | stream value |
|
static |
Unite values in one value using template: value_1, value_2, ..., value_n.
theOStream | [out] stream to be fill with values |
theCount | [in] number of values |
|
static |
Converts stream value to string value. Improves the text presentation with the following cases:
theStream | source value |
theIndent | count of ' ' symbols to apply hierarchical indent of the text values |
|
static |
Convert handle pointer to address of the pointer. If the handle is NULL, the result is an empty string.
thePointer | a pointer |
isShortInfo | if true, all '0' symbols in the beginning of the pointer are skipped |
|
static |
Convert pointer to address of the pointer. If the handle is NULL, the result is an empty string.
thePointer | a pointer |
isShortInfo | if true, all '0' symbols in the beginning of the pointer are skipped |
|
inlinestatic |
Returns default prefix added for each pointer info string if short presentation of pointer used.
|
static |
Returns true if the value has bracket key.
|
static |
Returns container of indices in values, that has hierarchical value.
|
static |
Unite values in one value using template: value_1, value_2, ..., value_n.
[in] | theStreamStr | stream with values |
[out] | theStreamPos | current position in the stream |
[in] | theCount | number of values |
|
static |
Returns real value.
[in] | theStreamStr | stream with values |
[out] | theStreamPos | current position in the stream |
[out] | theValue | stream value |
|
static |
Returns length value for enum type.
|
static |
Returns key value for enum type.
|
static |
Check whether the field name is equal to the name in the stream at position.
[in] | theStreamStr | stream with values |
[in] | theName | stream key field value |
[out] | theStreamPos | current position in the stream |
|
static |
Check whether the parameter name is equal to the name in the stream at position.
[in] | theStreamStr | stream with values |
[in] | theName | stream key value |
[out] | theStreamPos | current position in the stream |
|
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.
theStreamStr | stream value |
theKeyToValues | [out] container of split values. It contains key to value and position of the value in the stream text |
|
static |
Converts stream value to string value. The result is original stream value.
theStream | source value |