.. _stdlib_generic_storage: =============== Generic storage =============== This module provides generic storage for various types of data. The data is stored in a table, with the name as the key and the value as the data. The value can be one of the following types: int, int4, int3, int2, uint, uint64, float, float4, float3, float2, string, array, array, array, array, array, or array. To use this module, include the following line in your project file:: require engine.serializer.generic_storage // or require engine.core To access the data, use the set and get functions. For example:: var data : GenericStorage set(set(data, "int_val", 42), "float_val", 3.14) <...> get_or(data, "int_val", 0) // returns 42 var float_val : float get(data, "float_val", float_val) // returns true and sets float_val to 3.14 ++++++++++++ Type aliases ++++++++++++ .. _alias-GenericStorageData: .. das:attribute:: variant GenericStorageData Represents a variant type for storing various types of data. :Variants: * **i4** : int4 - The int4 value * **f4** : float4 - The float4 value * **str** : string - The string value * **_i4** : array - The array of int4 values * **_f1** : array - The array of float values * **_f2** : array - The array of float2 values * **_f3** : array - The array of float3 values * **_f4** : array - The array of float4 values * **_str** : array - The array of string values ++++++++++ Structures ++++++++++ .. _struct-generic_storage-GenericStorage: .. das:attribute:: GenericStorage Represents a generic storage for storing various types of data. :Fields: * **values** : table` > - The table to store the data +++++++++ Functions +++++++++ * :ref:`clear (var req: GenericStorage) ` * :ref:`set (var req: GenericStorage; name: string; val: float) : GenericStorage& ` * :ref:`set (var req: GenericStorage; name: string; val: int) : GenericStorage& ` * :ref:`set (var req: GenericStorage; name: string; val: int64) : GenericStorage& ` * :ref:`set (var req: GenericStorage; name: string; val: uint) : GenericStorage& ` * :ref:`set (var req: GenericStorage; name: string; val: uint64) : GenericStorage& ` * :ref:`set (var req: GenericStorage; name: string; val: string) : GenericStorage& ` * :ref:`set (var req: GenericStorage; name: string; val: float4) : GenericStorage& ` * :ref:`set (var req: GenericStorage; name: string; val: int4) : GenericStorage& ` * :ref:`set (var req: GenericStorage; name: string; val: float3) : GenericStorage& ` * :ref:`set (var req: GenericStorage; name: string; val: int3) : GenericStorage& ` * :ref:`set (var req: GenericStorage; name: string; val: float2) : GenericStorage& ` * :ref:`set (var req: GenericStorage; name: string; val: int2) : GenericStorage& ` * :ref:`set (var req: GenericStorage; name: string; val: bool) : GenericStorage& ` * :ref:`set (var req: GenericStorage; name: string; var val: array\) : GenericStorage& ` * :ref:`set (var req: GenericStorage; name: string; var val: array\) : GenericStorage& ` * :ref:`set (var req: GenericStorage; name: string; var val: array\) : GenericStorage& ` * :ref:`set (var req: GenericStorage; name: string; var val: array\) : GenericStorage& ` * :ref:`set (var req: GenericStorage; name: string; var val: array\) : GenericStorage& ` * :ref:`set (var req: GenericStorage; name: string; var val: array\) : GenericStorage& ` * :ref:`empty (req: GenericStorage|GenericStorage#) : bool ` * :ref:`keys (req: GenericStorage|GenericStorage#) : iterator\ ` * :ref:`has (req: GenericStorage|GenericStorage#; name: string) : bool ` * :ref:`get_or (req: GenericStorage|GenericStorage#; name: string; def_val: auto(T)) : T ` * :ref:`get (req: GenericStorage|GenericStorage#; name: string; var val: float&) : bool ` * :ref:`get (req: GenericStorage|GenericStorage#; name: string; var val: int&) : bool ` * :ref:`get (req: GenericStorage|GenericStorage#; name: string; var val: int64&) : bool ` * :ref:`get (req: GenericStorage|GenericStorage#; name: string; var val: uint&) : bool ` * :ref:`get (req: GenericStorage|GenericStorage#; name: string; var val: uint64&) : bool ` * :ref:`get (req: GenericStorage|GenericStorage#; name: string; var val: string&) : bool ` * :ref:`get (req: GenericStorage|GenericStorage#; name: string; var val: float4&) : bool ` * :ref:`get (req: GenericStorage|GenericStorage#; name: string; var val: int4&) : bool ` * :ref:`get (req: GenericStorage|GenericStorage#; name: string; var val: float3&) : bool ` * :ref:`get (req: GenericStorage|GenericStorage#; name: string; var val: int3&) : bool ` * :ref:`get (req: GenericStorage|GenericStorage#; name: string; var val: float2&) : bool ` * :ref:`get (req: GenericStorage|GenericStorage#; name: string; var val: int2&) : bool ` * :ref:`get (req: GenericStorage|GenericStorage#; name: string; var val: bool&) : bool ` * :ref:`get (req: GenericStorage|GenericStorage#; name: string; var val: array\) : bool ` * :ref:`get (req: GenericStorage|GenericStorage#; name: string; var val: array\) : bool ` * :ref:`get (req: GenericStorage|GenericStorage#; name: string; var val: array\) : bool ` * :ref:`get (req: GenericStorage|GenericStorage#; name: string; var val: array\) : bool ` * :ref:`get (req: GenericStorage|GenericStorage#; name: string; var val: array\) : bool ` * :ref:`get (req: GenericStorage|GenericStorage#; name: string; var val: array\) : bool ` * :ref:`to_string (var req: GenericStorage|GenericStorage#) : string ` * :ref:`to_string (var req: GenericStorage|GenericStorage#; cb: block\<(res:string#):void\>) : bool ` * :ref:`GenericStorage (str: string|string#) : GenericStorage ` .. _function-generic_storage_clear_GenericStorage: .. das:function:: clear(req: GenericStorage) Clears the generic storage by deleting all the stored data. :Arguments: * **req** : :ref:`GenericStorage ` - the generic storage .. _function-generic_storage_set_GenericStorage_string_float: .. das:function:: set(req: GenericStorage; name: string; val: float) : GenericStorage& Sets a float value in the generic storage with the specified name. :Arguments: * **req** : :ref:`GenericStorage ` - the generic storage * **name** : string - the name of the value * **val** : float - the float value to set :Returns: * :ref:`GenericStorage ` & - the modified generic storage .. _function-generic_storage_set_GenericStorage_string_int: .. das:function:: set(req: GenericStorage; name: string; val: int) : GenericStorage& Sets an int value in the generic storage with the specified name. :Arguments: * **req** : :ref:`GenericStorage ` - the generic storage * **name** : string - the name of the value * **val** : int - the int value to set :Returns: * :ref:`GenericStorage ` & - the modified generic storage .. _function-generic_storage_set_GenericStorage_string_int64: .. das:function:: set(req: GenericStorage; name: string; val: int64) : GenericStorage& Sets an int64 value in the generic storage with the specified name. :Arguments: * **req** : :ref:`GenericStorage ` - the generic storage * **name** : string - the name of the value * **val** : int64 - the int64 value to set :Returns: * :ref:`GenericStorage ` & - the modified generic storage .. _function-generic_storage_set_GenericStorage_string_uint: .. das:function:: set(req: GenericStorage; name: string; val: uint) : GenericStorage& Sets a uint value in the generic storage with the specified name. :Arguments: * **req** : :ref:`GenericStorage ` - the generic storage * **name** : string - the name of the value * **val** : uint - the uint value to set :Returns: * :ref:`GenericStorage ` & - the modified generic storage .. _function-generic_storage_set_GenericStorage_string_uint64: .. das:function:: set(req: GenericStorage; name: string; val: uint64) : GenericStorage& Sets a uint64 value in the generic storage with the specified name. :Arguments: * **req** : :ref:`GenericStorage ` - the generic storage * **name** : string - the name of the value * **val** : uint64 - the uint64 value to set :Returns: * :ref:`GenericStorage ` & - the modified generic storage .. _function-generic_storage_set_GenericStorage_string_string: .. das:function:: set(req: GenericStorage; name: string; val: string) : GenericStorage& Sets a string value in the generic storage with the specified name. :Arguments: * **req** : :ref:`GenericStorage ` - the generic storage * **name** : string - the name of the value * **val** : string - the string value to set :Returns: * :ref:`GenericStorage ` & - the modified generic storage .. _function-generic_storage_set_GenericStorage_string_float4: .. das:function:: set(req: GenericStorage; name: string; val: float4) : GenericStorage& Sets a float4 value in the generic storage with the specified name. :Arguments: * **req** : :ref:`GenericStorage ` - the generic storage * **name** : string - the name of the value * **val** : float4 - the float4 value to set :Returns: * :ref:`GenericStorage ` & - the modified generic storage .. _function-generic_storage_set_GenericStorage_string_int4: .. das:function:: set(req: GenericStorage; name: string; val: int4) : GenericStorage& Sets an int4 value in the generic storage with the specified name. :Arguments: * **req** : :ref:`GenericStorage ` - the generic storage * **name** : string - the name of the value * **val** : int4 - the int4 value to set :Returns: * :ref:`GenericStorage ` & - the modified generic storage .. _function-generic_storage_set_GenericStorage_string_float3: .. das:function:: set(req: GenericStorage; name: string; val: float3) : GenericStorage& Sets a float3 value in the generic storage with the specified name. :Arguments: * **req** : :ref:`GenericStorage ` - the generic storage * **name** : string - the name of the value * **val** : float3 - the float3 value to set :Returns: * :ref:`GenericStorage ` & - the modified generic storage .. _function-generic_storage_set_GenericStorage_string_int3: .. das:function:: set(req: GenericStorage; name: string; val: int3) : GenericStorage& Sets an int3 value in the generic storage with the specified name. :Arguments: * **req** : :ref:`GenericStorage ` - the generic storage * **name** : string - the name of the value * **val** : int3 - the int3 value to set :Returns: * :ref:`GenericStorage ` & - the modified generic storage .. _function-generic_storage_set_GenericStorage_string_float2: .. das:function:: set(req: GenericStorage; name: string; val: float2) : GenericStorage& Sets a float2 value in the generic storage with the specified name. :Arguments: * **req** : :ref:`GenericStorage ` - the generic storage * **name** : string - the name of the value * **val** : float2 - the float2 value to set :Returns: * :ref:`GenericStorage ` & - the modified generic storage .. _function-generic_storage_set_GenericStorage_string_int2: .. das:function:: set(req: GenericStorage; name: string; val: int2) : GenericStorage& Sets an int2 value in the generic storage with the specified name. :Arguments: * **req** : :ref:`GenericStorage ` - the generic storage * **name** : string - the name of the value * **val** : int2 - the int2 value to set :Returns: * :ref:`GenericStorage ` & - the modified generic storage .. _function-generic_storage_set_GenericStorage_string_bool: .. das:function:: set(req: GenericStorage; name: string; val: bool) : GenericStorage& Sets a bool value in the generic storage with the specified name. :Arguments: * **req** : :ref:`GenericStorage ` - the generic storage * **name** : string - the name of the value * **val** : bool - the bool value to set :Returns: * :ref:`GenericStorage ` & - the modified generic storage .. _function-generic_storage_set_GenericStorage_string_array_ls_float_gr_: .. das:function:: set(req: GenericStorage; name: string; val: array) : GenericStorage& Sets an array of float values in the generic storage with the specified name. :Arguments: * **req** : :ref:`GenericStorage ` - the generic storage * **name** : string - the name of the value * **val** : array - the array of float values to set :Returns: * :ref:`GenericStorage ` & - the modified generic storage .. _function-generic_storage_set_GenericStorage_string_array_ls_float2_gr_: .. das:function:: set(req: GenericStorage; name: string; val: array) : GenericStorage& Sets an array of float2 values in the generic storage with the specified name. :Arguments: * **req** : :ref:`GenericStorage ` - the generic storage * **name** : string - the name of the value * **val** : array - the array of float2 values to set :Returns: * :ref:`GenericStorage ` & - the modified generic storage .. _function-generic_storage_set_GenericStorage_string_array_ls_float3_gr_: .. das:function:: set(req: GenericStorage; name: string; val: array) : GenericStorage& Sets an array of float3 values in the generic storage with the specified name. :Arguments: * **req** : :ref:`GenericStorage ` - the generic storage * **name** : string - the name of the value * **val** : array - the array of float3 values to set :Returns: * :ref:`GenericStorage ` & - the modified generic storage .. _function-generic_storage_set_GenericStorage_string_array_ls_float4_gr_: .. das:function:: set(req: GenericStorage; name: string; val: array) : GenericStorage& Sets an array of float4 values in the generic storage with the specified name. :Arguments: * **req** : :ref:`GenericStorage ` - the generic storage * **name** : string - the name of the value * **val** : array - the array of float4 values to set :Returns: * :ref:`GenericStorage ` & - the modified generic storage .. _function-generic_storage_set_GenericStorage_string_array_ls_int4_gr_: .. das:function:: set(req: GenericStorage; name: string; val: array) : GenericStorage& Sets an array of int4 values in the generic storage with the specified name. :Arguments: * **req** : :ref:`GenericStorage ` - the generic storage * **name** : string - the name of the value * **val** : array - the array of int4 values to set :Returns: * :ref:`GenericStorage ` & - the modified generic storage .. _function-generic_storage_set_GenericStorage_string_array_ls_string_gr_: .. das:function:: set(req: GenericStorage; name: string; val: array) : GenericStorage& Sets an array of string values in the generic storage with the specified name. :Arguments: * **req** : :ref:`GenericStorage ` - the generic storage * **name** : string - the name of the value * **val** : array - the array of string values to set :Returns: * :ref:`GenericStorage ` & - the modified generic storage .. _function-generic_storage_empty_GenericStorageGenericStorage_hh_: .. das:function:: empty(req: GenericStorage|GenericStorage#) : bool Checks if the generic storage is empty. :Arguments: * **req** : option< :ref:`GenericStorage ` | :ref:`GenericStorage ` #> - the generic storage :Returns: * bool - true if the generic storage is empty, false otherwise .. _function-generic_storage_keys_GenericStorageGenericStorage_hh_: .. das:function:: keys(req: GenericStorage|GenericStorage#) : iterator Returns an iterator over the keys in the generic storage. :Arguments: * **req** : option< :ref:`GenericStorage ` | :ref:`GenericStorage ` #> - the generic storage :Returns: * iterator - an iterator over the keys in the generic storage .. _function-generic_storage_has_GenericStorageGenericStorage_hh__string: .. das:function:: has(req: GenericStorage|GenericStorage#; name: string) : bool Checks if the generic storage has a value with the specified name. :Arguments: * **req** : option< :ref:`GenericStorage ` | :ref:`GenericStorage ` #> - the generic storage * **name** : string - the name of the value :Returns: * bool - true if the generic storage has a value with the specified name, false otherwise .. _function-generic_storage_get_or_GenericStorageGenericStorage_hh__string_autoT: .. das:function:: get_or(req: GenericStorage|GenericStorage#; name: string; def_val: auto(T)) : T Gets the value with the specified name from the generic storage. If the value does not exist, returns the default value. :Arguments: * **req** : option< :ref:`GenericStorage ` | :ref:`GenericStorage ` #> - the generic storage * **name** : string - the name of the value * **def_val** : auto(T) - the default value to return if the value does not exist :Returns: * T - the value from the generic storage or the default value .. _function-generic_storage_get_GenericStorageGenericStorage_hh__string_float: .. das:function:: get(req: GenericStorage|GenericStorage#; name: string; val: float&) : bool Gets a float value from the generic storage with the specified name. :Arguments: * **req** : option< :ref:`GenericStorage ` | :ref:`GenericStorage ` #> - the generic storage * **name** : string - the name of the value * **val** : float& - the variable to store the value :Returns: * bool - true if the value exists and is successfully retrieved, false otherwise .. _function-generic_storage_get_GenericStorageGenericStorage_hh__string_int: .. das:function:: get(req: GenericStorage|GenericStorage#; name: string; val: int&) : bool Gets an int value from the generic storage with the specified name. :Arguments: * **req** : option< :ref:`GenericStorage ` | :ref:`GenericStorage ` #> - the generic storage * **name** : string - the name of the value * **val** : int& - the variable to store the value :Returns: * bool - true if the value exists and is successfully retrieved, false otherwise .. _function-generic_storage_get_GenericStorageGenericStorage_hh__string_int64: .. das:function:: get(req: GenericStorage|GenericStorage#; name: string; val: int64&) : bool Gets an int64 value from the generic storage with the specified name. :Arguments: * **req** : option< :ref:`GenericStorage ` | :ref:`GenericStorage ` #> - the generic storage * **name** : string - the name of the value * **val** : int64& - the variable to store the value :Returns: * bool - true if the value exists and is successfully retrieved, false otherwise .. _function-generic_storage_get_GenericStorageGenericStorage_hh__string_uint: .. das:function:: get(req: GenericStorage|GenericStorage#; name: string; val: uint&) : bool Gets a uint value from the generic storage with the specified name. :Arguments: * **req** : option< :ref:`GenericStorage ` | :ref:`GenericStorage ` #> - the generic storage * **name** : string - the name of the value * **val** : uint& - the variable to store the value :Returns: * bool - true if the value exists and is successfully retrieved, false otherwise .. _function-generic_storage_get_GenericStorageGenericStorage_hh__string_uint64: .. das:function:: get(req: GenericStorage|GenericStorage#; name: string; val: uint64&) : bool Gets a uint64 value from the generic storage with the specified name. :Arguments: * **req** : option< :ref:`GenericStorage ` | :ref:`GenericStorage ` #> - the generic storage * **name** : string - the name of the value * **val** : uint64& - the variable to store the value :Returns: * bool - true if the value exists and is successfully retrieved, false otherwise .. _function-generic_storage_get_GenericStorageGenericStorage_hh__string_string: .. das:function:: get(req: GenericStorage|GenericStorage#; name: string; val: string&) : bool Gets a string value from the generic storage with the specified name. :Arguments: * **req** : option< :ref:`GenericStorage ` | :ref:`GenericStorage ` #> - the generic storage * **name** : string - the name of the value * **val** : string& - the variable to store the value :Returns: * bool - true if the value exists and is successfully retrieved, false otherwise .. _function-generic_storage_get_GenericStorageGenericStorage_hh__string_float4: .. das:function:: get(req: GenericStorage|GenericStorage#; name: string; val: float4&) : bool Gets a float4 value from the generic storage with the specified name. :Arguments: * **req** : option< :ref:`GenericStorage ` | :ref:`GenericStorage ` #> - the generic storage * **name** : string - the name of the value * **val** : float4& - the variable to store the value :Returns: * bool - true if the value exists and is successfully retrieved, false otherwise .. _function-generic_storage_get_GenericStorageGenericStorage_hh__string_int4: .. das:function:: get(req: GenericStorage|GenericStorage#; name: string; val: int4&) : bool Gets an int4 value from the generic storage with the specified name. :Arguments: * **req** : option< :ref:`GenericStorage ` | :ref:`GenericStorage ` #> - the generic storage * **name** : string - the name of the value * **val** : int4& - the variable to store the value :Returns: * bool - true if the value exists and is successfully retrieved, false otherwise .. _function-generic_storage_get_GenericStorageGenericStorage_hh__string_float3: .. das:function:: get(req: GenericStorage|GenericStorage#; name: string; val: float3&) : bool Gets a float3 value from the generic storage with the specified name. :Arguments: * **req** : option< :ref:`GenericStorage ` | :ref:`GenericStorage ` #> - the generic storage * **name** : string - the name of the value * **val** : float3& - the variable to store the value :Returns: * bool - true if the value exists and is successfully retrieved, false otherwise .. _function-generic_storage_get_GenericStorageGenericStorage_hh__string_int3: .. das:function:: get(req: GenericStorage|GenericStorage#; name: string; val: int3&) : bool Gets an int3 value from the generic storage with the specified name. :Arguments: * **req** : option< :ref:`GenericStorage ` | :ref:`GenericStorage ` #> - the generic storage * **name** : string - the name of the value * **val** : int3& - the variable to store the value :Returns: * bool - true if the value exists and is successfully retrieved, false otherwise .. _function-generic_storage_get_GenericStorageGenericStorage_hh__string_float2: .. das:function:: get(req: GenericStorage|GenericStorage#; name: string; val: float2&) : bool Gets a float2 value from the generic storage with the specified name. :Arguments: * **req** : option< :ref:`GenericStorage ` | :ref:`GenericStorage ` #> - the generic storage * **name** : string - the name of the value * **val** : float2& - the variable to store the value :Returns: * bool - true if the value exists and is successfully retrieved, false otherwise .. _function-generic_storage_get_GenericStorageGenericStorage_hh__string_int2: .. das:function:: get(req: GenericStorage|GenericStorage#; name: string; val: int2&) : bool Gets an int2 value from the generic storage with the specified name. :Arguments: * **req** : option< :ref:`GenericStorage ` | :ref:`GenericStorage ` #> - the generic storage * **name** : string - the name of the value * **val** : int2& - the variable to store the value :Returns: * bool - true if the value exists and is successfully retrieved, false otherwise .. _function-generic_storage_get_GenericStorageGenericStorage_hh__string_bool: .. das:function:: get(req: GenericStorage|GenericStorage#; name: string; val: bool&) : bool Gets a bool value from the generic storage with the specified name. :Arguments: * **req** : option< :ref:`GenericStorage ` | :ref:`GenericStorage ` #> - the generic storage * **name** : string - the name of the value * **val** : bool& - the variable to store the value :Returns: * bool - true if the value exists and is successfully retrieved, false otherwise .. _function-generic_storage_get_GenericStorageGenericStorage_hh__string_array_ls_float_gr_: .. das:function:: get(req: GenericStorage|GenericStorage#; name: string; val: array) : bool Gets an array of float values from the generic storage with the specified name. :Arguments: * **req** : option< :ref:`GenericStorage ` | :ref:`GenericStorage ` #> - the generic storage * **name** : string - the name of the value * **val** : array& - the variable to store the array of float values :Returns: * bool - true if the value exists and is successfully retrieved, false otherwise .. _function-generic_storage_get_GenericStorageGenericStorage_hh__string_array_ls_float2_gr_: .. das:function:: get(req: GenericStorage|GenericStorage#; name: string; val: array) : bool Gets an array of float2 values from the generic storage with the specified name. :Arguments: * **req** : option< :ref:`GenericStorage ` | :ref:`GenericStorage ` #> - the generic storage * **name** : string - the name of the value * **val** : array& - the variable to store the array of float2 values :Returns: * bool - true if the value exists and is successfully retrieved, false otherwise .. _function-generic_storage_get_GenericStorageGenericStorage_hh__string_array_ls_float3_gr_: .. das:function:: get(req: GenericStorage|GenericStorage#; name: string; val: array) : bool Gets an array of float3 values from the generic storage with the specified name. :Arguments: * **req** : option< :ref:`GenericStorage ` | :ref:`GenericStorage ` #> - the generic storage * **name** : string - the name of the value * **val** : array& - the variable to store the array of float3 values :Returns: * bool - true if the value exists and is successfully retrieved, false otherwise .. _function-generic_storage_get_GenericStorageGenericStorage_hh__string_array_ls_float4_gr_: .. das:function:: get(req: GenericStorage|GenericStorage#; name: string; val: array) : bool Gets an array of float4 values from the generic storage with the specified name. :Arguments: * **req** : option< :ref:`GenericStorage ` | :ref:`GenericStorage ` #> - the generic storage * **name** : string - the name of the value * **val** : array& - the variable to store the array of float4 values :Returns: * bool - true if the value exists and is successfully retrieved, false otherwise .. _function-generic_storage_get_GenericStorageGenericStorage_hh__string_array_ls_int4_gr_: .. das:function:: get(req: GenericStorage|GenericStorage#; name: string; val: array) : bool Gets an array of int4 values from the generic storage with the specified name. :Arguments: * **req** : option< :ref:`GenericStorage ` | :ref:`GenericStorage ` #> - the generic storage * **name** : string - the name of the value * **val** : array& - the variable to store the array of int4 values :Returns: * bool - true if the value exists and is successfully retrieved, false otherwise .. _function-generic_storage_get_GenericStorageGenericStorage_hh__string_array_ls_string_gr_: .. das:function:: get(req: GenericStorage|GenericStorage#; name: string; val: array) : bool Gets an array of string values from the generic storage with the specified name. :Arguments: * **req** : option< :ref:`GenericStorage ` | :ref:`GenericStorage ` #> - the generic storage * **name** : string - the name of the value * **val** : array& - the variable to store the array of string values :Returns: * bool - true if the value exists and is successfully retrieved, false otherwise .. _function-generic_storage_to_string_GenericStorageGenericStorage_hh_: .. das:function:: to_string(req: GenericStorage|GenericStorage#) : string Converts the GenericStorage object to a string representation. :Arguments: * **req** : option< :ref:`GenericStorage ` | :ref:`GenericStorage ` #> - the GenericStorage object :Returns: * string - the string representation of the GenericStorage object .. _function-generic_storage_to_string_GenericStorageGenericStorage_hh__block_ls_res_c_string_hh__c_void_gr_: .. das:function:: to_string(req: GenericStorage|GenericStorage#; cb: block<(res:string#):void>) : bool Converts the GenericStorage object to a string representation and calls the provided block with the result. :Arguments: * **req** : option< :ref:`GenericStorage ` | :ref:`GenericStorage ` #> - the GenericStorage object * **cb** : block<(res:string#):void> - the block to call with the string representation of the GenericStorage object :Returns: * bool - true if the conversion is successful, false otherwise .. _function-generic_storage_GenericStorage_stringstring_hh_: .. das:function:: GenericStorage(str: string|string#) : GenericStorage Constructs a GenericStorage object from a string representation. :Arguments: * **str** : option - the string representation of the GenericStorage object :Returns: * :ref:`GenericStorage ` - the constructed GenericStorage object