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 6202941
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T04:49:34+00:00 2026-05-24T04:49:34+00:00

I tried real quick as a test to see if I can pipe my

  • 0

I tried real quick as a test to see if I can pipe my twitter feed to boost’s JSON parser. No dice. My JSON parser cannot handle the following lines:

"profile_background_image_url":"http:\/\/a2.twimg.com\/profile_background_images\/4531792\/wallpaper_stock.jpg",
"url":"http:\/\/on.fb.me\/bShBVQ",
exception error: "invalid escape sequence"

"id":86162751646482432,
exception error: "expected value"

Removing the offending lines gets a populated property tree. Obviously not sufficient for twitter. Here is the code in case I declared my property tree wrong. Help?

int main (int argc, char * const argv[]) 
{
    boost::property_tree::basic_ptree<std::string,std::string> pt;
    std::ifstream f;
    f.open("testJSON2a.txt");
    if(!f.is_open())
    {
        std::cout << "Error";
        return 0;
    }

    try
    {
        boost::property_tree::json_parser::read_json(f,pt);
        boost::property_tree::basic_ptree<std::string,std::string>::const_iterator iter = pt.begin(),iterEnd = pt.end();
        for(;iter != iterEnd;++iter)
        {
            std::cout << iter->first << " " << iter->second.get_value<std::string>() << std::endl;
        }
    }
    catch(boost::property_tree::json_parser::json_parser_error &je)
    {
        std::cout << "Error parsing: " << je.filename() << " on line: " << je.line() << std::endl;
        std::cout << je.message() << std::endl;
    }
    return 0;
}
  • 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-05-24T04:49:35+00:00Added an answer on May 24, 2026 at 4:49 am

    The answer is to update to the latest version of boost :-). Apparently this library is far from stable. Major changes/refactors in every version.

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

Sidebar

Related Questions

There is site , shop.test.com.au (not a real name) when ever i tried to
I have tried the steps in the Android Source page. I can see the
I tried the following in ant: <?xml version=1.0?> <project name=test default=real basedir=.> <target name=task>
Can someone help me out real quick, im writing something that is using the
Tried searching the site, but cannot find an answer to my problem: Lets say
Tried a bunch of things but I can't get it to work consistently amid
While working through Real World Haskell, I tried to complete the palindrome exercise using
I tried to deploy my application in real device. But when it running ,
Anybody tried here using Getting Real(37Signals) approach to develop windows application? (C#/.NET). Or simply
I tried to make HttpConnection of URL through GPRS (Mobile network) on real device

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.