title: Possible to walk a yaml-cpp tree without using emitter and node events?
body: <p>I'm trying to walk a yaml-cpp (0.5.1) node of which I don't know anything before. I know that there's a YAML::Dump which uses an emitter and node events to do that, but I'm wondering if there's a way without using emitters.</p>
  
  <p>I tried the following code but failed to find the needed methods to determine all needed cases:</p>
  
  <pre><code>void yaml_cpp_TestFunc_recursedown(YAML::Node&amp; node)
  {
    for(YAML::const_iterator it=node.begin();it!=node.end();++it)
    {
       auto dit = *it;
       try
       {
          if (dit.IsDefined())
          {
             try
             {
                std::cout &lt;&lt; dit.as&lt;std::string&gt;() &lt;&lt; std::endl;
             }
             catch (...) { }
             yaml_cpp_TestFunc_recursedown(dit);
          }
          else {}
       }
       catch (const YAML::InvalidNode&amp; ex)
       {
          try
          {
             if (dit.second.IsDefined())
             {
                try
                {
                   std::cout &lt;&lt; dit.second.as&lt;std::string&gt;() &lt;&lt; std::endl;
                }
                catch (...) { }
                yaml_cpp_TestFunc_recursedown(dit);
             }
             else {}
          }
          catch (...) { }
       }
       catch (...) { }
    }
  }
  void yaml_cpp_Test()
  {
    const std::string testfile=".\\appconf.yaml";
  
    {
       // generate a test yaml
       YAML::Node node;
       node["paths"].push_back("C:\\test\\");
       node["paths"].push_back("..\\");
       node["a"] = "123";
       node["b"]["c"] = "4567";
  
       YAML::Emitter emitter;
       emitter &lt;&lt; node;
  
       std::ofstream fout(testfile);
       fout &lt;&lt; emitter.c_str();
    }
  
    {
       // try to walk the test yaml
       YAML::Node config = YAML::LoadFile(testfile);
       yaml_cpp_TestFunc_recursedown(config);
    }
  }
  </code></pre>