From cfd4f77988cf12106e22e52fba6c1b5672a06162 Mon Sep 17 00:00:00 2001 From: manuel Date: Wed, 29 Apr 2009 16:15:00 +0200 Subject: adding filename param to write(...) --- ue2/imgsynth2/cbitmap.h | 2 +- ue2/imgsynth2/cfile.h | 5 +++-- ue2/imgsynth2/cscriptparser.cpp | 2 +- ue2/imgsynth2/cwindowsbitmap.cpp | 2 +- ue2/imgsynth2/cwindowsbitmap.h | 5 +++-- 5 files changed, 9 insertions(+), 7 deletions(-) (limited to 'ue2/imgsynth2') diff --git a/ue2/imgsynth2/cbitmap.h b/ue2/imgsynth2/cbitmap.h index c8a7f0d..f8f8850 100644 --- a/ue2/imgsynth2/cbitmap.h +++ b/ue2/imgsynth2/cbitmap.h @@ -60,7 +60,7 @@ class CBitmap : public CFile /** * TODO */ - virtual void write(std::ofstream& out) = 0; + virtual void write(std::ofstream& out, std::string& filename) = 0; /** * @method getPixelData diff --git a/ue2/imgsynth2/cfile.h b/ue2/imgsynth2/cfile.h index a5c4d2a..9513a2c 100644 --- a/ue2/imgsynth2/cfile.h +++ b/ue2/imgsynth2/cfile.h @@ -75,13 +75,14 @@ class CFile /** * @method write * @brief Pure virtual method (interface). Should write data to filestream. - * @param out filestream to write data to + * @param out filestream to write data to + * @param filename filename (maybe useful for some handlers) * @return - * @globalvars none * @exception FileError * @conditions none */ - virtual void write(std::ofstream& out) = 0; + virtual void write(std::ofstream& out, std::string& filename) = 0; /** * @method callFunc diff --git a/ue2/imgsynth2/cscriptparser.cpp b/ue2/imgsynth2/cscriptparser.cpp index ea9b242..46a7c42 100644 --- a/ue2/imgsynth2/cscriptparser.cpp +++ b/ue2/imgsynth2/cscriptparser.cpp @@ -192,7 +192,7 @@ void CScriptparser::write(std::list funcparams) /* let handlers write() parse the file */ try { - m_handler->write(file); + m_handler->write(file, filename); if (!file.good()) throw ParserError("Error while writing image file.", m_curline); file.close(); diff --git a/ue2/imgsynth2/cwindowsbitmap.cpp b/ue2/imgsynth2/cwindowsbitmap.cpp index ebbdd4c..ca927dd 100644 --- a/ue2/imgsynth2/cwindowsbitmap.cpp +++ b/ue2/imgsynth2/cwindowsbitmap.cpp @@ -78,7 +78,7 @@ void CWindowsBitmap::read(std::ifstream& in) /*----------------------------------------------------------------------------*/ -void CWindowsBitmap::write(std::ofstream& out) +void CWindowsBitmap::write(std::ofstream& out, std::string& filename) { /* set header values */ m_fileheader.bfSize = m_infoheader.biSizeImage + sizeof(m_infoheader) + sizeof(m_fileheader); diff --git a/ue2/imgsynth2/cwindowsbitmap.h b/ue2/imgsynth2/cwindowsbitmap.h index 3367952..28ad010 100644 --- a/ue2/imgsynth2/cwindowsbitmap.h +++ b/ue2/imgsynth2/cwindowsbitmap.h @@ -59,14 +59,15 @@ class CWindowsBitmap : public CBitmap /** * @method write * @brief Writes Windows Bitmap to filestream. - * @param out filestream to read data from + * @param out filestream to read data from + * @param filename filename (maybe useful for some handlers) * @return - * @globalvars none * @exception FileError * @exception bad_alloc * @conditions none */ - void write(std::ofstream& out); + void write(std::ofstream& out, std::string& filename); #ifdef DEBUG /** -- cgit v1.2.3