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
b113c378
"...resnet50_tensorflow.git" did not exist on "2f43cff2b72e9a5bee26d31e4e8af3087a5618e1"
Commit
b113c378
authored
Jul 10, 2009
by
Jesse Beder
Browse files
Clarified some copy/assignment issues with the stream/streamcharsource.
parent
6f44e89b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
6 deletions
+8
-6
src/stream.h
src/stream.h
+2
-1
src/streamcharsource.h
src/streamcharsource.h
+6
-5
No files found.
src/stream.h
View file @
b113c378
#pragma once
#pragma once
#include "noncopyable.h"
#include <deque>
#include <deque>
#include <ios>
#include <ios>
#include <string>
#include <string>
...
@@ -10,7 +11,7 @@ namespace YAML
...
@@ -10,7 +11,7 @@ namespace YAML
{
{
static
const
size_t
MAX_PARSER_PUSHBACK
=
8
;
static
const
size_t
MAX_PARSER_PUSHBACK
=
8
;
class
Stream
class
Stream
:
private
noncopyable
{
{
public:
public:
friend
class
StreamCharSource
;
friend
class
StreamCharSource
;
...
...
src/streamcharsource.h
View file @
b113c378
#pragma once
#pragma once
#include "noncopyable.h"
#include <cstddef>
#include <cstddef>
namespace
YAML
namespace
YAML
...
@@ -7,9 +8,10 @@ namespace YAML
...
@@ -7,9 +8,10 @@ namespace YAML
class
StreamCharSource
class
StreamCharSource
{
{
public:
public:
StreamCharSource
(
const
Stream
&
stream
);
StreamCharSource
(
const
Stream
&
stream
)
:
m_offset
(
0
),
m_stream
(
stream
)
{}
StreamCharSource
(
const
StreamCharSource
&
source
)
:
m_offset
(
source
.
m_offset
),
m_stream
(
source
.
m_stream
)
{}
~
StreamCharSource
()
{}
~
StreamCharSource
()
{}
operator
bool
()
const
;
operator
bool
()
const
;
char
operator
[]
(
std
::
size_t
i
)
const
{
return
m_stream
.
CharAt
(
m_offset
+
i
);
}
char
operator
[]
(
std
::
size_t
i
)
const
{
return
m_stream
.
CharAt
(
m_offset
+
i
);
}
bool
operator
!
()
const
{
return
!
static_cast
<
bool
>
(
*
this
);
}
bool
operator
!
()
const
{
return
!
static_cast
<
bool
>
(
*
this
);
}
...
@@ -19,11 +21,10 @@ namespace YAML
...
@@ -19,11 +21,10 @@ namespace YAML
private:
private:
std
::
size_t
m_offset
;
std
::
size_t
m_offset
;
const
Stream
&
m_stream
;
const
Stream
&
m_stream
;
StreamCharSource
&
operator
=
(
const
StreamCharSource
&
);
// non-assignable
};
};
inline
StreamCharSource
::
StreamCharSource
(
const
Stream
&
stream
)
:
m_offset
(
0
),
m_stream
(
stream
)
{
}
inline
StreamCharSource
::
operator
bool
()
const
{
inline
StreamCharSource
::
operator
bool
()
const
{
return
m_stream
.
ReadAheadTo
(
m_offset
);
return
m_stream
.
ReadAheadTo
(
m_offset
);
}
}
...
...
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