-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
43 lines (37 loc) · 796 Bytes
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#include <iostream>
#include <fstream>
#include <string>
#include <sstream>
#include <yaml-cpp/yaml.h>
#include <stdio.h>
using namespace std;
void spliter(string s, char del)
{
stringstream ss(s);
string word;
int i=0;
while (!ss.eof()) {
getline(ss, word, del);
if (i%2==0){
cout << word << endl;
}
i++;
}
}
void likeTxt(){
string myText;
ifstream MyReadFile("Fruits.yaml");
while (getline (MyReadFile, myText)) {
spliter(myText, '#');
cout << endl;
}
MyReadFile.close();
}
int main() {
string file;
cout<<"Give me path and name of your Yaml file ";
cin>>file;
YAML::Node node;
YAML::Node _baseNode = YAML::LoadFile(file);
std::cout << _baseNode<< endl;
}