Skip to content

Conversation

muxelplexer
Copy link

This can be relevant when the parameters need to be passed to some different library (i.e. libmpv, gstreamer) and there is no cpr::Session to get a CurlHolder from.


I ran the clang-format script - it brought up issues but not with the file i touched. If there is a better way already implemented please let me know :)

This can be relevant when the parameters need to be passed to some
different library (i.e. libmpv, gstreamer) and there is no cpr::Session
to get a CurlHolder from.

Signed-off-by: Sebastian Muxel <sebastian@muxel.dev>
Copy link
Member

@COM8 COM8 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for submitting this MR.
Are you aware that something like this would also wok:

parameters.GetContent(CurlHolder());

(constructing a CurlHolder() is compatibly expensive)

void Add(const std::initializer_list<T>&);
void Add(const T&);

const std::string GetContent(const CurlHolder&) const;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please add a docs comment to the old function as well?

* Returns the URL while ignoring `encode`. This allows calling without
* active `CurlHolder`.
**/
const std::string GetContent() const;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add tests inside test/structures_tests.cpp.

@COM8
Copy link
Member

COM8 commented Sep 20, 2025

For running clang-format there is: scripts/run_clang_format.sh.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants