Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
yaml-cpp
Commits
90f48fd0
Commit
90f48fd0
authored
Jan 20, 2012
by
beder
Browse files
Began new-api branch, and removed all traces of the old api from this branch
parent
9403ac04
Changes
28
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
2 additions
and
2759 deletions
+2
-2759
src/old-api/nodeownership.h
src/old-api/nodeownership.h
+0
-39
src/parser.cpp
src/parser.cpp
+0
-16
test/CMakeLists.txt
test/CMakeLists.txt
+1
-6
test/emittertests.cpp
test/emittertests.cpp
+0
-8
test/old-api/parsertests.cpp
test/old-api/parsertests.cpp
+0
-1221
test/old-api/spectests.cpp
test/old-api/spectests.cpp
+0
-1456
test/tests.cpp
test/tests.cpp
+1
-3
util/parse.cpp
util/parse.cpp
+0
-10
No files found.
src/old-api/nodeownership.h
deleted
100644 → 0
View file @
9403ac04
#ifndef NODE_OWNERSHIP_H_62B23520_7C8E_11DE_8A39_0800200C9A66
#define NODE_OWNERSHIP_H_62B23520_7C8E_11DE_8A39_0800200C9A66
#if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4
#pragma once
#endif
#include "yaml-cpp/noncopyable.h"
#include "ptr_vector.h"
#include <set>
namespace
YAML
{
class
Node
;
class
NodeOwnership
:
private
noncopyable
{
public:
explicit
NodeOwnership
(
NodeOwnership
*
pOwner
=
0
);
~
NodeOwnership
();
Node
&
Create
()
{
return
m_pOwner
->
_Create
();
}
void
MarkAsAliased
(
const
Node
&
node
)
{
m_pOwner
->
_MarkAsAliased
(
node
);
}
bool
IsAliased
(
const
Node
&
node
)
const
{
return
m_pOwner
->
_IsAliased
(
node
);
}
private:
Node
&
_Create
();
void
_MarkAsAliased
(
const
Node
&
node
);
bool
_IsAliased
(
const
Node
&
node
)
const
;
private:
ptr_vector
<
Node
>
m_nodes
;
std
::
set
<
const
Node
*>
m_aliasedNodes
;
NodeOwnership
*
m_pOwner
;
};
}
#endif // NODE_OWNERSHIP_H_62B23520_7C8E_11DE_8A39_0800200C9A66
src/parser.cpp
View file @
90f48fd0
...
...
@@ -9,11 +9,6 @@
#include <sstream>
#include <cstdio>
#ifdef YAML_CPP_OLD_API
#include "yaml-cpp/old-api/node.h"
#include "old-api/nodebuilder.h"
#endif
namespace
YAML
{
Parser
::
Parser
()
...
...
@@ -58,17 +53,6 @@ namespace YAML
return
true
;
}
#ifdef YAML_CPP_OLD_API
// GetNextDocument
// . Reads the next document in the queue (of tokens).
// . Throws a ParserException on error.
bool
Parser
::
GetNextDocument
(
Node
&
document
)
{
NodeBuilder
builder
(
document
);
return
HandleNextDocument
(
builder
);
}
#endif
// ParseDirectives
// . Reads any directives that are next in the queue.
void
Parser
::
ParseDirectives
()
...
...
test/CMakeLists.txt
View file @
90f48fd0
file
(
GLOB test_headers [a-z]*.h
)
file
(
GLOB test_sources [a-z]*.cpp
)
file
(
GLOB test_old_api_sources old-api/[a-z]*.cpp
)
file
(
GLOB test_new_api_sources new-api/[a-z]*.cpp
)
if
(
YAML_CPP_BUILD_OLD_API
)
list
(
APPEND test_sources
${
test_old_api_sources
}
)
else
()
list
(
APPEND test_sources
${
test_new_api_sources
}
)
endif
()
list
(
APPEND test_sources
${
test_new_api_sources
}
)
include_directories
(
${
YAML_CPP_SOURCE_DIR
}
/test
)
...
...
test/emittertests.cpp
View file @
90f48fd0
...
...
@@ -1008,15 +1008,7 @@ namespace Test
if
(
output
==
desiredOutput
)
{
try
{
#ifdef YAML_CPP_OLD_API
std
::
stringstream
stream
(
output
);
YAML
::
Parser
parser
;
YAML
::
Node
node
;
parser
.
GetNextDocument
(
node
);
#else
YAML
::
Node
node
=
YAML
::
Load
(
output
);
#endif
passed
++
;
}
catch
(
const
YAML
::
Exception
&
e
)
{
std
::
cout
<<
"Emitter test failed: "
<<
name
<<
"
\n
"
;
...
...
test/old-api/parsertests.cpp
deleted
100644 → 0
View file @
9403ac04
This diff is collapsed.
Click to expand it.
test/old-api/spectests.cpp
deleted
100644 → 0
View file @
9403ac04
This diff is collapsed.
Click to expand it.
test/tests.cpp
View file @
90f48fd0
...
...
@@ -23,10 +23,8 @@ namespace Test
if
(
!
RunSpecTests
())
passed
=
false
;
#ifndef YAML_CPP_OLD_API
if
(
!
RunNodeTests
())
passed
=
false
;
#endif
if
(
passed
)
std
::
cout
<<
"All tests passed!
\n
"
;
...
...
util/parse.cpp
View file @
90f48fd0
...
...
@@ -37,18 +37,8 @@ public:
void
parse
(
std
::
istream
&
input
)
{
try
{
#ifdef YAML_CPP_OLD_API
YAML
::
Parser
parser
(
input
);
YAML
::
Node
doc
;
while
(
parser
.
GetNextDocument
(
doc
))
{
YAML
::
Emitter
emitter
;
emitter
<<
doc
;
std
::
cout
<<
emitter
.
c_str
()
<<
"
\n
"
;
}
#else
YAML
::
Node
doc
=
YAML
::
Load
(
input
);
std
::
cout
<<
doc
<<
"
\n
"
;
#endif
}
catch
(
const
YAML
::
Exception
&
e
)
{
std
::
cerr
<<
e
.
what
()
<<
"
\n
"
;
}
...
...
Prev
1
2
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment