Moved all code to src/ and include/ directories.

This commit is contained in:
Jesse Beder
2008-07-14 04:33:30 +00:00
parent 4cfa233888
commit cadc04ce47
35 changed files with 43 additions and 33 deletions

35
src/stream.cpp Normal file
View File

@@ -0,0 +1,35 @@
#include "stream.h"
namespace YAML
{
// 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();
}
}