From c36e6575c84a11c223d165aff227885f2e92d8e1 Mon Sep 17 00:00:00 2001 From: Matthew Wilber Date: Mon, 1 Mar 2004 04:23:26 +0000 Subject: [PATCH] moved translate_direct_copy function from PNGTranslator to BaseTranslator git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6841 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../translators/pngtranslator/PNGTranslator.cpp | 12 ------------ src/add-ons/translators/shared/BaseTranslator.cpp | 11 +++++++++++ src/add-ons/translators/shared/BaseTranslator.h | 2 ++ 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/add-ons/translators/pngtranslator/PNGTranslator.cpp b/src/add-ons/translators/pngtranslator/PNGTranslator.cpp index 30a0b485b6..32834db993 100644 --- a/src/add-ons/translators/pngtranslator/PNGTranslator.cpp +++ b/src/add-ons/translators/pngtranslator/PNGTranslator.cpp @@ -278,18 +278,6 @@ PNGTranslator::DerivedIdentify(BPositionIO *inSource, return identify_png_header(inSource, outInfo); } -void -translate_direct_copy(BPositionIO *inSource, BPositionIO *outDestination) -{ - const size_t kbufsize = 2048; - uint8 buffer[kbufsize]; - ssize_t ret = inSource->Read(buffer, kbufsize); - while (ret > 0) { - outDestination->Write(buffer, ret); - ret = inSource->Read(buffer, kbufsize); - } -} - status_t PNGTranslator::translate_from_png_to_bits(BPositionIO *inSource, BPositionIO *outDestination) diff --git a/src/add-ons/translators/shared/BaseTranslator.cpp b/src/add-ons/translators/shared/BaseTranslator.cpp index 476a0807dd..74cb10c7b2 100644 --- a/src/add-ons/translators/shared/BaseTranslator.cpp +++ b/src/add-ons/translators/shared/BaseTranslator.cpp @@ -685,3 +685,14 @@ BaseTranslator::NewConfigView(TranslatorSettings *settings) return NULL; } +void +translate_direct_copy(BPositionIO *inSource, BPositionIO *outDestination) +{ + const size_t kbufsize = 2048; + uint8 buffer[kbufsize]; + ssize_t ret = inSource->Read(buffer, kbufsize); + while (ret > 0) { + outDestination->Write(buffer, ret); + ret = inSource->Read(buffer, kbufsize); + } +} diff --git a/src/add-ons/translators/shared/BaseTranslator.h b/src/add-ons/translators/shared/BaseTranslator.h index 447229ecd7..7897757b9c 100644 --- a/src/add-ons/translators/shared/BaseTranslator.h +++ b/src/add-ons/translators/shared/BaseTranslator.h @@ -150,5 +150,7 @@ private: uint32 fTranType; }; +void translate_direct_copy(BPositionIO *inSource, BPositionIO *outDestination); + #endif // #ifndef BASE_TRANSLATOR_H