Skip to content

Refactor bmqu::AlignedPrinter to accept vector of strings #564

Open
@678098

Description

@678098

Is your feature request related to a problem?

bmqu::AlignedPrinter class has some problems:

  • The class' API expects bsl::vector<const char*> argument which is strange. The conventional way is to pass bsl::vector<bsl::string>.
  • It also stores this vector as a field.
  • To get the const char* length, bsl::strlen is used.

const bsl::vector<const char*>* fields,

Describe the solution you'd like

Refactor bmqu::AlignedPrinter, so:

  • bmqu::AlignedPrinter constructor expects bsl::string, not const char*
  • bmqu::AlignedPrinter also stores these strings as a const bsl::vector<bsl::string> field (might be a pointer, might be a reference)
  • Add precondition assert that d_fields_p is not NULL in constructor AlignedPrinter::AlignedPrinter or initialize this field as a reference
  • Update usage examples in the unit's documentation
  • Update the code that uses this class

Alternatives you considered

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions