Code Monkey home page Code Monkey logo

yaml-cpp's People

Contributors

asmaloney avatar bruxisma avatar butataatawa avatar diogoteles08 avatar dota17 avatar hkarel avatar hyperxor avatar ithron avatar jbeder avatar jbreitbart avatar levi-armstrong avatar locutusofborg avatar martindelille avatar matthijsburgh avatar mwoehlke-kitware avatar neheb avatar ortham avatar paulnovo avatar philipdeegan avatar pinotree avatar rdeterre avatar swolchok avatar tambry avatar tchaikov avatar tedlyngmo avatar thevice avatar trompettesib avatar vehre-x41 avatar vmatare avatar zaucy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

yaml-cpp's Issues

Patch for skipping tools build

I just finished putting together a
[http://aur.archlinux.org/packages.php?ID=31122 package for Arch Linux] and
made a quick patch for CMakeLists.txt to skip building the yaml_reader and
parse tools/tests just to speed up compile time. Seems logical to me as
these things don't get installed and it ought to be useful for other packagers.

Note that the option leaves building these things enabled by default.

Original issue reported on code.google.com by [email protected] on 11 Oct 2009 at 7:36

Attachments:

Possible runtime error in YAML::Exception::what()

    virtual const char *what() const throw() {
      std::stringstream output;
      output << "Error at line " << line+1 << ", column " << column+1 << ":
" << msg;
      return output.str().c_str();
    }

returns a pointer to the peace of memory which will be deallocated after
deleting temporary object 'output'.

Original issue reported on code.google.com by [email protected] on 25 Jul 2009 at 7:18

Segmentation fault (SIGSEGV) on object destruction

To reproduce the problem:

std::string MyClass::getValue(const std::string &name) {
    YAML::Node node = this->document.GetValue(name);

    // […]
}

MyClass::~MyClass() {
    // SIGSEGV here
}

I use the SVN version (revision 78)

I guess that the problem is that the copy constructor of a node does not
copy its resources too. When it is freed once, these resources are freed
too. When the original resources are freed (in the class destructor), they
have already been freed and there may be a SIGSEGV.

The attribute in cause seems to be Node::m_pContent.

To correct this issue, just create a new Content instance in m_pContent, or
define the copy constructor as protected or private to forbid the copy, if
the content should not be duplicated.

Original issue reported on code.google.com by [email protected] on 16 Sep 2008 at 12:11

Patch against compilation warnings

It's just a small patch, it doesn't really change something. Just adds some
"default: break" to some switchs.

I normaly compile with -Wall under gcc and I always get those warnings
about not handled cases.

Original issue reported on code.google.com by [email protected] on 3 Jan 2009 at 5:39

Attachments:

Error while building with g++ compiler

When I tried to run make after cmake -L there was an error occured in
yaml-reader/main.cpp - using strcmp function without adding required header 

#include <string.h>

So the issue is only to include string library into taht file.

Best regards,
Mike

Original issue reported on code.google.com by [email protected] on 27 Jan 2009 at 10:10

Unsupported merges

Current version of otherwise great yaml-cpp does not seem to support merges
in a way described for example here:
http://en.wikipedia.org/wiki/YAML#Data_merge_and_references

I don't have a deep knowledge of yaml-cpp internals (I am just its user),
but maybe this is somehow linked with the cloning problem - not yet
sufficiently solved.

I have tested the simple form of a merge in yaml-cpp 0.2.0 on RedHat Linux
3.4.6-9 using gcc 3.4.6 (20060404) - it doesn't work, but at least it
doesn't hurt the parser. With that gcc I am unable to compile 0.2.1 because
of new conversion operators in nodeimpl.h (it reported an error on lines
with "node.Read<T>" and the thing that caused that error was very probably
the templated read).

Do you plan to support merges in some future version?

Original issue reported on code.google.com by [email protected] on 8 Sep 2009 at 10:38

Infinite loop when parsing unclosed inline block

Parsing "bad YAML: [" results in an infinite loop. I'm not exactly sure why
does it happen but I see that YAML::Scanner::VerifySimpleKey(), called from
YAML::Scanner::VerifyAllSimpleKeys() called from YAML::Scanner::EndStream()
never terminates and the key grows forever, e.g. I have

(gdb) p key
$4 = {
  pos = 10,
  line = 0,
  column = 6099472,
  flowLevel = 0,
  pMapStart = 0x7fff8c058450,
  pKey = 0x45691f
}

(notice the column value).

Original issue reported on code.google.com by [email protected] on 24 Sep 2008 at 8:47

CMakeLists.txt overrides CMAKE_CXX_FLAGS

Hello, i packaged yaml-cpp for inclusion in Fedora ( see details and
process status here: https://bugzilla.redhat.com/show_bug.cgi?id=529016 ).

As per Fedora Guidelines the distributed binary package must be rebuilt
from scratch from the sources; to successfully build the debuginfo package,
i had to modify CMakeLists.txt :

sed -i 's/set(CMAKE_CXX_FLAGS "-O2 -Wall -pedantic
-Wextra")/set(CMAKE_CXX_FLAGS "-O2 -Wall -pedantic -Wextra
${CMAKE_CXX_FLAGS}")/g' CMakeLists.txt

to make it append preset env to CMAKE_CXX_FLAGS instead of overwriting it.

Regards,

Original issue reported on code.google.com by guido.grazioli on 19 Oct 2009 at 5:16

Library is too slow

This Code:
{
    std::ifstream fin("Duck.yaml");
    YAML::Parser parser(fin);

    while(parser)
    {
        YAML::Node doc;
        parser.GetNextDocument(doc);
        std::cout << doc;
    }
}

With the attached file "Duck.yaml" (3d model, converted from COLLADA xml 
to yaml). Size: 326 kb

Loading time: 90 sec
Expected time: 1-3 sec (a speed given COLLADA library)

Compiler: VC9 (MSVS 2008)
Command: /Ox /GL /I "include" /D "WIN32" /D "NDEBUG" /D "_LIB" /D 
"_UNICODE" /D "UNICODE" /FD /EHsc /MD /Gy /Fo"Release\\" /Fd"Release
\vc90.pdb" /W3 /c /Zi /TP

Bad idea to use std::iostream for parsing large files, especially the 
character by character.

Original issue reported on code.google.com by [email protected] on 25 Jan 2009 at 2:44

Attachments:

yaml-reader binary segfaults if not run from the directory it resides in

What steps will reproduce the problem?
1. Build yaml-cpp
2. Run: ./yaml-reader/yaml-reader
3.

What is the expected output? What do you see instead?
I'd expect tests to pass :-). They do pass if I change cwd to wherever 
yaml-reader is built. If I don't I 
get a segfault

What version of the product are you using? On what operating system?
Current SVN trunk, x86_64 Linux using GCC

Please provide any additional information below.

ingmar@cannonball ~/development/git/yaml-cpp (git-svn)-[ingmar]- % 
./yaml-reader/yaml-reader
zsh: segmentation fault  ./yaml-reader/yaml-reader
ingmar@cannonball ~/development/git/yaml-cpp (git-svn)-[ingmar]- % gdb 
./yaml-reader/yaml-
reader
GNU gdb 6.8
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu"...
(gdb) run
Starting program: /home/ingmar/development/git/yaml-cpp/yaml-reader/yaml-reader

Program received signal SIGSEGV, Segmentation fault.
0x00000000004689b4 in YAML::Stream::peek ()
(gdb) bt
#0  0x00000000004689b4 in YAML::Stream::peek ()
#1  0x00000000004439ef in YAML::Scanner::ScanToNextToken ()
#2  0x00000000004435e9 in YAML::Scanner::ScanNextToken ()
#3  0x0000000000443593 in YAML::Scanner::EnsureTokensInQueue ()
#4  0x0000000000443448 in YAML::Scanner::empty ()
#5  0x0000000000432ed3 in YAML::Parser::operator bool ()
#6  0x0000000000429a74 in Test::Inout ()
#7  0x0000000000429905 in Test::RunAll ()
#8  0x00000000004283ba in main ()
(gdb)

Original issue reported on code.google.com by [email protected] on 29 May 2009 at 10:20

Problem with flow style map

The following flow style map should parse OK (I think):
  Numbers: [ one: 1,two: 2, three: 3 ]

If I call GetNextDocument() on this example, I get the follwing error
  ERROR: end of sequence flow not found

Fredo


Original issue reported on code.google.com by [email protected] on 4 Jun 2009 at 12:15

Parser seems to require "..." at the end of each document

Using Windows/VS2008, I have tried to parse the following file, which
contains two documents:

---
x: 3
y: 4
z: 5

---
w: 6
q: 7
v: 8

At the occurrence of the second "---", I get a ParserException, with the
message "end of map not found", even though this is ostensibly legal YAML
1.2.  Instead, I expected the parser to parse the two documents contained
in the file.

The same problem occurs on Example 2.28 in the YAML 1.2 spec:

    http://yaml.org/spec/1.2/#id2562339

The problem appears to be caused in the Map::ParseBlock() function,
specifically in this snippet, which, after each key, does not expect a
TT_DOC_START.

    Token token = pScanner->peek();
    if(token.type != TT_KEY && token.type != TT_BLOCK_END)
        throw ParserException(token.line, token.column, ErrorMsg::END_OF_MAP);

    pScanner->pop();
    if(token.type == TT_BLOCK_END)
        break;

I plan to take a stab at fixing this over the next day or so and contribute
a patch, but I wanted also to run it by you, since I'm a YAML and yaml-cpp
noob.  Is there a reason why supporting multiple documents without the
"..." marker at the end of each document is desirable?

Thanks for your time.

Original issue reported on code.google.com by [email protected] on 25 Jun 2009 at 12:56

Support for UTF-8 wchar_t

I am gonna use the library in my next project but need UTF-8 support. Is it
already possible to get UTF-8 content from the Nodes content variable?
So far I see no way to supply a new Read(const YAML::Node& node,
std::wstring& str) as I do not know how to get UTF-8 content from the node.

Original issue reported on code.google.com by [email protected] on 23 Oct 2008 at 8:33

Exception no longer has public member line or column

What steps will reproduce the problem?
1. Compile "When something goes wrong" code on parse example page

What is the expected output? What do you see instead?
'class YAML::ParserException' has no member named 'line' (or 'column')

What version of the product are you using? On what operating system?
rev 214

Please provide any additional information below.
Not sure if it's an intentional change, but I thought I'd report it just in
case it isn't

Original issue reported on code.google.com by [email protected] on 30 Jul 2009 at 6:00

Potential out-of-bounds memory read

What steps will reproduce the problem?
1. Read a YAML file

What is the expected output? What do you see instead?

Expected output is successful read of YAML file.
Out of bounds memory access on line 170 of scanner.cpp


What version of the product are you using? On what operating system?

Latest - running with electric fence on Linux.


Please provide any additional information below.

Line 170 of scanner.cpp should be changed to include a check that the input
is still in a valid state:


-           while(IsWhitespaceToBeEaten(INPUT.peek()))
+           while( INPUT && IsWhitespaceToBeEaten(INPUT.peek()))

Original issue reported on code.google.com by [email protected] on 31 Jul 2009 at 10:31

error compiling with visual studio 2008

Hello, 

i am trying to compile the library extracted from yaml-cpp-0.2.1.tar.gz
with visual studio 2008 express edition in windowsXP.

i am getting these errors.

i really can't understand that code :)

commenting the "namespace fallback" code
i get some further errors linking the exe.

let me know if i can help ..

Creating temporary file "c:\Documents and 
Settings\gaddo\Desktop\yaml\Debug\RSP00000A40802260.rsp" with contents
[
/Od /I "include" /D "_MBCS" /Gm /EHsc /RTC1 /MDd /Fo"Debug\\" 
/Fd"Debug\vc90.pdb" /W3 /c /Zi /TP ".\yaml-reader\tests.cpp"

".\yaml-reader\parsertests.cpp"

".\yaml-reader\emittertests.cpp"
]
Creating command line "cl.exe @"c:\Documents and 
Settings\gaddo\Desktop\yaml\Debug\RSP00000A40802260.rsp" /nologo 
/errorReport:prompt"
 Output Window      Compiling...
emittertests.cpp
c:\documents and settings\gaddo\desktop\yaml\include\nodereadimpl.h(41) : 
error C2061: syntax error : identifier 'flag'
c:\documents and settings\gaddo\desktop\yaml\include\nodereadimpl.h(41) : 
error C2809: 'operator ,' has no formal parameters
parsertests.cpp
c:\documents and settings\gaddo\desktop\yaml\include\nodereadimpl.h(41) : 
error C2061: syntax error : identifier 'flag'
c:\documents and settings\gaddo\desktop\yaml\include\nodereadimpl.h(41) : 
error C2809: 'operator ,' has no formal parameters
tests.cpp
c:\documents and settings\gaddo\desktop\yaml\include\nodereadimpl.h(41) : 
error C2061: syntax error : identifier 'flag'
c:\documents and settings\gaddo\desktop\yaml\include\nodereadimpl.h(41) : 
error C2809: 'operator ,' has no formal parameters
Generating Code...

Original issue reported on code.google.com by [email protected] on 8 Sep 2009 at 8:02

library cannot link on 64 bit architectures with shared objects

What steps will reproduce the problem?
1. Link on a 64 Bit Machine against a shared object

What is the expected output? What do you see instead?
It won't compile with the following warning: 
{{{
/usr/bin/ld:
/home/tfoote/stable/work/common/yaml-cpp/yaml-cpp/lib/libyaml-cpp.a(emitter.cpp.
o):
relocation R_X86_64_32 against `a local symbol' can not be used when making
a shared object; recompile with -fPIC
}}}

What version of the product are you using? On what operating system?
r265 on Ubuntu Jaunty 64 bit

Please provide any additional information below.
The problem is that on 64 bit architectures to link a static library
against a shared library it must have -fPIC declared.  CMake adds -fPIC to
64 bit shared libraries automatically.  There are two fixes.  One is to add
-fPIC to the compile flags for the static lib automatically.  The other is
to make it a shared object, for which CMake will automatically add -fPIC on
64 bit architectures.  

The preferred approach is to make the library a shared object.  The patch
for that is in shared.patch.  

The alternative is to add -fPIC manually to the static library.  The patch
for that is in fPIC.patch.  

If you have any questions I'm watching this issue.  

Original issue reported on code.google.com by Tully.Foote on 17 Sep 2009 at 7:14

Attachments:

Access to content of aliased nodes

Section 3.2.2.2 of the YAML 1.2 specification states, "In the
representation graph, a node may appear in more than one collection. When
serializing such data, the first occurrence of the node is identified by an
anchor. Each subsequent occurrence is serialized as an alias node which
refers back to this anchor."

Thus, when walking the representation, I think that the client code should
be able to access the value of the aliased node just as if that node were
present instead of the alias, but the client code should also be able to
detect the fact that the YAML::Node object actually represents the same
YAML node as another YAML::Node object and be able to identify the
corresponding YAML node (in case the client code maps some native object to
the YAML node).

For an example of the situation in question:
1. Create the following YAML document:

---
- &a "data"
- *a
...
2. Parse the document.
3. The second element of the sequence has no value and no way to determine
that it is linked to the first element.

What I suggest is:
- Allow access to the content of the node (The string "data" in this case)
through the alias as if the node were repeated.
- Add an IsAlias() method to the YAML::Node class that will allow the
client code (if it is interested) to determine that it is handling an alias.
- Add an Identity() method to the YAML::Node class that returns a unique
identity value for the content, allowing the client code to fully utilize
the node identity for mapping of native objects.

I have attached a patchfile for for the codebase
http://yaml-cpp.googlecode.com/svn/trunk@99
that implements the above changes.


Original issue reported on code.google.com by rtweeks21 on 4 May 2009 at 4:53

Attachments:

[PATCH] CMake buildsystem improvements

Hello again,

Attached are some CMake buildsystem improvements.
Using these I've created an initial yaml-cpp package for Exherbo [1].

You can also find those patches in my git mirror [2].

[1] http://git.exherbo.org/?p=dev/ingmar.git;a=tree;f=packages/dev-libs/libyaml
[2] http://github.com/ingmarv/yaml-cpp/tree/master

Looking forward to comments,
Ingmar

Original issue reported on code.google.com by [email protected] on 29 May 2009 at 10:27

Attachments:

Signature of Parser::GetNextDocument

It would probably be nice if, like getline with stdlib iostreams,
Parser::GetNextDocument would return a bool to indicate if there is still a
document available, so you'd be able to 

while (parser.GetNextDocument(doc)) {
  // do something with doc
}

instead of 

while (parser) {
  parser.GetNextDocument(doc);
  // ...
}

A patch is attached, seemed straightforward if I didn't miss anything ...

Original issue reported on code.google.com by stefan.walk on 29 Sep 2009 at 4:27

Attachments:

yaml-cpp library 0.2.1 cannot compile with older gcc

yaml-cpp 0.2.1+ library cannot be compiled with gcc 3.2.3 because of
changes in node.h, nodeimpl.h and new nodereadimpl.h.

The compiler output (with all warnings enabled which is my default
settings) follows:


g++32 -pthread -fident -Wall -c parser.cpp -o ../os/Linux/obj/parser.o
-I../include
In file included from parser.cpp:1:
../include/crt.h:1:9: warning: #pragma once is obsolete

[THE WHOLE BUNCH OF obsolete #pragma once WARNINGS HERE]

../include/nodeimpl.h:1:9: warning: #pragma once is obsolete
In file included from ../include/nodeimpl.h:7,
                 from ../include/node.h:135,
                 from ../include/parser.h:11,
                 from parser.cpp:2:
../include/nodeutil.h:1:9: warning: #pragma once is obsolete
In file included from ../include/node.h:135,
                 from ../include/parser.h:11,
                 from parser.cpp:2:
../include/nodeimpl.h: In function `bool YAML::operator==(const T&, const
   YAML::Node&)':
../include/nodeimpl.h:82: syntax error before `>' token
../include/nodeimpl.h:83: warning: no return statement in function returning
   non-void
../include/nodeimpl.h: In function `bool YAML::operator==(const YAML::Node&,
   const T&)':
../include/nodeimpl.h:87: syntax error before `>' token
../include/nodeimpl.h:88: warning: no return statement in function returning
   non-void
../include/nodeimpl.h: In function `bool YAML::operator!=(const T&, const
   YAML::Node&)':
../include/nodeimpl.h:92: syntax error before `>' token
../include/nodeimpl.h:93: warning: no return statement in function returning
   non-void
../include/nodeimpl.h: In function `bool YAML::operator!=(const YAML::Node&,
   const T&)':
../include/nodeimpl.h:97: syntax error before `>' token
../include/nodeimpl.h:98: warning: no return statement in function returning
   non-void
In file included from ../include/node.h:136,
                 from ../include/parser.h:11,
                 from parser.cpp:2:
../include/nodereadimpl.h:1:9: warning: #pragma once is obsolete
In file included from ../include/node.h:136,
                 from ../include/parser.h:11,
                 from parser.cpp:2:
../include/nodereadimpl.h: In member function `bool YAML::Node::Read(T&)
   const':
../include/nodereadimpl.h:53: syntax error before `,' token
../include/nodereadimpl.h:53: syntax error before `)' token
../include/nodereadimpl.h:54: warning: no return statement in function
   returning non-void
In file included from parser.cpp:3:
scanner.h:1:9: warning: #pragma once is obsolete
In file included from scanner.h:13,
                 from parser.cpp:3:
stream.h:1:9: warning: #pragma once is obsolete
In file included from scanner.h:14,
                 from parser.cpp:3:
token.h:1:9: warning: #pragma once is obsolete
../include/nodereadimpl.h: In member function `bool YAML::Node::Read(T&) const
   [with T = std::basic_string<char, std::char_traits<char>,
   std::allocator<char> >]':
../include/nodeimpl.h:46:   instantiated from `const YAML::Node*
YAML::Node::FindValueForKey(const T&) const [with T =
std::basic_string<char, std::char_traits<char>, std::allocator<char> >]'
../include/nodeimpl.h:34:   instantiated from `const YAML::Node*
YAML::Node::FindValue(const T&) const [with T = std::string]'
../include/nodeimpl.h:73:   instantiated from here
../include/nodereadimpl.h:51: warning: no return statement in function
   returning non-void


The previous error comes from the yaml-cpp 0.2.1 built on RedHat Linux
3.4.6-9 by the following gcc (through a custom makefile):

$ g++32 -v
Reading specs from /usr/lib/gcc-lib/x86_64-redhat-linux/3.2.3/specs
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
--infodir=/usr/share/info --enable-shared --enable-threads=posix
--disable-checking --with-system-zlib --enable-__cxa_atexit
--enable-languages=c,c++ --disable-libgcj --host=x86_64-redhat-linux
Thread model: posix
gcc version 3.2.3 20030502 (Red Hat Linux 3.2.3-47.3)

Original issue reported on code.google.com by [email protected] on 9 Sep 2009 at 7:46

Parsing/output of verbatim tags is incorrect

What steps will reproduce the problem?

1. add the following line:
    return false;
to yaml-reader/test.cpp in Inout() at line 73 at the end of the try{} block
so that false is returned if out.str() != out2.str().

2. Compile and run yaml-reader.


What is the expected output? What do you see instead?

The directives.yaml test fails.


What version of the product are you using? On what operating system?

svn head r85
ubuntu hardy x86_64


Please provide any additional information below.

The initial output of the parse of directives.yaml gives:
    ---
    - "basic node"
    - !<!howdy> "yeah baby"
but the output of the parse of the previous output gives:
    ---
    - "basic node"
    - !<!<!howdy>> "yeah baby"

I am not sure if this is an error in the parsing or output (I didn't think
yaml-cpp could emit yaml? Or is it just that there is currently just no way
to construct the nodes necessary to write out the yaml?) and I haven't
looked in to the cause much I'm afraid.  :o(  But I thought I'd report this
anyway.

Original issue reported on code.google.com by [email protected] on 26 Sep 2008 at 2:34

Runtime Crash under Visual Studio 2008 under WinXP

What steps will reproduce the problem?
0. When I parsed a .yml with a collection "namer:" instead of "name:" I got
a runtime crash (no way to debug this) until I discovered the
"YAML::RepresentationException"!
1. Entered wrong collection "namer:" instead of "name:"
2. Put parsing code into try-catch block which catches
"YAML::ParserException" only
3. Application crashes with Runtime Error, no debug possible.

What is the expected output? What do you see instead?
Not a crash. I see disaster!

What version of the product are you using? On what operating system?
Version 0.2.2

Please provide any additional information below.
Catching the error with "YAML::RepresentationException" fixed it so far.

Original issue reported on code.google.com by [email protected] on 15 Sep 2009 at 12:55

YAML emitter needed

This is to officially suggest that yaml-cpp include a YAML emitter. I've begun 
to seriously sketch an 
API that I think will work, and I'll be updating soon. I think this will be a 
better forum than the wiki 
that I set up (since that got approximately zero comments). Comments and 
criticisms on what 
follows are always welcome.

Original issue reported on code.google.com by [email protected] on 10 May 2009 at 6:26

Exception message: "Error at line ..." -> "YAML parse error at ..."

Any chance the output message of YAML::Exception could be changed something like
suggested in the summary? That way when I see an exception message printed by a
generic "catch (std::exception& e)" line, it'd be obvious when the error comes 
from
parsing something. Of course, that can't give the most informative message 
since the
YAML parser doesn't know the document name, but it's still convenient for small 
pieces
of code.

Thanks. Doesn't look like google code lets me specify when an "issue" is a bug 
or
enhancement..

Original issue reported on code.google.com by [email protected] on 18 Aug 2009 at 10:12

Problem with windows-style line endings.

What steps will reproduce the problem?
1. Build yaml-cpp r98 under Visual Studio.
2. Load a file with windows line endings.
3. Parse the file.  For me, YAML loads a lot of bunk data at the end of the
file that causes errors in ScanScalar.

I was able to fix the problem by changing line 15 of stream.cpp from

pBuf->sgetn(buffer, size);

to:

size = pBuf->sgetn(buffer, size);


I'm not 100% sure I understand the problem, but I think it has to do with
the way the VS CRT handles windows line endings.  I think pubseekoff()
returns the actual character number but sgetn() automatically converts
CRLFs to CRs under the hood, causing sgetn() to read fewer characters than
are in the file.

Original issue reported on code.google.com by [email protected] on 6 Feb 2009 at 10:26

support for an alternative to C++ stream style methods to read values from a Node.

C++ style stream operators can look neat, but are really not very convenient at 
times.
An improvised example:
{{{
#!c++
Coord Coord::create (YAML::Node& node) {
  double x, y;
  node["x"] >> x;
  node["y"] >> y;
  return Coord (x,y);
}

// couldn't we instead write the following and avoid those temporary variables?
Coord Coord::create (YAML::Node& node) {
  return Coord (node["x"].read<double>(), node["y"].read<double>());
}
}}}

It should be really easy to implement:
{{{
    template <typename T>
    inline T Node::read () const {
        T value;
        if(!Read(value))
            throw InvalidScalar(m_mark);
    }
}}}
Feel free to rename it of course, "read" is just a convenient name but doesn't 
really fit
with the naming scheme (and "Read" would conflict). Perhaps "Scalar".

That it has to be templated is annoying, but we can't overload functions by 
return type
(why, I never quite figured out...). Anyway, implementing this (as a template) 
looks
fairly consistent and is a nice alternative to ">>".

And thanks; other  than this little niggle yaml-cpp is a really nice 
easy-to-use library!
(Btw I also created a templated method to read a node into a std::vector. Are 
you
interested in adding code like this to the library?)

Original issue reported on code.google.com by [email protected] on 18 Aug 2009 at 10:01

Support for accessing keys with std::wstring

From bobbycoul:

Well you convert string to wstring so unicode strings are not correctly read 
from the yaml file, 
let's say you have this:

{{{
--- # yaml file
vers_ف_ion: 1.0 xx_ف_xx
}}}

you see what i mean? what could be nice to do to get it would be something like:

{{{
wstring str;
node[L"vers_ف_ion"] >> str;
}}}
with the cpp file encoded with unicode or utf8.

do you get my point? So in this case all could be in utf8, the keys, and also 
any text in the file.



Original issue reported on code.google.com by [email protected] on 17 Jul 2009 at 2:18

Missing includes with gcc-4.4

In gcc-4.4 even more header files got cleaned up and more "#include
<cstdio>"'s are needed in the parser implementation for "EOF":

diff -Naur yaml-cpp-read-only.orig/src/exp.h yaml-cpp-read-only/src/exp.h
--- yaml-cpp-read-only.orig/src/exp.h   2009-01-27 21:08:50.000000000 +0100
+++ yaml-cpp-read-only/src/exp.h        2009-01-27 21:25:00.000000000 +0100
@@ -3,6 +3,7 @@
 #include "regex.h"
 #include <string>
 #include <ios>
+#include <cstdio>
 #include "stream.h"

 namespace YAML
diff -Naur yaml-cpp-read-only.orig/src/parser.cpp
yaml-cpp-read-only/src/parser.cpp
--- yaml-cpp-read-only.orig/src/parser.cpp      2009-01-27
21:08:50.000000000 +0100
+++ yaml-cpp-read-only/src/parser.cpp   2009-01-27 21:25:20.000000000 +0100
@@ -4,6 +4,7 @@
 #include "token.h"
 #include "exceptions.h"
 #include <sstream>
+#include <cstdio>

 namespace YAML
 {

Original issue reported on code.google.com by [email protected] on 27 Jan 2009 at 8:32

Add header file inclusion guards

'#pragma once' is not well supported beyond MSVC and recent versions of GCC. By 
providing header 
guards as well as #pragma once, one can obtain both the performance benefit of 
#pragma once, and 
wider  portability.

See: http://en.wikipedia.org/wiki/Pragma_once#Advantages_and_disadvantages

Original issue reported on code.google.com by swiftcoder on 29 Jul 2009 at 6:15

Can't handle simple keys with aliases or tags

The following both cause yaml-cpp to choke

    &a b: c
    !a b: c

(it spits out the error "illegal map value").

The problem is that it invalidates the potential simple key that was
created at the `&a` token when it reaches the `b` token.

Original issue reported on code.google.com by [email protected] on 5 Sep 2009 at 2:59

Add output (extraction) operator

add:

        friend std::ostream& operator << (std::ostream& out, const Node& node);

in node.h

and add:

    inline std::ostream& operator << (std::ostream& out, const Node& node) {
        std::string scalar;
        if(!node.GetScalar(scalar))
            throw InvalidScalar(node.m_mark);

        out << scalar;

        return out;
    };

in nodeimpl.h

Original issue reported on code.google.com by [email protected] on 20 Oct 2009 at 10:17

'make install' issue

What steps will reproduce the problem?
1. checkout/compile latest source according to instructions
2. run 'make install' as root

What is the expected output? What do you see instead?
I see an error loooking for the yaml-cpp.pc file in the _original source_
directory, and not the build directory.

What version of the product are you using? On what operating system?
Ubuntu Linux 9.0.4, checked out subversion source just now

Please provide any additional information below.
The yaml-cpp.pc is generated in the build directory. I copied it to the
source directory and re-ran 'make install' and it worked fine.

Original issue reported on code.google.com by [email protected] on 24 Jul 2009 at 4:00

Default constructor for YAML::Parser

It would be nice if YAML::Parser provided a default constructor, so you
could assign it a stream later with parser.Load - this would be useful in
order to use the parser as a class member, when the stream-to-be-read can
not be constructed in the initializer list.

Original issue reported on code.google.com by stefan.walk on 30 Sep 2009 at 10:59

wrong yaml-cpp.pc

According to existent version of yaml-cpp.pc.cmake we are getting this rows
in yaml-cpp.pc:

prefix=/usr/local
exec_prefix=/usr/local
libdir=lib
includedir=include/yaml-cpp

And this is wrong, because `pkg-config yaml-cpp --cflags` will return
"-Iinclude/yaml-cpp"... it's not what expected to be.

By adding prefix variable you can solve this issue.

yaml-cpp.pc.cmake:
libdir=${prefix}/@LIB_INSTALL_DIR@
includedir=${prefix}/@INCLUDE_INSTALL_DIR@

Now `pkg-config yaml-cpp --cflags` will work as expected, returning
"-I/usr/local/include/yaml-cpp".

/Vasily

Original issue reported on code.google.com by [email protected] on 25 Jul 2009 at 3:05

No support for character encodings other than UTF-8

The current implementation of the library assumes that the stream
(std::istream) provided to the parser will produce a stream of UTF-8 octets
(with no leading byte order mark).  This means that yaml-cpp does not
currently support reading files in UTF-16 or UTF-32 (either little- or
big-endian, with or without byte order mark), nor does it support reading
UTF-8 files with a leading byte order mark.

Attached is a patch to allow streams of octets in any of the YAML supported
character encodings, based on revision 177 of the trunk.

I also, incidentally, patched the fetch from the stream so that it fetches
a chunk (of up to YAML_PREFETCH_SIZE octets) at a time rather than seeking
on the stream (which usually fails for streams like std::cin) to determine
the stream's length.

Original issue reported on code.google.com by rtweeks21 on 3 Jul 2009 at 5:18

Attachments:

More detailed exception messages

It would be nice if there were more information in the exception messages.
 For example, instead of "key not found", something like:
key [key_name] not found

If you know the path to the node, it could even be:
key [key_name] not found in node [a.b.c.e]

Original issue reported on code.google.com by [email protected] on 21 Aug 2009 at 2:09

[P]

What steps will reproduce the problem?
1. Build yaml-cpp with GCC & -Wall enabled
2.
3.

What is the expected output? What do you see instead?


What version of the product are you using? On what operating system?
Current SVN trunk, Linux x86_64 with GCC

Patch attached

Original issue reported on code.google.com by [email protected] on 29 May 2009 at 10:23

Attachments:

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.