From 51f9aa16cbdd78c0b31483df26d0f7e81376f974 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Wed, 23 Jan 2008 16:44:10 +0000 Subject: Added a new helper to the Stream classes, a write function that takes a single Bu::FString reference as a parameter. Unfortunately you need to remember to add "using Stream::write;" to each child class so they can take advantage of it. Strange, no? Also, cleaned up a bunch of header files, I'm trying to move towards headers only including other headers that they absolutely need, otherwise just creating forward decleration sections at the top of each. --- src/archive.cpp | 2 ++ src/archive.h | 5 +++-- src/fstring.h | 2 ++ src/membuf.h | 1 + src/minimacro.cpp | 10 ++++++++++ src/minimacro.h | 2 ++ src/socket.h | 1 + src/stdstream.h | 1 + src/stream.cpp | 7 ++++++- src/stream.h | 4 ++++ src/tafwriter.cpp | 4 +++- src/tafwriter.h | 9 +++++++-- 12 files changed, 42 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/archive.cpp b/src/archive.cpp index 78fa362..d11f853 100644 --- a/src/archive.cpp +++ b/src/archive.cpp @@ -6,6 +6,8 @@ */ #include "bu/archive.h" +#include "bu/stream.h" +#include "bu/archival.h" Bu::Archive::Archive( Stream &rStream, bool bLoading ) : bLoading( bLoading ), diff --git a/src/archive.h b/src/archive.h index 2d95285..fbd971e 100644 --- a/src/archive.h +++ b/src/archive.h @@ -10,8 +10,6 @@ #include #include -#include "bu/archival.h" -#include "bu/stream.h" #include #include "bu/hash.h" #include "bu/list.h" @@ -19,6 +17,9 @@ namespace Bu { + class Archival; + class Stream; + /** * Provides a framework for serialization of objects and primitives. The * archive will handle any basic primitive, a few special types, like char * diff --git a/src/fstring.h b/src/fstring.h index fd75892..49ec77e 100644 --- a/src/fstring.h +++ b/src/fstring.h @@ -16,7 +16,9 @@ #include "bu/archive.h" #include "bu/hash.h" +#ifndef min #define min( a, b ) ((a #include +#include "bu/fstring.h" + namespace Bu { /** @@ -50,6 +52,8 @@ namespace Bu */ virtual size_t write( const void *pBuf, size_t nBytes ) = 0; + virtual size_t write( const Bu::FString &sBuf ); + /** * Get the current position in the stream. *@returns (long) The current position in the stream. diff --git a/src/tafwriter.cpp b/src/tafwriter.cpp index 3a33b11..9abaea4 100644 --- a/src/tafwriter.cpp +++ b/src/tafwriter.cpp @@ -5,7 +5,9 @@ * terms of the license contained in the file LICENSE. */ -#include "tafwriter.h" +#include "bu/tafwriter.h" +#include "bu/tafnode.h" +#include "bu/stream.h" Bu::TafWriter::TafWriter( Bu::Stream &sOut ) : sOut( sOut ), diff --git a/src/tafwriter.h b/src/tafwriter.h index 08c1832..ca0de37 100644 --- a/src/tafwriter.h +++ b/src/tafwriter.h @@ -9,12 +9,17 @@ #define BU_TAF_WRITER_H #include -#include "bu/tafnode.h" -#include "bu/stream.h" + #include "bu/fstring.h" namespace Bu { + class Stream; + class TafNode; + class TafGroup; + class TafProperty; + class TafComment; + /** * *@ingroup Taf -- cgit v1.2.3