Skip to content

Is there a way to store the values of a Variant into a string? #115

@overmyerD

Description

@overmyerD

Hello,

I was wondering if there a way to store the values of a Variant inside of a string, in the same fashion that sdbus does it? For example:

  sdbus::Variant var(std::vector<int>({1, 2, 3, 4, 5}));
  std::cout << var.toString() << endl; //prints 5 1 2 3 4 5

I ask this because I am using the the PropertiesChanged signal and with that it calls a function with a map of strings to Variants, so the type of the property changed can be unknown and I don't want to write out print statements for all possible types I receive.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions