Document third wxBitmapBundle::FromSVG() variant

Add a note that data has to be null terminated with the variants
without len parameter and to use the third variant for data
that is not null terminated.

See #22838.

(cherry picked from commit 17934d3d624a93b39b9c4935e2086d6ab0d54c1a)
This commit is contained in:
Tobias Taschner 2022-10-01 23:12:40 +02:00 committed by Vadim Zeitlin
parent 12248d37be
commit caf206039a

View File

@ -256,12 +256,14 @@ public:
@param data This data may, or not, have the XML document preamble, i.e.
it can start either with @c "<?xml" processing instruction or
directly with @c svg tag. Notice that two overloads of this
function, taking const and non-const data, are provided: as the
current implementation modifies the data while parsing, using the
non-const variant is more efficient, as it avoids making copy of
the data, but the data is consumed by it and can't be reused any
more.
directly with @c svg tag. For NUL-terminated string, two overloads
of this function, taking const and non-const data, are provided: as
the current implementation modifies the data while parsing, using
the non-const variant is more efficient, as it avoids making copy
of the data, but the data is consumed by it and can't be reused any
more. For non-NUL-terminated data, the third overload, taking an
extra parameter explicitly specifying the length of the input data,
@e must be used.
@param sizeDef The default size to return from GetDefaultSize() for
this bundle. As SVG images usually don't have any natural
default size, it should be provided when creating the bundle.
@ -271,6 +273,10 @@ public:
/// @overload
static wxBitmapBundle FromSVG(const char* data, const wxSize& sizeDef);
/// @overload
static wxBitmapBundle FromSVG(const wxByte* data, size_t len, const wxSize& sizeDef);
/**
Create a bundle from the SVG image loaded from the given file.