Skip to content

Deprecate name_get() and value_get() function returns const char * #10153

@masaori335

Description

@masaori335

Proposal

Deprecate below two functions of the MIMEField

const char *name_get(int *length) const;
const char *value_get(int *length) const;

Background

MIMEField has two value_get functions return std::string_view and const char *.

/// @return The value of @a this field.
std::string_view value_get() const;
const char *value_get(int *length) const;

Discussion on #10144, std::string_view value_get() const; is preferred for error handling and I completely agree with using std::string_view.

We can say the same things for name_get too.

/// @return The name of @a this field.
std::string_view name_get() const;
const char *name_get(int *length) const;

Concerns

These functions are used widely. The change will be big.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions