Giter Site home page Giter Site logo

Comments (3)

GoogleCodeExporter avatar GoogleCodeExporter commented on July 17, 2024
Sorry I'm not sure how to make this an enhancement rather than a defect... I've 
not
used this google code setup much.

Original comment by [email protected] on 20 Oct 2009 at 10:18

  • Added labels: ****
  • Removed labels: ****

from yaml-cpp.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 17, 2024
It's all right :)

Actually, the intended way to do this is to use the emitter. Try:

    YAML::Emitter emitter;
    emitter << node;
    std::cout << emitter.c_str();

This way includes the ability to output any type of node (not just a scalar). If
you're *only* interested in outputting scalar nodes, then I recommend just 
writing
your own function to do that, since it's a little off the beaten track.

Thanks for the interest!

Original comment by [email protected] on 21 Oct 2009 at 2:25

  • Changed state: WontFix
  • Added labels: ****
  • Removed labels: ****

from yaml-cpp.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 17, 2024
By the way, I've considered writing your function, implemented with the above 
code,
but I feel that output to a stream that may contain a newline is a little 
subtle, and
should be done by the coder explicitly.

For example, if you can just write

    std::cout << node;

it may feel like you can use this outputting in a formatted way, such as:

    std::cout << "**** " << node << "\n";

which could output

    **** - math
    - science
    - English

which wouldn't be a valid YAML file.

Original comment by [email protected] on 21 Oct 2009 at 2:30

  • Added labels: ****
  • Removed labels: ****

from yaml-cpp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.