Codechange: let AllocatedStringParameters allocated types too

This commit is contained in:
Rubidium
2023-06-13 23:46:08 +02:00
committed by rubidium42
parent f23249f8f1
commit 428333aeba
2 changed files with 12 additions and 23 deletions

View File

@@ -15,24 +15,23 @@
class StringParameters {
protected:
StringParameters *parent; ///< If not nullptr, this instance references data from this parent instance.
StringParameters *parent = nullptr; ///< If not nullptr, this instance references data from this parent instance.
uint64 *data; ///< Array with the actual data.
WChar *type; ///< Array with type information about the data. Can be nullptr when no type information is needed. See #StringControlCode.
WChar next_type = 0; ///< The type of the next data that is retrieved.
size_t offset = 0; ///< Current offset in the data/type arrays.
public:
size_t num_param; ///< Length of the data array.
/** Create a new StringParameters instance. */
StringParameters(uint64 *data, size_t num_param, WChar *type) :
parent(nullptr),
data(data),
type(type),
num_param(num_param)
{ }
public:
size_t num_param; ///< Length of the data array.
/**
* Create a new StringParameters instance that can reference part of the data of
* the given partent instance.
@@ -169,11 +168,13 @@ public:
*/
class AllocatedStringParameters : public StringParameters {
std::vector<uint64_t> params; ///< The actual parameters
std::vector<WChar> types; ///< The actual types.
public:
AllocatedStringParameters(size_t parameters = 0) : StringParameters(nullptr, parameters, nullptr), params(parameters)
AllocatedStringParameters(size_t parameters = 0) : StringParameters(nullptr, parameters, nullptr), params(parameters), types(parameters)
{
this->data = params.data();
this->type = types.data();
}
};