From 7f2c3591e32ef008b5e2e4518d4192b2135eb81f Mon Sep 17 00:00:00 2001 From: jbeder Date: Wed, 3 Sep 2008 22:17:17 +0000 Subject: [PATCH] Unified line endings. --- include/crt.h | 4 ++-- include/exceptions.h | 2 +- include/yaml.h | 4 ++-- src/map.cpp | 2 +- src/node.cpp | 14 +++++++------- src/parser.cpp | 2 +- src/regex.cpp | 16 ++++++++-------- src/sequence.cpp | 2 +- src/stream.cpp | 34 +++++++++++++++++----------------- yaml-reader/main.cpp | 18 +++++++++--------- yaml-reader/tests.cpp | 20 ++++++++++---------- yaml-reader/tests/test.yaml | 2 +- 12 files changed, 60 insertions(+), 60 deletions(-) diff --git a/include/crt.h b/include/crt.h index 500ef01..ed2b68a 100644 --- a/include/crt.h +++ b/include/crt.h @@ -7,5 +7,5 @@ #include #include -#endif // _DEBUG - +#endif // _DEBUG + diff --git a/include/exceptions.h b/include/exceptions.h index 3185b13..29c555a 100644 --- a/include/exceptions.h +++ b/include/exceptions.h @@ -10,7 +10,7 @@ namespace YAML public: ParserException(int line_, int column_, const std::string& msg_) : line(line_), column(column_), msg(msg_) {} - virtual ~ParserException() throw () {} + virtual ~ParserException() throw () {} int line, column; std::string msg; diff --git a/include/yaml.h b/include/yaml.h index f64e07a..8286be4 100644 --- a/include/yaml.h +++ b/include/yaml.h @@ -4,5 +4,5 @@ #include "parser.h" #include "node.h" #include "iterator.h" -#include "exceptions.h" - +#include "exceptions.h" + diff --git a/src/map.cpp b/src/map.cpp index 42c381e..727726b 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -3,7 +3,7 @@ #include "node.h" #include "scanner.h" #include "token.h" -#include "exceptions.h" +#include "exceptions.h" #include namespace YAML diff --git a/src/node.cpp b/src/node.cpp index ac3cbec..64ec8b3 100644 --- a/src/node.cpp +++ b/src/node.cpp @@ -148,13 +148,13 @@ namespace YAML { if(!m_pContent) return CT_NONE; - - if(m_pContent->IsScalar()) - return CT_SCALAR; - else if(m_pContent->IsSequence()) - return CT_SEQUENCE; - else if(m_pContent->IsMap()) - return CT_MAP; + + if(m_pContent->IsScalar()) + return CT_SCALAR; + else if(m_pContent->IsSequence()) + return CT_SEQUENCE; + else if(m_pContent->IsMap()) + return CT_MAP; return CT_NONE; } diff --git a/src/parser.cpp b/src/parser.cpp index 7566526..18c7c8d 100644 --- a/src/parser.cpp +++ b/src/parser.cpp @@ -121,7 +121,7 @@ namespace YAML } void Parser::PrintTokens(std::ostream& out) - { + { while(1) { if(m_pScanner->empty()) break; diff --git a/src/regex.cpp b/src/regex.cpp index 45ce684..c40a087 100644 --- a/src/regex.cpp +++ b/src/regex.cpp @@ -1,6 +1,6 @@ #include "crt.h" -#include "regex.h" -#include "stream.h" +#include "regex.h" +#include "stream.h" #include namespace YAML @@ -92,8 +92,8 @@ namespace YAML bool RegEx::Matches(std::istream& in) const { return Match(in) >= 0; - } - + } + bool RegEx::Matches(Stream& in) const { return Match(in) >= 0; @@ -113,12 +113,12 @@ namespace YAML return m_pOp->Match(str, *this); } - // Match + // Match int RegEx::Match(Stream& in) const - { + { return Match(in.stream()); - } - + } + // Match // . The stream version does the same thing as the string version; // REMEMBER that we only match from the start of the stream! diff --git a/src/sequence.cpp b/src/sequence.cpp index 985f979..f997a79 100644 --- a/src/sequence.cpp +++ b/src/sequence.cpp @@ -2,7 +2,7 @@ #include "sequence.h" #include "node.h" #include "scanner.h" -#include "token.h" +#include "token.h" #include namespace YAML diff --git a/src/stream.cpp b/src/stream.cpp index 07e0c54..73d4129 100644 --- a/src/stream.cpp +++ b/src/stream.cpp @@ -1,24 +1,24 @@ #include "crt.h" -#include "stream.h" +#include "stream.h" #include namespace YAML { - int Stream::pos() const - { - return input.tellg(); - } - - char Stream::peek() - { - return input.peek(); - } - - Stream::operator bool() - { - return input.good(); + 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() @@ -48,6 +48,6 @@ namespace YAML { for(int i=0;i