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
d6aeb164
Commit
d6aeb164
authored
Mar 03, 2011
by
Jesse Beder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Switched the scanner list of owned indent markers to a ptr_vector
parent
a518d87c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
12 deletions
+10
-12
src/scanner.cpp
+4
-7
src/scanner.h
+6
-5
No files found.
src/scanner.cpp
View file @
d6aeb164
...
@@ -14,9 +14,6 @@ namespace YAML
...
@@ -14,9 +14,6 @@ namespace YAML
Scanner
::~
Scanner
()
Scanner
::~
Scanner
()
{
{
for
(
unsigned
i
=
0
;
i
<
m_indentRefs
.
size
();
i
++
)
delete
m_indentRefs
[
i
];
m_indentRefs
.
clear
();
}
}
// empty
// empty
...
@@ -237,9 +234,9 @@ namespace YAML
...
@@ -237,9 +234,9 @@ namespace YAML
{
{
m_startedStream
=
true
;
m_startedStream
=
true
;
m_simpleKeyAllowed
=
true
;
m_simpleKeyAllowed
=
true
;
IndentMarker
*
pIndent
=
new
IndentMarker
(
-
1
,
IndentMarker
::
NONE
);
std
::
auto_ptr
<
IndentMarker
>
pIndent
(
new
IndentMarker
(
-
1
,
IndentMarker
::
NONE
)
);
m_indentRefs
.
push_back
(
pIndent
);
m_indentRefs
.
push_back
(
pIndent
);
m_indents
.
push
(
pIndent
);
m_indents
.
push
(
&
m_indentRefs
.
back
()
);
}
}
// EndStream
// EndStream
...
@@ -299,8 +296,8 @@ namespace YAML
...
@@ -299,8 +296,8 @@ namespace YAML
// and then the indent
// and then the indent
m_indents
.
push
(
&
indent
);
m_indents
.
push
(
&
indent
);
m_indentRefs
.
push_back
(
pIndent
.
release
()
);
m_indentRefs
.
push_back
(
pIndent
);
return
m_indentRefs
.
back
();
return
&
m_indentRefs
.
back
();
}
}
// PopIndentToHere
// PopIndentToHere
...
...
src/scanner.h
View file @
d6aeb164
...
@@ -12,6 +12,7 @@
...
@@ -12,6 +12,7 @@
#include <stack>
#include <stack>
#include <set>
#include <set>
#include <map>
#include <map>
#include "ptr_vector.h"
#include "stream.h"
#include "stream.h"
#include "token.h"
#include "token.h"
...
@@ -114,16 +115,16 @@ namespace YAML
...
@@ -114,16 +115,16 @@ namespace YAML
Stream
INPUT
;
Stream
INPUT
;
// the output (tokens)
// the output (tokens)
std
::
queue
<
Token
>
m_tokens
;
std
::
queue
<
Token
>
m_tokens
;
// state info
// state info
bool
m_startedStream
,
m_endedStream
;
bool
m_startedStream
,
m_endedStream
;
bool
m_simpleKeyAllowed
;
bool
m_simpleKeyAllowed
;
bool
m_canBeJSONFlow
;
bool
m_canBeJSONFlow
;
std
::
stack
<
SimpleKey
>
m_simpleKeys
;
std
::
stack
<
SimpleKey
>
m_simpleKeys
;
std
::
stack
<
IndentMarker
*>
m_indents
;
std
::
stack
<
IndentMarker
*>
m_indents
;
std
::
vector
<
IndentMarker
*
>
m_indentRefs
;
// for "garbage collection"
ptr_vector
<
IndentMarker
>
m_indentRefs
;
// for "garbage collection"
std
::
stack
<
FLOW_MARKER
>
m_flows
;
std
::
stack
<
FLOW_MARKER
>
m_flows
;
};
};
}
}
...
...
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