StringValue#

class StringValue#

Bases: numpy.str_, ansys.tools.variableinterop.variable_value.IVariableValue

Stores a value as an IVariableValue variable type.

Overview#

accept

Invoke the visitor pattern of this object using the passed-in visitor

to_api_string

Convert the value to an API string.

to_display_string

Convert the value to a formatted string.

variable_type

Variable type of the object.

from_api_string

Convert an API string back to a string value.

Import detail#

from ansys.tools.variableinterop.scalar_values import StringValue

Property detail#

property StringValue.variable_type: VariableType#

Variable type of the object.

Returns:
VariableType

Variable type of the object.

Method detail#

StringValue.accept(visitor: ansys.tools.variableinterop.ivariable_visitor.IVariableValueVisitor[ansys.tools.variableinterop.ivariable_visitor.T]) ansys.tools.variableinterop.ivariable_visitor.T#

Invoke the visitor pattern of this object using the passed-in visitor implementation.

Parameters:
visitorIVariableValueVisitor

Visitor object to call.

Returns:
T

Results of the visitor invocation.

StringValue.to_api_string(context: ansys.tools.variableinterop.isave_context.ISaveContext | None = None) str#

Convert the value to an API string.

Returns:
str

String appropriate for use in files and APIs.

static StringValue.from_api_string(value: str) StringValue#

Convert an API string back to a string value.

The string is stored exactly as specified. No escaping is performed as with the from_formatted string() method.

Parameters:
valuestr

String to convert.

StringValue.to_display_string(locale_name: str) str#

Convert the value to a formatted string.

Parameters:
locale_namestr

Locale to format the string in.

Returns:
str

String appropriate for use in user-facing areas.