Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
5 tasks
678098 opened this issue Jan 13, 2025 · 0 comments
Open
5 tasks

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

678098 opened this issue Jan 13, 2025 · 0 comments
Labels
good first issue Good for newcomers

Comments

@678098
Copy link
Collaborator

678098 commented Jan 13, 2025

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

@678098 678098 added enhancement New feature or request good first issue Good for newcomers and removed enhancement New feature or request labels Jan 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant