From ad92dc50b7cdf7cfe086f21d19442d03a90fd05d Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Wed, 9 May 2007 15:04:31 +0000 Subject: Just a few things re-arranged, moved the new taf/xml systems to the inprogress directory, and moved the old xml system in, so it will require heavy changes. --- src/inprogress/tafdocument.cpp | 9 ++ src/inprogress/tafdocument.h | 22 ++++ src/inprogress/tafnode.cpp | 9 ++ src/inprogress/tafnode.h | 21 ++++ src/inprogress/tafreader.cpp | 11 ++ src/inprogress/tafreader.h | 25 ++++ src/inprogress/tafwriter.cpp | 9 ++ src/inprogress/tafwriter.h | 22 ++++ src/inprogress/xmldocument.cpp | 9 ++ src/inprogress/xmldocument.h | 22 ++++ src/inprogress/xmlnode.cpp | 9 ++ src/inprogress/xmlnode.h | 22 ++++ src/inprogress/xmlreader.cpp | 267 +++++++++++++++++++++++++++++++++++++++++ src/inprogress/xmlreader.h | 121 +++++++++++++++++++ src/inprogress/xmlwriter.cpp | 9 ++ src/inprogress/xmlwriter.h | 22 ++++ 16 files changed, 609 insertions(+) create mode 100644 src/inprogress/tafdocument.cpp create mode 100644 src/inprogress/tafdocument.h create mode 100644 src/inprogress/tafnode.cpp create mode 100644 src/inprogress/tafnode.h create mode 100644 src/inprogress/tafreader.cpp create mode 100644 src/inprogress/tafreader.h create mode 100644 src/inprogress/tafwriter.cpp create mode 100644 src/inprogress/tafwriter.h create mode 100644 src/inprogress/xmldocument.cpp create mode 100644 src/inprogress/xmldocument.h create mode 100644 src/inprogress/xmlnode.cpp create mode 100644 src/inprogress/xmlnode.h create mode 100644 src/inprogress/xmlreader.cpp create mode 100644 src/inprogress/xmlreader.h create mode 100644 src/inprogress/xmlwriter.cpp create mode 100644 src/inprogress/xmlwriter.h (limited to 'src/inprogress') diff --git a/src/inprogress/tafdocument.cpp b/src/inprogress/tafdocument.cpp new file mode 100644 index 0000000..bd44dd5 --- /dev/null +++ b/src/inprogress/tafdocument.cpp @@ -0,0 +1,9 @@ +#include "tafdocument.h" + +Bu::TafDocument::TafDocument() +{ +} + +Bu::TafDocument::~TafDocument() +{ +} diff --git a/src/inprogress/tafdocument.h b/src/inprogress/tafdocument.h new file mode 100644 index 0000000..171f829 --- /dev/null +++ b/src/inprogress/tafdocument.h @@ -0,0 +1,22 @@ +#ifndef BU_TAF_DOCUMENT_H +#define BU_TAF_DOCUMENT_H + +#include + +namespace Bu +{ + /** + * + */ + class TafDocument + { + public: + TafDocument(); + virtual ~TafDocument(); + + private: + + }; +} + +#endif diff --git a/src/inprogress/tafnode.cpp b/src/inprogress/tafnode.cpp new file mode 100644 index 0000000..c9756ec --- /dev/null +++ b/src/inprogress/tafnode.cpp @@ -0,0 +1,9 @@ +#include "tafnode.h" + +Bu::TafNode::TafNode() +{ +} + +Bu::TafNode::~TafNode() +{ +} diff --git a/src/inprogress/tafnode.h b/src/inprogress/tafnode.h new file mode 100644 index 0000000..34f5289 --- /dev/null +++ b/src/inprogress/tafnode.h @@ -0,0 +1,21 @@ +#ifndef BU_TAF_NODE_H +#define BU_TAF_NODE_H + +#include + +namespace Bu +{ + /** + * + */ + class TafNode + { + public: + TafNode(); + virtual ~TafNode(); + + private: + + }; +} +#endif diff --git a/src/inprogress/tafreader.cpp b/src/inprogress/tafreader.cpp new file mode 100644 index 0000000..f94fe44 --- /dev/null +++ b/src/inprogress/tafreader.cpp @@ -0,0 +1,11 @@ +#include "tafreader.h" + +Bu::TafReader::TafReader( Bu::Stream &sIn ) : + sIn( sIn ) +{ +} + +Bu::TafReader::~TafReader() +{ +} + diff --git a/src/inprogress/tafreader.h b/src/inprogress/tafreader.h new file mode 100644 index 0000000..2dbb9ea --- /dev/null +++ b/src/inprogress/tafreader.h @@ -0,0 +1,25 @@ +#ifndef BU_TAF_READER_H +#define BU_TAF_READER_H + +#include +#include "bu/tafdocument.h" +#include "bu/stream.h" + +namespace Bu +{ + /** + * + */ + class TafReader : public Bu::TafDocument + { + public: + TafReader( Bu::Stream &sIn ); + virtual ~TafReader(); + + private: + Stream &sIn; + + }; +} + +#endif diff --git a/src/inprogress/tafwriter.cpp b/src/inprogress/tafwriter.cpp new file mode 100644 index 0000000..3e6c025 --- /dev/null +++ b/src/inprogress/tafwriter.cpp @@ -0,0 +1,9 @@ +#include "tafwriter.h" + +Bu::TafWriter::TafWriter() +{ +} + +Bu::TafWriter::~TafWriter() +{ +} diff --git a/src/inprogress/tafwriter.h b/src/inprogress/tafwriter.h new file mode 100644 index 0000000..7057d62 --- /dev/null +++ b/src/inprogress/tafwriter.h @@ -0,0 +1,22 @@ +#ifndef BU_TAF_WRITER_H +#define BU_TAF_WRITER_H + +#include + +namespace Bu +{ + /** + * + */ + class TafWriter + { + public: + TafWriter(); + virtual ~TafWriter(); + + private: + + }; +} + +#endif diff --git a/src/inprogress/xmldocument.cpp b/src/inprogress/xmldocument.cpp new file mode 100644 index 0000000..cb21826 --- /dev/null +++ b/src/inprogress/xmldocument.cpp @@ -0,0 +1,9 @@ +#include "xmldocument.h" + +Bu::XmlDocument::XmlDocument() +{ +} + +Bu::XmlDocument::~XmlDocument() +{ +} diff --git a/src/inprogress/xmldocument.h b/src/inprogress/xmldocument.h new file mode 100644 index 0000000..e16e3ea --- /dev/null +++ b/src/inprogress/xmldocument.h @@ -0,0 +1,22 @@ +#ifndef XML_DOCUMENT_H +#define XML_DOCUMENT_H + +#include + +namespace Bu +{ + /** + * + */ + class XmlDocument + { + public: + XmlDocument(); + virtual ~XmlDocument(); + + private: + + }; +} + +#endif diff --git a/src/inprogress/xmlnode.cpp b/src/inprogress/xmlnode.cpp new file mode 100644 index 0000000..58ef5c5 --- /dev/null +++ b/src/inprogress/xmlnode.cpp @@ -0,0 +1,9 @@ +#include "xmlnode.h" + +Bu::XmlNode::XmlNode() +{ +} + +Bu::XmlNode::~XmlNode() +{ +} diff --git a/src/inprogress/xmlnode.h b/src/inprogress/xmlnode.h new file mode 100644 index 0000000..cd9961a --- /dev/null +++ b/src/inprogress/xmlnode.h @@ -0,0 +1,22 @@ +#ifndef XML_NODE_H +#define XML_NODE_H + +#include + +namespace Bu +{ + /** + * + */ + class XmlNode + { + public: + XmlNode(); + virtual ~XmlNode(); + + private: + + }; +} + +#endif diff --git a/src/inprogress/xmlreader.cpp b/src/inprogress/xmlreader.cpp new file mode 100644 index 0000000..bd241cf --- /dev/null +++ b/src/inprogress/xmlreader.cpp @@ -0,0 +1,267 @@ +#include "xmlreader.h" + +Bu::XmlReader::XmlReader( Bu::Stream &sIn ) : + sIn( sIn ) +{ +} + +Bu::XmlReader::~XmlReader() +{ +} + +const char *Bu::XmlReader::lookahead( int nAmnt ) +{ + if( sBuf.getSize() >= nAmnt ) + return sBuf.getStr(); + + int nNew = nAmnt - sBuf.getSize(); + char *buf = new char[nNew]; + sIn.read( buf, nNew ); + sBuf.append( buf ); + + return sBuf.getStr(); +} + +void Bu::XmlReader::burn( int nAmnt ) +{ + if( sBuf.getSize() < nAmnt ) + { + lookahead( nAmnt ); + } + + //sBuf.remove( nAmnt ); +} + +void Bu::XmlReader::checkString( const char *str, int nLen ) +{ + if( !strncmp( str, lookahead( nLen ), nLen ) ) + { + burn( nLen ); + return; + } + + throw Bu::ExceptionBase("Expected string '%s'", str ); +} + +Bu::XmlNode *Bu::XmlReader::read() +{ + prolog(); +} + +void Bu::XmlReader::prolog() +{ + XMLDecl(); + Misc(); +} + +void Bu::XmlReader::XMLDecl() +{ + checkString("", 2 ); +} + +void Bu::XmlReader::Misc() +{ + for(;;) + { + S(); + if( !strncmp("", 3 ); + return; + } + } + burn( 1 ); + } +} + +void Bu::XmlReader::PI() +{ + checkString("", lookahead(j+2)+j, 2 ) ) + { + burn( j+2 ); + return; + } + } +} + +void Bu::XmlReader::S() +{ + for( int j = 0;; j++ ) + { + char c = *lookahead( 1 ); + if( c == 0x20 || c == 0x9 || c == 0xD || c == 0xA ) + continue; + if( j == 0 ) + throw ExceptionBase("Expected whitespace."); + return; + } +} + +void Bu::XmlReader::Sq() +{ + for(;;) + { + char c = *lookahead( 1 ); + if( c == 0x20 || c == 0x9 || c == 0xD || c == 0xA ) + continue; + return; + } +} + +void Bu::XmlReader::VersionInfo() +{ + try + { + S(); + checkString("version", 7 ); + } + catch( ExceptionBase &e ) + { + return; + } + Eq(); + Bu::FString ver = AttValue(); + if( ver != "1.1" ) + throw ExceptionBase("Currently we only support xml version 1.1\n"); +} + +void Bu::XmlReader::Eq() +{ + Sq(); + checkString("=", 1 ); + Sq(); +} + +void Bu::XmlReader::EncodingDecl() +{ + S(); + try + { + checkString("encoding", 8 ); + } + catch( ExceptionBase &e ) + { + return; + } + + Eq(); + AttValue(); +} + +void Bu::XmlReader::SDDecl() +{ + S(); + try + { + checkString("standalone", 10 ); + } + catch( ExceptionBase &e ) + { + return; + } + + Eq(); + AttValue(); +} + +Bu::FString Bu::XmlReader::AttValue() +{ + char q = *lookahead(1); + if( q == '\"' ) + { + for( int j = 2;; j++ ) + { + if( lookahead(j)[j-1] == '\"' ) + { + Bu::FString ret( lookahead(j)+1, j-2 ); + burn( j ); + return ret; + } + } + } + else if( q == '\'' ) + { + for( int j = 2;; j++ ) + { + if( lookahead(j)[j-1] == '\'' ) + { + Bu::FString ret( lookahead(j)+1, j-2 ); + burn( j ); + return ret; + } + } + } + + throw ExceptionBase("Excpected either \' or \".\n"); +} + +Bu::FString Bu::XmlReader::Name() +{ + unsigned char c = *lookahead( 1 ); + if( c != ':' && c != '_' && + (c < 'A' || c > 'Z') && + (c < 'a' || c > 'z') && + (c < 0xC0 || c > 0xD6 ) && + (c < 0xD8 || c > 0xF6 ) && + (c < 0xF8)) + { + throw ExceptionBase("Invalid entity name starting character."); + } + + for( int j = 1;; j++ ) + { + unsigned char c = lookahead(j+1)[j]; + if( isS( c ) ) + { + FString ret( lookahead(j+1), j+1 ); + burn( j+1 ); + return ret; + } + if( c != ':' && c != '_' && c != '-' && c != '.' && c != 0xB7 && + (c < 'A' || c > 'Z') && + (c < 'a' || c > 'z') && + (c < '0' || c > '9') && + (c < 0xC0 || c > 0xD6 ) && + (c < 0xD8 || c > 0xF6 ) && + (c < 0xF8)) + { + throw ExceptionBase("Invalid character in name."); + } + } +} + diff --git a/src/inprogress/xmlreader.h b/src/inprogress/xmlreader.h new file mode 100644 index 0000000..708a386 --- /dev/null +++ b/src/inprogress/xmlreader.h @@ -0,0 +1,121 @@ +#ifndef XML_READER_H +#define XML_READER_H + +#include +#include "bu/stream.h" +#include "bu/fstring.h" +#include "bu/xmlnode.h" + +namespace Bu +{ + /** + * An Xml 1.1 reader. I've decided to write this, this time, based on the + * official W3C reccomendation, now included with the source code. I've + * named the productions in the parser states the same as in that document, + * which may make them easier to find, etc, although possibly slightly less + * optimized than writing my own reduced grammer. + * + * Below I will list differences between my parser and the official standard + * as I come up with them. + * - Encoding and Standalone headings are ignored for the moment. (4.3.3, + * 2.9) + * - The standalone heading attribute can have any standard whitespace + * before it (the specs say only spaces, no newlines). (2.9) + * - Since standalone is ignored, it is currently allowed to have any + * value (should be restricted to "yes" or "no"). (2.9) + * - Currently only UTF-8 / ascii are parsed. + * - [optional] The content of comments is thrown away. (2.5) + * - The content of processing instruction blocks is parsed properly, but + * thrown away. (2.6) + */ + class XmlReader + { + public: + XmlReader( Bu::Stream &sIn ); + virtual ~XmlReader(); + + XmlNode *read(); + + private: + Bu::Stream &sIn; + Bu::FString sBuf; + + private: // Helpers + const char *lookahead( int nAmnt ); + void burn( int nAmnt ); + void checkString( const char *str, int nLen ); + + private: // States + /** + * The headers, etc. + */ + void prolog(); + + /** + * The xml decleration (version, encoding, etc). + */ + void XMLDecl(); + + /** + * Misc things, Includes Comments and PIData (Processing Instructions). + */ + void Misc(); + + /** + * Comments + */ + void Comment(); + + /** + * Processing Instructions + */ + void PI(); + + /** + * Whitespace eater. + */ + void S(); + + /** + * Optional whitespace eater. + */ + void Sq(); + + /** + * XML Version spec + */ + void VersionInfo(); + + /** + * Your basic equals sign with surrounding whitespace. + */ + void Eq(); + + /** + * Read in an attribute value. + */ + FString AttValue(); + + /** + * Read in the name of something. + */ + FString Name(); + + /** + * Encoding decleration in the header + */ + void EncodingDecl(); + + /** + * Standalone decleration in the header + */ + void SDDecl(); + + bool isS( unsigned char c ) + { + return ( c == 0x20 || c == 0x9 || c == 0xD || c == 0xA ); + } + }; +} + +#endif diff --git a/src/inprogress/xmlwriter.cpp b/src/inprogress/xmlwriter.cpp new file mode 100644 index 0000000..23a5175 --- /dev/null +++ b/src/inprogress/xmlwriter.cpp @@ -0,0 +1,9 @@ +#include "xmlwriter.h" + +Bu::XmlWriter::XmlWriter() +{ +} + +Bu::XmlWriter::~XmlWriter() +{ +} diff --git a/src/inprogress/xmlwriter.h b/src/inprogress/xmlwriter.h new file mode 100644 index 0000000..796d6fb --- /dev/null +++ b/src/inprogress/xmlwriter.h @@ -0,0 +1,22 @@ +#ifndef XML_WRITER_H +#define XML_WRITER_H + +#include + +namespace Bu +{ + /** + * + */ + class XmlWriter + { + public: + XmlWriter(); + virtual ~XmlWriter(); + + private: + + }; +} + +#endif -- cgit v1.2.3 From b342b70ec5ecb11f84742c76db6f2e19a4b60f90 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Wed, 6 Jun 2007 16:11:07 +0000 Subject: About to move taf back into core...contemplating removing the xml system entirely for a while...we'll see what happens. --- src/inprogress/tafreader.cpp | 5 +++++ src/inprogress/tafreader.h | 2 ++ 2 files changed, 7 insertions(+) (limited to 'src/inprogress') diff --git a/src/inprogress/tafreader.cpp b/src/inprogress/tafreader.cpp index f94fe44..4d10b8d 100644 --- a/src/inprogress/tafreader.cpp +++ b/src/inprogress/tafreader.cpp @@ -9,3 +9,8 @@ Bu::TafReader::~TafReader() { } +void Bu::TafReader::next() +{ + sIn.read( &c, 1 ); +} + diff --git a/src/inprogress/tafreader.h b/src/inprogress/tafreader.h index 2dbb9ea..b552f5d 100644 --- a/src/inprogress/tafreader.h +++ b/src/inprogress/tafreader.h @@ -17,6 +17,8 @@ namespace Bu virtual ~TafReader(); private: + void next(); + char c; Stream &sIn; }; -- cgit v1.2.3 From cdca5e17e1ecb9f212353dce55c5df2930e34e9d Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Wed, 6 Jun 2007 16:12:02 +0000 Subject: Moved Taf back into core. --- src/inprogress/tafdocument.cpp | 9 --------- src/inprogress/tafdocument.h | 22 ---------------------- src/inprogress/tafnode.cpp | 9 --------- src/inprogress/tafnode.h | 21 --------------------- src/inprogress/tafreader.cpp | 16 ---------------- src/inprogress/tafreader.h | 27 --------------------------- src/inprogress/tafwriter.cpp | 9 --------- src/inprogress/tafwriter.h | 22 ---------------------- src/tafdocument.cpp | 9 +++++++++ src/tafdocument.h | 22 ++++++++++++++++++++++ src/tafnode.cpp | 9 +++++++++ src/tafnode.h | 21 +++++++++++++++++++++ src/tafreader.cpp | 16 ++++++++++++++++ src/tafreader.h | 27 +++++++++++++++++++++++++++ src/tafwriter.cpp | 9 +++++++++ src/tafwriter.h | 22 ++++++++++++++++++++++ 16 files changed, 135 insertions(+), 135 deletions(-) delete mode 100644 src/inprogress/tafdocument.cpp delete mode 100644 src/inprogress/tafdocument.h delete mode 100644 src/inprogress/tafnode.cpp delete mode 100644 src/inprogress/tafnode.h delete mode 100644 src/inprogress/tafreader.cpp delete mode 100644 src/inprogress/tafreader.h delete mode 100644 src/inprogress/tafwriter.cpp delete mode 100644 src/inprogress/tafwriter.h create mode 100644 src/tafdocument.cpp create mode 100644 src/tafdocument.h create mode 100644 src/tafnode.cpp create mode 100644 src/tafnode.h create mode 100644 src/tafreader.cpp create mode 100644 src/tafreader.h create mode 100644 src/tafwriter.cpp create mode 100644 src/tafwriter.h (limited to 'src/inprogress') diff --git a/src/inprogress/tafdocument.cpp b/src/inprogress/tafdocument.cpp deleted file mode 100644 index bd44dd5..0000000 --- a/src/inprogress/tafdocument.cpp +++ /dev/null @@ -1,9 +0,0 @@ -#include "tafdocument.h" - -Bu::TafDocument::TafDocument() -{ -} - -Bu::TafDocument::~TafDocument() -{ -} diff --git a/src/inprogress/tafdocument.h b/src/inprogress/tafdocument.h deleted file mode 100644 index 171f829..0000000 --- a/src/inprogress/tafdocument.h +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef BU_TAF_DOCUMENT_H -#define BU_TAF_DOCUMENT_H - -#include - -namespace Bu -{ - /** - * - */ - class TafDocument - { - public: - TafDocument(); - virtual ~TafDocument(); - - private: - - }; -} - -#endif diff --git a/src/inprogress/tafnode.cpp b/src/inprogress/tafnode.cpp deleted file mode 100644 index c9756ec..0000000 --- a/src/inprogress/tafnode.cpp +++ /dev/null @@ -1,9 +0,0 @@ -#include "tafnode.h" - -Bu::TafNode::TafNode() -{ -} - -Bu::TafNode::~TafNode() -{ -} diff --git a/src/inprogress/tafnode.h b/src/inprogress/tafnode.h deleted file mode 100644 index 34f5289..0000000 --- a/src/inprogress/tafnode.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef BU_TAF_NODE_H -#define BU_TAF_NODE_H - -#include - -namespace Bu -{ - /** - * - */ - class TafNode - { - public: - TafNode(); - virtual ~TafNode(); - - private: - - }; -} -#endif diff --git a/src/inprogress/tafreader.cpp b/src/inprogress/tafreader.cpp deleted file mode 100644 index 4d10b8d..0000000 --- a/src/inprogress/tafreader.cpp +++ /dev/null @@ -1,16 +0,0 @@ -#include "tafreader.h" - -Bu::TafReader::TafReader( Bu::Stream &sIn ) : - sIn( sIn ) -{ -} - -Bu::TafReader::~TafReader() -{ -} - -void Bu::TafReader::next() -{ - sIn.read( &c, 1 ); -} - diff --git a/src/inprogress/tafreader.h b/src/inprogress/tafreader.h deleted file mode 100644 index b552f5d..0000000 --- a/src/inprogress/tafreader.h +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef BU_TAF_READER_H -#define BU_TAF_READER_H - -#include -#include "bu/tafdocument.h" -#include "bu/stream.h" - -namespace Bu -{ - /** - * - */ - class TafReader : public Bu::TafDocument - { - public: - TafReader( Bu::Stream &sIn ); - virtual ~TafReader(); - - private: - void next(); - char c; - Stream &sIn; - - }; -} - -#endif diff --git a/src/inprogress/tafwriter.cpp b/src/inprogress/tafwriter.cpp deleted file mode 100644 index 3e6c025..0000000 --- a/src/inprogress/tafwriter.cpp +++ /dev/null @@ -1,9 +0,0 @@ -#include "tafwriter.h" - -Bu::TafWriter::TafWriter() -{ -} - -Bu::TafWriter::~TafWriter() -{ -} diff --git a/src/inprogress/tafwriter.h b/src/inprogress/tafwriter.h deleted file mode 100644 index 7057d62..0000000 --- a/src/inprogress/tafwriter.h +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef BU_TAF_WRITER_H -#define BU_TAF_WRITER_H - -#include - -namespace Bu -{ - /** - * - */ - class TafWriter - { - public: - TafWriter(); - virtual ~TafWriter(); - - private: - - }; -} - -#endif diff --git a/src/tafdocument.cpp b/src/tafdocument.cpp new file mode 100644 index 0000000..bd44dd5 --- /dev/null +++ b/src/tafdocument.cpp @@ -0,0 +1,9 @@ +#include "tafdocument.h" + +Bu::TafDocument::TafDocument() +{ +} + +Bu::TafDocument::~TafDocument() +{ +} diff --git a/src/tafdocument.h b/src/tafdocument.h new file mode 100644 index 0000000..171f829 --- /dev/null +++ b/src/tafdocument.h @@ -0,0 +1,22 @@ +#ifndef BU_TAF_DOCUMENT_H +#define BU_TAF_DOCUMENT_H + +#include + +namespace Bu +{ + /** + * + */ + class TafDocument + { + public: + TafDocument(); + virtual ~TafDocument(); + + private: + + }; +} + +#endif diff --git a/src/tafnode.cpp b/src/tafnode.cpp new file mode 100644 index 0000000..c9756ec --- /dev/null +++ b/src/tafnode.cpp @@ -0,0 +1,9 @@ +#include "tafnode.h" + +Bu::TafNode::TafNode() +{ +} + +Bu::TafNode::~TafNode() +{ +} diff --git a/src/tafnode.h b/src/tafnode.h new file mode 100644 index 0000000..34f5289 --- /dev/null +++ b/src/tafnode.h @@ -0,0 +1,21 @@ +#ifndef BU_TAF_NODE_H +#define BU_TAF_NODE_H + +#include + +namespace Bu +{ + /** + * + */ + class TafNode + { + public: + TafNode(); + virtual ~TafNode(); + + private: + + }; +} +#endif diff --git a/src/tafreader.cpp b/src/tafreader.cpp new file mode 100644 index 0000000..4d10b8d --- /dev/null +++ b/src/tafreader.cpp @@ -0,0 +1,16 @@ +#include "tafreader.h" + +Bu::TafReader::TafReader( Bu::Stream &sIn ) : + sIn( sIn ) +{ +} + +Bu::TafReader::~TafReader() +{ +} + +void Bu::TafReader::next() +{ + sIn.read( &c, 1 ); +} + diff --git a/src/tafreader.h b/src/tafreader.h new file mode 100644 index 0000000..b552f5d --- /dev/null +++ b/src/tafreader.h @@ -0,0 +1,27 @@ +#ifndef BU_TAF_READER_H +#define BU_TAF_READER_H + +#include +#include "bu/tafdocument.h" +#include "bu/stream.h" + +namespace Bu +{ + /** + * + */ + class TafReader : public Bu::TafDocument + { + public: + TafReader( Bu::Stream &sIn ); + virtual ~TafReader(); + + private: + void next(); + char c; + Stream &sIn; + + }; +} + +#endif diff --git a/src/tafwriter.cpp b/src/tafwriter.cpp new file mode 100644 index 0000000..3e6c025 --- /dev/null +++ b/src/tafwriter.cpp @@ -0,0 +1,9 @@ +#include "tafwriter.h" + +Bu::TafWriter::TafWriter() +{ +} + +Bu::TafWriter::~TafWriter() +{ +} diff --git a/src/tafwriter.h b/src/tafwriter.h new file mode 100644 index 0000000..7057d62 --- /dev/null +++ b/src/tafwriter.h @@ -0,0 +1,22 @@ +#ifndef BU_TAF_WRITER_H +#define BU_TAF_WRITER_H + +#include + +namespace Bu +{ + /** + * + */ + class TafWriter + { + public: + TafWriter(); + virtual ~TafWriter(); + + private: + + }; +} + +#endif -- cgit v1.2.3