mirror of
https://github.com/jbeder/yaml-cpp.git
synced 2025-09-09 04:41:16 +00:00
Set the eol style to native for all files.
This commit is contained in:
106
src/stream.cpp
106
src/stream.cpp
@@ -1,53 +1,53 @@
|
||||
#include "crt.h"
|
||||
#include "stream.h"
|
||||
#include <iostream>
|
||||
|
||||
namespace YAML
|
||||
{
|
||||
int Stream::pos() const
|
||||
{
|
||||
return input.tellg();
|
||||
}
|
||||
|
||||
char Stream::peek()
|
||||
{
|
||||
return input.peek();
|
||||
}
|
||||
|
||||
Stream::operator bool()
|
||||
{
|
||||
return input.good();
|
||||
}
|
||||
|
||||
// get
|
||||
// . Extracts a character from the stream and updates our position
|
||||
char Stream::get()
|
||||
{
|
||||
char ch = input.get();
|
||||
column++;
|
||||
if(ch == '\n') {
|
||||
column = 0;
|
||||
line++;
|
||||
}
|
||||
return ch;
|
||||
}
|
||||
|
||||
// get
|
||||
// . Extracts 'n' characters from the stream and updates our position
|
||||
std::string Stream::get(int n)
|
||||
{
|
||||
std::string ret;
|
||||
for(int i=0;i<n;i++)
|
||||
ret += get();
|
||||
return ret;
|
||||
}
|
||||
|
||||
// eat
|
||||
// . Eats 'n' characters and updates our position.
|
||||
void Stream::eat(int n)
|
||||
{
|
||||
for(int i=0;i<n;i++)
|
||||
get();
|
||||
}
|
||||
|
||||
}
|
||||
#include "crt.h"
|
||||
#include "stream.h"
|
||||
#include <iostream>
|
||||
|
||||
namespace YAML
|
||||
{
|
||||
int Stream::pos() const
|
||||
{
|
||||
return input.tellg();
|
||||
}
|
||||
|
||||
char Stream::peek()
|
||||
{
|
||||
return input.peek();
|
||||
}
|
||||
|
||||
Stream::operator bool()
|
||||
{
|
||||
return input.good();
|
||||
}
|
||||
|
||||
// get
|
||||
// . Extracts a character from the stream and updates our position
|
||||
char Stream::get()
|
||||
{
|
||||
char ch = input.get();
|
||||
column++;
|
||||
if(ch == '\n') {
|
||||
column = 0;
|
||||
line++;
|
||||
}
|
||||
return ch;
|
||||
}
|
||||
|
||||
// get
|
||||
// . Extracts 'n' characters from the stream and updates our position
|
||||
std::string Stream::get(int n)
|
||||
{
|
||||
std::string ret;
|
||||
for(int i=0;i<n;i++)
|
||||
ret += get();
|
||||
return ret;
|
||||
}
|
||||
|
||||
// eat
|
||||
// . Eats 'n' characters and updates our position.
|
||||
void Stream::eat(int n)
|
||||
{
|
||||
for(int i=0;i<n;i++)
|
||||
get();
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user