Skip to content

Dealing with arrays #362

@mtangoo

Description

@mtangoo

I have json like below. Now I want to check if given file is in array and open it. I tried get() but it does not work. this code crashes

         std::string pluginNameStr = "DOESNOTEXIST.json";
            Json::Value p = m_jsonPlugins.get(pluginNameStr, 0);
            if(!p.empty())
            {
                ret = p.asCString();
            }
{
    "plugins" : [ "/home/stefano/plugins/prefs/Git.json" ]
}

What is right way of dealing with arrays?

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