Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yaml-cpp
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
yaml-cpp
Commits
ddc578db
Commit
ddc578db
authored
Jan 11, 2012
by
Jesse Beder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added LoadFile and LoadAllFromFile (new API)
parent
8906ae9a
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
0 deletions
+13
-0
include/yaml-cpp/node/parse.h
+2
-0
src/node/parse.cpp
+11
-0
No files found.
include/yaml-cpp/node/parse.h
View file @
ddc578db
...
...
@@ -16,10 +16,12 @@ namespace YAML
Node
Load
(
const
std
::
string
&
input
);
Node
Load
(
const
char
*
input
);
Node
Load
(
std
::
istream
&
input
);
Node
LoadFile
(
const
std
::
string
&
filename
);
std
::
vector
<
Node
>
LoadAll
(
const
std
::
string
&
input
);
std
::
vector
<
Node
>
LoadAll
(
const
char
*
input
);
std
::
vector
<
Node
>
LoadAll
(
std
::
istream
&
input
);
std
::
vector
<
Node
>
LoadAllFromFile
(
const
std
::
string
&
filename
);
}
#endif // VALUE_PARSE_H_62B23520_7C8E_11DE_8A39_0800200C9A66
...
...
src/node/parse.cpp
View file @
ddc578db
...
...
@@ -4,6 +4,7 @@
#include "yaml-cpp/parser.h"
#include "nodebuilder.h"
#include <fstream>
#include <sstream>
namespace
YAML
...
...
@@ -27,6 +28,11 @@ namespace YAML
return
builder
.
Root
();
}
Node
LoadFile
(
const
std
::
string
&
filename
)
{
std
::
ifstream
fin
(
filename
.
c_str
());
return
Load
(
fin
);
}
std
::
vector
<
Node
>
LoadAll
(
const
std
::
string
&
input
)
{
std
::
stringstream
stream
(
input
);
return
LoadAll
(
stream
);
...
...
@@ -50,4 +56,9 @@ namespace YAML
return
docs
;
}
std
::
vector
<
Node
>
LoadAllFromFile
(
const
std
::
string
&
filename
)
{
std
::
ifstream
fin
(
filename
.
c_str
());
return
LoadAll
(
fin
);
}
}
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