Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8795995
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T23:31:05+00:00 2026-06-13T23:31:05+00:00

we are switching Json libaries from JsonCpp to libJson. JsonCpp has nice functions to

  • 0

we are switching Json libaries from JsonCpp to libJson. JsonCpp has nice functions to determine the object type of a json value. Is there any equvialent way of getting this information in libjson?

For example, using JsonCpp we have the following:

Json::Value property = properties[propertyName.get_utf8()];

if (property.isInt()) 
{
    // Do Something
}
else if (property.isUInt())
{
    // Do Something
}
else if (property.isDouble())
{
    // Do Something
}
else if ( property.isString() )
{
    // Do Something
}

Is there any way to determine if a JSONNode has a string, int or double. I know you can get the JSONNode type, but can you get the object type for the value within that node. For example, if I have the following:

JSONNode root(JSON_NODE);
node.push_back(JSONNode("", "node"));
node.push_back(JSONNode("", 10));
node.push_back(JSONNode("", 21.5f));
node.push_back(JSONNode("", true));

Is it possible to determine that the first node in root contains a string, the second an int, the third a float etc?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T23:31:07+00:00Added an answer on June 13, 2026 at 11:31 pm

    Checking the type seems to be the only way of doing this, alright it is not very accurate as you can only check if it is a number, but not if it is an int of a double.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Switching from JVM 1.4 to 1.5 has performance benefits as per release notes. http://java.sun.com/j2se/1.5.0/docs/relnotes/features.html#performance
I am using context switching to get json response in Zend framework This is
After switching from firefox testing to internet explorer testing, some elements couldn't be found
Switching from Microsofts Oracle Driver to ODP.NET version 10.2.0.100. After changing the data types
After switching my Rails 2.3 app from MRI Ruby 1.8.7 to JRuby 1.6.5, the
We're switching from a legacy app written in ColdFusion to an ASP.Net Web Forms
After switching from 64-bit to 32-bit platform (both of them are CentOS) I get
I'm switching terminal applications, from OSX's Terminal.app to the Google Chrome Secure Shell app
After switching my Android NDK from android-ndk-r8b (official) to android-ndk-r7-crystax-5.beta2 (unofficial Crystax build), my
After switching from Delphi2007 to XE2, I'm terribly unhappy with the behaviour of some

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.