COMMON: Remove superfluous Common:: qualifiers.

This commit is contained in:
Christoph Mallon 2011-08-06 09:47:19 +02:00
parent b3997f0562
commit 84220d2ca0
32 changed files with 131 additions and 132 deletions

View file

@ -28,12 +28,12 @@ EventDispatcher::EventDispatcher() : _mapper(0) {
} }
EventDispatcher::~EventDispatcher() { EventDispatcher::~EventDispatcher() {
for (Common::List<SourceEntry>::iterator i = _sources.begin(); i != _sources.end(); ++i) { for (List<SourceEntry>::iterator i = _sources.begin(); i != _sources.end(); ++i) {
if (i->autoFree) if (i->autoFree)
delete i->source; delete i->source;
} }
for (Common::List<ObserverEntry>::iterator i = _observers.begin(); i != _observers.end(); ++i) { for (List<ObserverEntry>::iterator i = _observers.begin(); i != _observers.end(); ++i) {
if (i->autoFree) if (i->autoFree)
delete i->observer; delete i->observer;
} }
@ -43,9 +43,9 @@ EventDispatcher::~EventDispatcher() {
} }
void EventDispatcher::dispatch() { void EventDispatcher::dispatch() {
Common::Event event; Event event;
for (Common::List<SourceEntry>::iterator i = _sources.begin(); i != _sources.end(); ++i) { for (List<SourceEntry>::iterator i = _sources.begin(); i != _sources.end(); ++i) {
const bool allowMapping = i->source->allowMapping(); const bool allowMapping = i->source->allowMapping();
while (i->source->pollEvent(event)) { while (i->source->pollEvent(event)) {
@ -83,7 +83,7 @@ void EventDispatcher::registerSource(EventSource *source, bool autoFree) {
} }
void EventDispatcher::unregisterSource(EventSource *source) { void EventDispatcher::unregisterSource(EventSource *source) {
for (Common::List<SourceEntry>::iterator i = _sources.begin(); i != _sources.end(); ++i) { for (List<SourceEntry>::iterator i = _sources.begin(); i != _sources.end(); ++i) {
if (i->source == source) { if (i->source == source) {
if (i->autoFree) if (i->autoFree)
delete source; delete source;
@ -101,7 +101,7 @@ void EventDispatcher::registerObserver(EventObserver *obs, uint priority, bool a
newEntry.priority = priority; newEntry.priority = priority;
newEntry.autoFree = autoFree; newEntry.autoFree = autoFree;
for (Common::List<ObserverEntry>::iterator i = _observers.begin(); i != _observers.end(); ++i) { for (List<ObserverEntry>::iterator i = _observers.begin(); i != _observers.end(); ++i) {
if (i->priority < priority) { if (i->priority < priority) {
_observers.insert(i, newEntry); _observers.insert(i, newEntry);
return; return;
@ -112,7 +112,7 @@ void EventDispatcher::registerObserver(EventObserver *obs, uint priority, bool a
} }
void EventDispatcher::unregisterObserver(EventObserver *obs) { void EventDispatcher::unregisterObserver(EventObserver *obs) {
for (Common::List<ObserverEntry>::iterator i = _observers.begin(); i != _observers.end(); ++i) { for (List<ObserverEntry>::iterator i = _observers.begin(); i != _observers.end(); ++i) {
if (i->observer == obs) { if (i->observer == obs) {
if (i->autoFree) if (i->autoFree)
delete obs; delete obs;
@ -124,7 +124,7 @@ void EventDispatcher::unregisterObserver(EventObserver *obs) {
} }
void EventDispatcher::dispatchEvent(const Event &event) { void EventDispatcher::dispatchEvent(const Event &event) {
for (Common::List<ObserverEntry>::iterator i = _observers.begin(); i != _observers.end(); ++i) { for (List<ObserverEntry>::iterator i = _observers.begin(); i != _observers.end(); ++i) {
if (i->observer->notifyEvent(event)) if (i->observer->notifyEvent(event))
break; break;
} }

View file

@ -226,12 +226,12 @@ void sort(T first, T last, StrictWeakOrdering comp) {
*/ */
template<typename T> template<typename T>
void sort(T *first, T *last) { void sort(T *first, T *last) {
sort(first, last, Common::Less<T>()); sort(first, last, Less<T>());
} }
template<class T> template<class T>
void sort(T first, T last) { void sort(T first, T last) {
sort(first, last, Common::Less<typename T::ValueType>()); sort(first, last, Less<typename T::ValueType>());
} }
// MSVC is complaining about the minus operator being applied to an unsigned type // MSVC is complaining about the minus operator being applied to an unsigned type

View file

@ -147,7 +147,7 @@ void SearchSet::addSubDirectoriesMatching(const FSNode &directory, String origPa
for (FSList::const_iterator i = subDirs.begin(); i != subDirs.end(); ++i) { for (FSList::const_iterator i = subDirs.begin(); i != subDirs.end(); ++i) {
String name = i->getName(); String name = i->getName();
if (Common::matchString(name.c_str(), pattern.c_str(), ignoreCase)) { if (matchString(name.c_str(), pattern.c_str(), ignoreCase)) {
matchIter = multipleMatches.find(name); matchIter = multipleMatches.find(name);
if (matchIter == multipleMatches.end()) { if (matchIter == multipleMatches.end()) {
multipleMatches[name] = true; multipleMatches[name] = true;

View file

@ -254,7 +254,7 @@ public:
virtual void clear(); virtual void clear();
private: private:
friend class Common::Singleton<SingletonBaseType>; friend class Singleton<SingletonBaseType>;
SearchManager(); SearchManager();
}; };

View file

@ -42,7 +42,7 @@ namespace Common {
* management scheme. There, only elements that 'live' are actually constructed * management scheme. There, only elements that 'live' are actually constructed
* (i.e., have their constructor called), and objects that are removed are * (i.e., have their constructor called), and objects that are removed are
* immediately destructed (have their destructor called). * immediately destructed (have their destructor called).
* With Common::Array, this is not the case; instead, it simply uses new[] and * With Array, this is not the case; instead, it simply uses new[] and
* delete[] to allocate whole blocks of objects, possibly more than are * delete[] to allocate whole blocks of objects, possibly more than are
* currently 'alive'. This simplifies memory management, but may have * currently 'alive'. This simplifies memory management, but may have
* undesirable side effects when one wants to use an Array of complex * undesirable side effects when one wants to use an Array of complex

View file

@ -36,7 +36,7 @@ namespace Common {
* underscores. In particular, white space and "#", "=", "[", "]" * underscores. In particular, white space and "#", "=", "[", "]"
* are not valid! * are not valid!
*/ */
bool ConfigFile::isValidName(const Common::String &name) { bool ConfigFile::isValidName(const String &name) {
const char *p = name.c_str(); const char *p = name.c_str();
while (*p && (isalnum(static_cast<unsigned char>(*p)) || *p == '-' || *p == '_' || *p == '.')) while (*p && (isalnum(static_cast<unsigned char>(*p)) || *p == '-' || *p == '_' || *p == '.'))
p++; p++;

View file

@ -93,7 +93,7 @@ public:
* underscores. In particular, white space and "#", "=", "[", "]" * underscores. In particular, white space and "#", "=", "[", "]"
* are not valid! * are not valid!
*/ */
static bool isValidName(const Common::String &name); static bool isValidName(const String &name);
/** Reset everything stored in this config file. */ /** Reset everything stored in this config file. */
void clear(); void clear();

View file

@ -112,7 +112,7 @@ void ConfigManager::loadConfigFile(const String &filename) {
* Add a ready-made domain based on its name and contents * Add a ready-made domain based on its name and contents
* The domain name should not already exist in the ConfigManager. * The domain name should not already exist in the ConfigManager.
**/ **/
void ConfigManager::addDomain(const Common::String &domainName, const ConfigManager::Domain &domain) { void ConfigManager::addDomain(const String &domainName, const ConfigManager::Domain &domain) {
if (domainName.empty()) if (domainName.empty())
return; return;
if (domainName == kApplicationDomain) { if (domainName == kApplicationDomain) {
@ -492,7 +492,7 @@ int ConfigManager::getInt(const String &key, const String &domName) const {
bool ConfigManager::getBool(const String &key, const String &domName) const { bool ConfigManager::getBool(const String &key, const String &domName) const {
String value(get(key, domName)); String value(get(key, domName));
bool val; bool val;
if (Common::parseBool(value, val)) if (parseBool(value, val))
return val; return val;
error("ConfigManager::getBool(%s,%s): '%s' is not a valid bool", error("ConfigManager::getBool(%s,%s): '%s' is not a valid bool",

View file

@ -153,7 +153,7 @@ private:
ConfigManager(); ConfigManager();
void loadFromStream(SeekableReadStream &stream); void loadFromStream(SeekableReadStream &stream);
void addDomain(const Common::String &domainName, const Domain &domain); void addDomain(const String &domainName, const Domain &domain);
void writeDomain(WriteStream &stream, const String &name, const Domain &domain); void writeDomain(WriteStream &stream, const String &name, const Domain &domain);
void renameDomain(const String &oldName, const String &newName, DomainMap &map); void renameDomain(const String &oldName, const String &newName, DomainMap &map);

View file

@ -30,7 +30,7 @@ namespace Common {
class DecompressorDCL { class DecompressorDCL {
public: public:
bool unpack(Common::ReadStream *src, byte *dest, uint32 nPacked, uint32 nUnpacked); bool unpack(ReadStream *src, byte *dest, uint32 nPacked, uint32 nUnpacked);
protected: protected:
/** /**
@ -41,7 +41,7 @@ protected:
* @param nUnpacket size of unpacked data * @param nUnpacket size of unpacked data
* @return 0 on success, non-zero on error * @return 0 on success, non-zero on error
*/ */
void init(Common::ReadStream *src, byte *dest, uint32 nPacked, uint32 nUnpacked); void init(ReadStream *src, byte *dest, uint32 nPacked, uint32 nUnpacked);
/** /**
* Get a number of bits from _src stream, starting with the least * Get a number of bits from _src stream, starting with the least
@ -73,12 +73,11 @@ protected:
uint32 _szUnpacked; ///< size of the decompressed data uint32 _szUnpacked; ///< size of the decompressed data
uint32 _dwRead; ///< number of bytes read from _src uint32 _dwRead; ///< number of bytes read from _src
uint32 _dwWrote; ///< number of bytes written to _dest uint32 _dwWrote; ///< number of bytes written to _dest
Common::ReadStream *_src; ReadStream *_src;
byte *_dest; byte *_dest;
}; };
void DecompressorDCL::init(Common::ReadStream *src, byte *dest, uint32 nPacked, void DecompressorDCL::init(ReadStream *src, byte *dest, uint32 nPacked, uint32 nUnpacked) {
uint32 nUnpacked) {
_src = src; _src = src;
_dest = dest; _dest = dest;
_szPacked = nPacked; _szPacked = nPacked;
@ -333,7 +332,7 @@ int DecompressorDCL::huffman_lookup(const int *tree) {
#define DCL_BINARY_MODE 0 #define DCL_BINARY_MODE 0
#define DCL_ASCII_MODE 1 #define DCL_ASCII_MODE 1
bool DecompressorDCL::unpack(Common::ReadStream *src, byte *dest, uint32 nPacked, uint32 nUnpacked) { bool DecompressorDCL::unpack(ReadStream *src, byte *dest, uint32 nPacked, uint32 nUnpacked) {
init(src, dest, nPacked, nUnpacked); init(src, dest, nPacked, nUnpacked);
int value; int value;

View file

@ -97,7 +97,7 @@ struct Event {
* Virtual screen coordinates means: the coordinate system of the * Virtual screen coordinates means: the coordinate system of the
* screen area as defined by the most recent call to initSize(). * screen area as defined by the most recent call to initSize().
*/ */
Common::Point mouse; Point mouse;
Event() : type(EVENT_INVALID), synthetic(false) {} Event() : type(EVENT_INVALID), synthetic(false) {}
}; };
@ -139,13 +139,13 @@ public:
*/ */
class ArtificialEventSource : public EventSource { class ArtificialEventSource : public EventSource {
protected: protected:
Common::Queue<Common::Event> _artificialEventQueue; Queue<Event> _artificialEventQueue;
public: public:
void addEvent(const Common::Event &ev) { void addEvent(const Event &ev) {
_artificialEventQueue.push(ev); _artificialEventQueue.push(ev);
} }
bool pollEvent(Common::Event &ev) { bool pollEvent(Event &ev) {
if (!_artificialEventQueue.empty()) { if (!_artificialEventQueue.empty()) {
ev = _artificialEventQueue.pop(); ev = _artificialEventQueue.pop();
return true; return true;
@ -275,14 +275,14 @@ private:
EventSource *source; EventSource *source;
}; };
Common::List<SourceEntry> _sources; List<SourceEntry> _sources;
struct ObserverEntry : public Entry { struct ObserverEntry : public Entry {
uint priority; uint priority;
EventObserver *observer; EventObserver *observer;
}; };
Common::List<ObserverEntry> _observers; List<ObserverEntry> _observers;
void dispatchEvent(const Event &event); void dispatchEvent(const Event &event);
}; };
@ -315,15 +315,15 @@ public:
* @param event point to an Event struct, which will be filled with the event data. * @param event point to an Event struct, which will be filled with the event data.
* @return true if an event was retrieved. * @return true if an event was retrieved.
*/ */
virtual bool pollEvent(Common::Event &event) = 0; virtual bool pollEvent(Event &event) = 0;
/** /**
* Pushes a "fake" event into the event queue * Pushes a "fake" event into the event queue
*/ */
virtual void pushEvent(const Common::Event &event) = 0; virtual void pushEvent(const Event &event) = 0;
/** Return the current mouse position */ /** Return the current mouse position */
virtual Common::Point getMousePos() const = 0; virtual Point getMousePos() const = 0;
/** /**
* Return a bitmask with the button states: * Return a bitmask with the button states:
@ -362,7 +362,7 @@ public:
// TODO: Consider removing OSystem::getScreenChangeID and // TODO: Consider removing OSystem::getScreenChangeID and
// replacing it by a generic getScreenChangeID method here // replacing it by a generic getScreenChangeID method here
#ifdef ENABLE_KEYMAPPER #ifdef ENABLE_KEYMAPPER
virtual Common::Keymapper *getKeymapper() = 0; virtual Keymapper *getKeymapper() = 0;
#endif #endif
enum { enum {

View file

@ -72,7 +72,7 @@ bool File::open(const FSNode &node) {
return open(stream, node.getPath()); return open(stream, node.getPath());
} }
bool File::open(SeekableReadStream *stream, const Common::String &name) { bool File::open(SeekableReadStream *stream, const String &name) {
assert(!_handle); assert(!_handle);
if (stream) { if (stream) {

View file

@ -97,7 +97,7 @@ public:
* @param name a string describing the 'file' corresponding to stream * @param name a string describing the 'file' corresponding to stream
* @return true if stream was non-zero, false otherwise * @return true if stream was non-zero, false otherwise
*/ */
virtual bool open(SeekableReadStream *stream, const Common::String &name); virtual bool open(SeekableReadStream *stream, const String &name);
/** /**
* Close the file, if open. * Close the file, if open.

View file

@ -33,7 +33,7 @@ FSNode::FSNode(AbstractFSNode *realNode)
: _realNode(realNode) { : _realNode(realNode) {
} }
FSNode::FSNode(const Common::String &p) { FSNode::FSNode(const String &p) {
assert(g_system); assert(g_system);
FilesystemFactory *factory = g_system->getFilesystemFactory(); FilesystemFactory *factory = g_system->getFilesystemFactory();
AbstractFSNode *tmp = 0; AbstractFSNode *tmp = 0;
@ -42,7 +42,7 @@ FSNode::FSNode(const Common::String &p) {
tmp = factory->makeCurrentDirectoryFileNode(); tmp = factory->makeCurrentDirectoryFileNode();
else else
tmp = factory->makeFileNodePath(p); tmp = factory->makeFileNodePath(p);
_realNode = Common::SharedPtr<AbstractFSNode>(tmp); _realNode = SharedPtr<AbstractFSNode>(tmp);
} }
bool FSNode::operator<(const FSNode& node) const { bool FSNode::operator<(const FSNode& node) const {
@ -59,7 +59,7 @@ bool FSNode::exists() const {
return _realNode && _realNode->exists(); return _realNode && _realNode->exists();
} }
FSNode FSNode::getChild(const Common::String &n) const { FSNode FSNode::getChild(const String &n) const {
// If this node is invalid or not a directory, return an invalid node // If this node is invalid or not a directory, return an invalid node
if (_realNode == 0 || !_realNode->isDirectory()) if (_realNode == 0 || !_realNode->isDirectory())
return FSNode(); return FSNode();
@ -85,12 +85,12 @@ bool FSNode::getChildren(FSList &fslist, ListMode mode, bool hidden) const {
return true; return true;
} }
Common::String FSNode::getDisplayName() const { String FSNode::getDisplayName() const {
assert(_realNode); assert(_realNode);
return _realNode->getDisplayName(); return _realNode->getDisplayName();
} }
Common::String FSNode::getName() const { String FSNode::getName() const {
assert(_realNode); assert(_realNode);
return _realNode->getName(); return _realNode->getName();
} }
@ -107,7 +107,7 @@ FSNode FSNode::getParent() const {
} }
} }
Common::String FSNode::getPath() const { String FSNode::getPath() const {
assert(_realNode); assert(_realNode);
return _realNode->getPath(); return _realNode->getPath();
} }
@ -124,7 +124,7 @@ bool FSNode::isWritable() const {
return _realNode && _realNode->isWritable(); return _realNode && _realNode->isWritable();
} }
Common::SeekableReadStream *FSNode::createReadStream() const { SeekableReadStream *FSNode::createReadStream() const {
if (_realNode == 0) if (_realNode == 0)
return 0; return 0;
@ -139,7 +139,7 @@ Common::SeekableReadStream *FSNode::createReadStream() const {
return _realNode->createReadStream(); return _realNode->createReadStream();
} }
Common::WriteStream *FSNode::createWriteStream() const { WriteStream *FSNode::createWriteStream() const {
if (_realNode == 0) if (_realNode == 0)
return 0; return 0;

View file

@ -424,7 +424,7 @@ private:
* are interesting for that matter. * are interesting for that matter.
*/ */
template<class Arg, class Res> template<class Arg, class Res>
struct Functor1 : public Common::UnaryFunction<Arg, Res> { struct Functor1 : public UnaryFunction<Arg, Res> {
virtual ~Functor1() {} virtual ~Functor1() {}
virtual bool isValid() const = 0; virtual bool isValid() const = 0;
@ -460,7 +460,7 @@ private:
* @see Functor1 * @see Functor1
*/ */
template<class Arg1, class Arg2, class Res> template<class Arg1, class Arg2, class Res>
struct Functor2 : public Common::BinaryFunction<Arg1, Arg2, Res> { struct Functor2 : public BinaryFunction<Arg1, Arg2, Res> {
virtual ~Functor2() {} virtual ~Functor2() {}
virtual bool isValid() const = 0; virtual bool isValid() const = 0;

View file

@ -66,9 +66,9 @@ private:
Symbol(uint32 c, uint32 s); Symbol(uint32 c, uint32 s);
}; };
typedef Common::List<Symbol> CodeList; typedef List<Symbol> CodeList;
typedef Common::Array<CodeList> CodeLists; typedef Array<CodeList> CodeLists;
typedef Common::Array<Symbol *> SymbolList; typedef Array<Symbol*> SymbolList;
/** Lists of codes and their symbols, sorted by code length. */ /** Lists of codes and their symbols, sorted by code length. */
CodeLists _codes; CodeLists _codes;

View file

@ -25,7 +25,7 @@
namespace Common { namespace Common {
IFFParser::IFFParser(Common::ReadStream *stream, bool disposeStream) : _stream(stream), _disposeStream(disposeStream) { IFFParser::IFFParser(ReadStream *stream, bool disposeStream) : _stream(stream), _disposeStream(disposeStream) {
setInputStream(stream); setInputStream(stream);
} }
@ -36,7 +36,7 @@ IFFParser::~IFFParser() {
_stream = 0; _stream = 0;
} }
void IFFParser::setInputStream(Common::ReadStream *stream) { void IFFParser::setInputStream(ReadStream *stream) {
assert(stream); assert(stream);
_formChunk.setInputStream(stream); _formChunk.setInputStream(stream);
_chunk.setInputStream(stream); _chunk.setInputStream(stream);
@ -63,7 +63,7 @@ void IFFParser::parse(IFFCallback &callback) {
_chunk.readHeader(); _chunk.readHeader();
// invoke the callback // invoke the callback
Common::SubReadStream stream(&_chunk, _chunk.size); SubReadStream stream(&_chunk, _chunk.size);
IFFChunk chunk(_chunk.id, _chunk.size, &stream); IFFChunk chunk(_chunk.id, _chunk.size, &stream);
stop = callback(chunk); stop = callback(chunk);

View file

@ -146,11 +146,11 @@ page 376) */
* Client code must *not* deallocate _stream when done. * Client code must *not* deallocate _stream when done.
*/ */
struct IFFChunk { struct IFFChunk {
Common::IFF_ID _type; IFF_ID _type;
uint32 _size; uint32 _size;
Common::ReadStream *_stream; ReadStream *_stream;
IFFChunk(Common::IFF_ID type, uint32 size, Common::ReadStream *stream) : _type(type), _size(size), _stream(stream) { IFFChunk(IFF_ID type, uint32 size, ReadStream *stream) : _type(type), _size(size), _stream(stream) {
assert(_stream); assert(_stream);
} }
}; };
@ -163,17 +163,17 @@ class IFFParser {
/** /**
* This private class implements IFF chunk navigation. * This private class implements IFF chunk navigation.
*/ */
class IFFChunkNav : public Common::ReadStream { class IFFChunkNav : public ReadStream {
protected: protected:
Common::ReadStream *_input; ReadStream *_input;
uint32 _bytesRead; uint32 _bytesRead;
public: public:
Common::IFF_ID id; IFF_ID id;
uint32 size; uint32 size;
IFFChunkNav() : _input(0) { IFFChunkNav() : _input(0) {
} }
void setInputStream(Common::ReadStream *input) { void setInputStream(ReadStream *input) {
_input = input; _input = input;
size = _bytesRead = 0; size = _bytesRead = 0;
} }
@ -199,7 +199,7 @@ class IFFParser {
readByte(); readByte();
} }
} }
// Common::ReadStream implementation // ReadStream implementation
bool eos() const { return _input->eos(); } bool eos() const { return _input->eos(); }
bool err() const { return _input->err(); } bool err() const { return _input->err(); }
void clearErr() { _input->clearErr(); } void clearErr() { _input->clearErr(); }
@ -215,21 +215,21 @@ protected:
IFFChunkNav _chunk; ///< The current chunk. IFFChunkNav _chunk; ///< The current chunk.
uint32 _formSize; uint32 _formSize;
Common::IFF_ID _formType; IFF_ID _formType;
Common::ReadStream *_stream; ReadStream *_stream;
bool _disposeStream; bool _disposeStream;
void setInputStream(Common::ReadStream *stream); void setInputStream(ReadStream *stream);
public: public:
IFFParser(Common::ReadStream *stream, bool disposeStream = false); IFFParser(ReadStream *stream, bool disposeStream = false);
~IFFParser(); ~IFFParser();
/** /**
* Callback type for the parser. * Callback type for the parser.
*/ */
typedef Common::Functor1< IFFChunk&, bool > IFFCallback; typedef Functor1< IFFChunk&, bool > IFFCallback;
/** /**
* Parse the IFF container, invoking the callback on each chunk encountered. * Parse the IFF container, invoking the callback on each chunk encountered.

View file

@ -185,12 +185,12 @@ public:
} }
template<class T2> template<class T2>
bool operator==(const Common::SharedPtr<T2> &r) const { bool operator==(const SharedPtr<T2> &r) const {
return _pointer == r.get(); return _pointer == r.get();
} }
template<class T2> template<class T2>
bool operator!=(const Common::SharedPtr<T2> &r) const { bool operator!=(const SharedPtr<T2> &r) const {
return _pointer != r.get(); return _pointer != r.get();
} }

View file

@ -48,7 +48,7 @@ QuickTimeParser::QuickTimeParser() {
_fd = 0; _fd = 0;
_scaleFactorX = 1; _scaleFactorX = 1;
_scaleFactorY = 1; _scaleFactorY = 1;
_resFork = new Common::MacResManager(); _resFork = new MacResManager();
_disposeFileHandle = DisposeAfterUse::YES; _disposeFileHandle = DisposeAfterUse::YES;
initParseTable(); initParseTable();
@ -59,7 +59,7 @@ QuickTimeParser::~QuickTimeParser() {
delete _resFork; delete _resFork;
} }
bool QuickTimeParser::parseFile(const Common::String &filename) { bool QuickTimeParser::parseFile(const String &filename) {
if (!_resFork->open(filename) || !_resFork->hasDataFork()) if (!_resFork->open(filename) || !_resFork->hasDataFork())
return false; return false;
@ -70,7 +70,7 @@ bool QuickTimeParser::parseFile(const Common::String &filename) {
if (_resFork->hasResFork()) { if (_resFork->hasResFork()) {
// Search for a 'moov' resource // Search for a 'moov' resource
Common::MacResIDArray idArray = _resFork->getResIDArray(MKTAG('m', 'o', 'o', 'v')); MacResIDArray idArray = _resFork->getResIDArray(MKTAG('m', 'o', 'o', 'v'));
if (!idArray.empty()) if (!idArray.empty())
_fd = _resFork->getResource(MKTAG('m', 'o', 'o', 'v'), idArray[0]); _fd = _resFork->getResource(MKTAG('m', 'o', 'o', 'v'), idArray[0]);
@ -96,7 +96,7 @@ bool QuickTimeParser::parseFile(const Common::String &filename) {
return true; return true;
} }
bool QuickTimeParser::parseStream(Common::SeekableReadStream *stream, DisposeAfterUse::Flag disposeFileHandle) { bool QuickTimeParser::parseStream(SeekableReadStream *stream, DisposeAfterUse::Flag disposeFileHandle) {
_fd = stream; _fd = stream;
_foundMOOV = false; _foundMOOV = false;
_disposeFileHandle = disposeFileHandle; _disposeFileHandle = disposeFileHandle;
@ -274,7 +274,7 @@ int QuickTimeParser::readCMOV(Atom atom) {
// Uncompress the data // Uncompress the data
unsigned long dstLen = uncompressedSize; unsigned long dstLen = uncompressedSize;
if (!Common::uncompress(uncompressedData, &dstLen, compressedData, compressedSize)) { if (!uncompress(uncompressedData, &dstLen, compressedData, compressedSize)) {
warning ("Could not uncompress cmov chunk"); warning ("Could not uncompress cmov chunk");
free(compressedData); free(compressedData);
free(uncompressedData); free(uncompressedData);
@ -282,8 +282,8 @@ int QuickTimeParser::readCMOV(Atom atom) {
} }
// Load data into a new MemoryReadStream and assign _fd to be that // Load data into a new MemoryReadStream and assign _fd to be that
Common::SeekableReadStream *oldStream = _fd; SeekableReadStream *oldStream = _fd;
_fd = new Common::MemoryReadStream(uncompressedData, uncompressedSize, DisposeAfterUse::YES); _fd = new MemoryReadStream(uncompressedData, uncompressedSize, DisposeAfterUse::YES);
// Read the contents of the uncompressed data // Read the contents of the uncompressed data
Atom a = { MKTAG('m', 'o', 'o', 'v'), 0, uncompressedSize }; Atom a = { MKTAG('m', 'o', 'o', 'v'), 0, uncompressedSize };
@ -333,8 +333,8 @@ int QuickTimeParser::readMVHD(Atom atom) {
uint32 yMod = _fd->readUint32BE(); uint32 yMod = _fd->readUint32BE();
_fd->skip(16); _fd->skip(16);
_scaleFactorX = Common::Rational(0x10000, xMod); _scaleFactorX = Rational(0x10000, xMod);
_scaleFactorY = Common::Rational(0x10000, yMod); _scaleFactorY = Rational(0x10000, yMod);
_scaleFactorX.debugPrint(1, "readMVHD(): scaleFactorX ="); _scaleFactorX.debugPrint(1, "readMVHD(): scaleFactorX =");
_scaleFactorY.debugPrint(1, "readMVHD(): scaleFactorY ="); _scaleFactorY.debugPrint(1, "readMVHD(): scaleFactorY =");
@ -403,8 +403,8 @@ int QuickTimeParser::readTKHD(Atom atom) {
uint32 yMod = _fd->readUint32BE(); uint32 yMod = _fd->readUint32BE();
_fd->skip(16); _fd->skip(16);
track->scaleFactorX = Common::Rational(0x10000, xMod); track->scaleFactorX = Rational(0x10000, xMod);
track->scaleFactorY = Common::Rational(0x10000, yMod); track->scaleFactorY = Rational(0x10000, yMod);
track->scaleFactorX.debugPrint(1, "readTKHD(): scaleFactorX ="); track->scaleFactorX.debugPrint(1, "readTKHD(): scaleFactorX =");
track->scaleFactorY.debugPrint(1, "readTKHD(): scaleFactorY ="); track->scaleFactorY.debugPrint(1, "readTKHD(): scaleFactorY =");
@ -431,7 +431,7 @@ int QuickTimeParser::readELST(Atom atom) {
for (uint32 i = 0; i < track->editCount; i++){ for (uint32 i = 0; i < track->editCount; i++){
track->editList[i].trackDuration = _fd->readUint32BE(); track->editList[i].trackDuration = _fd->readUint32BE();
track->editList[i].mediaTime = _fd->readSint32BE(); track->editList[i].mediaTime = _fd->readSint32BE();
track->editList[i].mediaRate = Common::Rational(_fd->readUint32BE(), 0x10000); track->editList[i].mediaRate = Rational(_fd->readUint32BE(), 0x10000);
debugN(3, "\tDuration = %d, Media Time = %d, ", track->editList[i].trackDuration, track->editList[i].mediaTime); debugN(3, "\tDuration = %d, Media Time = %d, ", track->editList[i].trackDuration, track->editList[i].mediaTime);
track->editList[i].mediaRate.debugPrint(3, "Media Rate ="); track->editList[i].mediaRate.debugPrint(3, "Media Rate =");
} }
@ -695,7 +695,7 @@ enum {
kMP4DecSpecificDescTag = 5 kMP4DecSpecificDescTag = 5
}; };
static int readMP4DescLength(Common::SeekableReadStream *stream) { static int readMP4DescLength(SeekableReadStream *stream) {
int length = 0; int length = 0;
int count = 4; int count = 4;
@ -710,7 +710,7 @@ static int readMP4DescLength(Common::SeekableReadStream *stream) {
return length; return length;
} }
static void readMP4Desc(Common::SeekableReadStream *stream, byte &tag, int &length) { static void readMP4Desc(SeekableReadStream *stream, byte &tag, int &length) {
tag = stream->readByte(); tag = stream->readByte();
length = readMP4DescLength(stream); length = readMP4DescLength(stream);
} }

View file

@ -56,14 +56,14 @@ public:
* Load a QuickTime file * Load a QuickTime file
* @param filename the filename to load * @param filename the filename to load
*/ */
bool parseFile(const Common::String &filename); bool parseFile(const String &filename);
/** /**
* Load a QuickTime file from a SeekableReadStream * Load a QuickTime file from a SeekableReadStream
* @param stream the stream to load * @param stream the stream to load
* @param disposeFileHandle whether to delete the stream after use * @param disposeFileHandle whether to delete the stream after use
*/ */
bool parseStream(Common::SeekableReadStream *stream, DisposeAfterUse::Flag disposeFileHandle = DisposeAfterUse::YES); bool parseStream(SeekableReadStream *stream, DisposeAfterUse::Flag disposeFileHandle = DisposeAfterUse::YES);
/** /**
* Close a QuickTime file * Close a QuickTime file
@ -81,7 +81,7 @@ public:
protected: protected:
// This is the file handle from which data is read from. It can be the actual file handle or a decompressed stream. // This is the file handle from which data is read from. It can be the actual file handle or a decompressed stream.
Common::SeekableReadStream *_fd; SeekableReadStream *_fd;
DisposeAfterUse::Flag _disposeFileHandle; DisposeAfterUse::Flag _disposeFileHandle;
@ -110,7 +110,7 @@ protected:
struct EditListEntry { struct EditListEntry {
uint32 trackDuration; uint32 trackDuration;
int32 mediaTime; int32 mediaTime;
Common::Rational mediaRate; Rational mediaRate;
}; };
struct Track; struct Track;
@ -154,18 +154,18 @@ protected:
uint16 height; uint16 height;
CodecType codecType; CodecType codecType;
Common::Array<SampleDesc *> sampleDescs; Array<SampleDesc*> sampleDescs;
uint32 editCount; uint32 editCount;
EditListEntry *editList; EditListEntry *editList;
Common::SeekableReadStream *extraData; SeekableReadStream *extraData;
uint32 frameCount; uint32 frameCount;
uint32 duration; uint32 duration;
uint32 startTime; uint32 startTime;
Common::Rational scaleFactorX; Rational scaleFactorX;
Common::Rational scaleFactorY; Rational scaleFactorY;
byte objectTypeMP4; byte objectTypeMP4;
}; };
@ -176,11 +176,11 @@ protected:
bool _foundMOOV; bool _foundMOOV;
uint32 _timeScale; uint32 _timeScale;
uint32 _duration; uint32 _duration;
Common::Rational _scaleFactorX; Rational _scaleFactorX;
Common::Rational _scaleFactorY; Rational _scaleFactorY;
Common::Array<Track *> _tracks; Array<Track*> _tracks;
uint32 _beginOffset; uint32 _beginOffset;
Common::MacResManager *_resFork; MacResManager *_resFork;
void initParseTable(); void initParseTable();
void init(); void init();

View file

@ -107,8 +107,8 @@ Rational &Rational::operator-=(const Rational &right) {
Rational &Rational::operator*=(const Rational &right) { Rational &Rational::operator*=(const Rational &right) {
// Cross-cancel to avoid unnecessary overflow; // Cross-cancel to avoid unnecessary overflow;
// the result then is automatically normalized // the result then is automatically normalized
const int gcd1 = Common::gcd(_num, right._denom); const int gcd1 = gcd(_num, right._denom);
const int gcd2 = Common::gcd(right._num, _denom); const int gcd2 = gcd(right._num, _denom);
_num = (_num / gcd1) * (right._num / gcd2); _num = (_num / gcd1) * (right._num / gcd2);
_denom = (_denom / gcd2) * (right._denom / gcd1); _denom = (_denom / gcd2) * (right._denom / gcd1);

View file

@ -68,15 +68,15 @@ public:
static const Version kLastVersion = 0xFFFFFFFF; static const Version kLastVersion = 0xFFFFFFFF;
protected: protected:
Common::SeekableReadStream *_loadStream; SeekableReadStream *_loadStream;
Common::WriteStream *_saveStream; WriteStream *_saveStream;
uint _bytesSynced; uint _bytesSynced;
Version _version; Version _version;
public: public:
Serializer(Common::SeekableReadStream *in, Common::WriteStream *out) Serializer(SeekableReadStream *in, WriteStream *out)
: _loadStream(in), _saveStream(out), _bytesSynced(0), _version(0) { : _loadStream(in), _saveStream(out), _bytesSynced(0), _version(0) {
assert(in || out); assert(in || out);
} }
@ -214,7 +214,7 @@ public:
* Sync a C-string, by treating it as a zero-terminated byte sequence. * Sync a C-string, by treating it as a zero-terminated byte sequence.
* @todo Replace this method with a special Syncer class for Common::String * @todo Replace this method with a special Syncer class for Common::String
*/ */
void syncString(Common::String &str, Version minVersion = 0, Version maxVersion = kLastVersion) { void syncString(String &str, Version minVersion = 0, Version maxVersion = kLastVersion) {
if (_version < minVersion || _version > maxVersion) if (_version < minVersion || _version > maxVersion)
return; // Ignore anything which is not supposed to be present in this save game version return; // Ignore anything which is not supposed to be present in this save game version

View file

@ -219,14 +219,14 @@ public:
* except that it stores the result in (variably sized) String * except that it stores the result in (variably sized) String
* instead of a fixed size buffer. * instead of a fixed size buffer.
*/ */
static Common::String format(const char *fmt, ...) GCC_PRINTF(1,2); static String format(const char *fmt, ...) GCC_PRINTF(1,2);
/** /**
* Print formatted data into a String object. Similar to vsprintf, * Print formatted data into a String object. Similar to vsprintf,
* except that it stores the result in (variably sized) String * except that it stores the result in (variably sized) String
* instead of a fixed size buffer. * instead of a fixed size buffer.
*/ */
static Common::String vformat(const char *fmt, va_list args); static String vformat(const char *fmt, va_list args);
public: public:
typedef char * iterator; typedef char * iterator;
@ -293,7 +293,7 @@ extern char *trim(char *t);
* @param sep character used to separate path components * @param sep character used to separate path components
* @return The last component of the path. * @return The last component of the path.
*/ */
Common::String lastPathComponent(const Common::String &path, const char sep); String lastPathComponent(const String &path, const char sep);
/** /**
* Normalize a given path to a canonical form. In particular: * Normalize a given path to a canonical form. In particular:
@ -307,7 +307,7 @@ Common::String lastPathComponent(const Common::String &path, const char sep);
* @param sep the separator token (usually '/' on Unix-style systems, or '\\' on Windows based stuff) * @param sep the separator token (usually '/' on Unix-style systems, or '\\' on Windows based stuff)
* @return the normalized path * @return the normalized path
*/ */
Common::String normalizePath(const Common::String &path, const char sep); String normalizePath(const String &path, const char sep);
/** /**

View file

@ -293,8 +293,8 @@ ArjHeader *readHeader(SeekableReadStream &stream) {
return NULL; return NULL;
} }
Common::strlcpy(header.filename, (const char *)&headData[header.firstHdrSize], ARJ_FILENAME_MAX); strlcpy(header.filename, (const char *)&headData[header.firstHdrSize], ARJ_FILENAME_MAX);
Common::strlcpy(header.comment, (const char *)&headData[header.firstHdrSize + strlen(header.filename) + 1], ARJ_COMMENT_MAX); strlcpy(header.comment, (const char *)&headData[header.firstHdrSize + strlen(header.filename) + 1], ARJ_COMMENT_MAX);
// Process extended headers, if any // Process extended headers, if any
uint16 extHeaderSize; uint16 extHeaderSize;
@ -692,15 +692,15 @@ void ArjDecoder::decode_f(int32 origsize) {
typedef HashMap<String, ArjHeader*, IgnoreCase_Hash, IgnoreCase_EqualTo> ArjHeadersMap; typedef HashMap<String, ArjHeader*, IgnoreCase_Hash, IgnoreCase_EqualTo> ArjHeadersMap;
class ArjArchive : public Common::Archive { class ArjArchive : public Archive {
ArjHeadersMap _headers; ArjHeadersMap _headers;
Common::String _arjFilename; String _arjFilename;
public: public:
ArjArchive(const String &name); ArjArchive(const String &name);
virtual ~ArjArchive(); virtual ~ArjArchive();
// Common::Archive implementation // Archive implementation
virtual bool hasFile(const String &name); virtual bool hasFile(const String &name);
virtual int listMembers(ArchiveMemberList &list); virtual int listMembers(ArchiveMemberList &list);
virtual ArchiveMemberPtr getMember(const String &name); virtual ArchiveMemberPtr getMember(const String &name);
@ -708,7 +708,7 @@ public:
}; };
ArjArchive::ArjArchive(const String &filename) : _arjFilename(filename) { ArjArchive::ArjArchive(const String &filename) : _arjFilename(filename) {
Common::File arjFile; File arjFile;
if (!arjFile.open(_arjFilename)) { if (!arjFile.open(_arjFilename)) {
warning("ArjArchive::ArjArchive(): Could not find the archive file"); warning("ArjArchive::ArjArchive(): Could not find the archive file");
@ -775,7 +775,7 @@ SeekableReadStream *ArjArchive::createReadStreamForMember(const String &name) co
ArjHeader *hdr = _headers[name]; ArjHeader *hdr = _headers[name];
Common::File archiveFile; File archiveFile;
archiveFile.open(_arjFilename); archiveFile.open(_arjFilename);
archiveFile.seek(hdr->pos, SEEK_SET); archiveFile.seek(hdr->pos, SEEK_SET);
@ -794,8 +794,8 @@ SeekableReadStream *ArjArchive::createReadStreamForMember(const String &name) co
// If reading from archiveFile directly is too slow to be usable, // If reading from archiveFile directly is too slow to be usable,
// maybe the filesystem code should instead wrap its files // maybe the filesystem code should instead wrap its files
// in a BufferedReadStream. // in a BufferedReadStream.
decoder->_compressed = Common::wrapBufferedReadStream(&archiveFile, 4096, DisposeAfterUse::NO); decoder->_compressed = wrapBufferedReadStream(&archiveFile, 4096, DisposeAfterUse::NO);
decoder->_outstream = new Common::MemoryWriteStream(uncompressedData, hdr->origSize); decoder->_outstream = new MemoryWriteStream(uncompressedData, hdr->origSize);
if (hdr->method == 1 || hdr->method == 2 || hdr->method == 3) if (hdr->method == 1 || hdr->method == 2 || hdr->method == 3)
decoder->decode(hdr->origSize); decoder->decode(hdr->origSize);
@ -805,7 +805,7 @@ SeekableReadStream *ArjArchive::createReadStreamForMember(const String &name) co
delete decoder; delete decoder;
} }
return new Common::MemoryReadStream(uncompressedData, hdr->origSize, DisposeAfterUse::YES); return new MemoryReadStream(uncompressedData, hdr->origSize, DisposeAfterUse::YES);
} }
Archive *makeArjArchive(const String &name) { Archive *makeArjArchive(const String &name) {

View file

@ -1458,11 +1458,11 @@ ZipArchive::~ZipArchive() {
unzClose(_zipFile); unzClose(_zipFile);
} }
bool ZipArchive::hasFile(const Common::String &name) { bool ZipArchive::hasFile(const String &name) {
return (unzLocateFile(_zipFile, name.c_str(), 2) == UNZ_OK); return (unzLocateFile(_zipFile, name.c_str(), 2) == UNZ_OK);
} }
int ZipArchive::listMembers(Common::ArchiveMemberList &list) { int ZipArchive::listMembers(ArchiveMemberList &list) {
int matches = 0; int matches = 0;
int err = unzGoToFirstFile(_zipFile); int err = unzGoToFirstFile(_zipFile);
@ -1488,7 +1488,7 @@ ArchiveMemberPtr ZipArchive::getMember(const String &name) {
return ArchiveMemberPtr(new GenericArchiveMember(name, this)); return ArchiveMemberPtr(new GenericArchiveMember(name, this));
} }
Common::SeekableReadStream *ZipArchive::createReadStreamForMember(const Common::String &name) const { SeekableReadStream *ZipArchive::createReadStreamForMember(const String &name) const {
if (unzLocateFile(_zipFile, name.c_str(), 2) != UNZ_OK) if (unzLocateFile(_zipFile, name.c_str(), 2) != UNZ_OK)
return 0; return 0;
@ -1512,7 +1512,7 @@ Common::SeekableReadStream *ZipArchive::createReadStreamForMember(const Common::
return 0; return 0;
} }
return new Common::MemoryReadStream(buffer, fileInfo.uncompressed_size, DisposeAfterUse::YES); return new MemoryReadStream(buffer, fileInfo.uncompressed_size, DisposeAfterUse::YES);
// FIXME: instead of reading all into a memory stream, we could // FIXME: instead of reading all into a memory stream, we could
// instead create a new ZipStream class. But then we have to be // instead create a new ZipStream class. But then we have to be

View file

@ -82,7 +82,7 @@ void hexdump(const byte *data, int len, int bytesPerLine, int startOffset) {
#pragma mark - #pragma mark -
bool parseBool(const Common::String &val, bool &valAsBool) { bool parseBool(const String &val, bool &valAsBool) {
if (val.equalsIgnoreCase("true") || if (val.equalsIgnoreCase("true") ||
val.equalsIgnoreCase("yes") || val.equalsIgnoreCase("yes") ||
val.equals("1")) { val.equals("1")) {

View file

@ -96,7 +96,7 @@ extern void hexdump(const byte * data, int len, int bytesPerLine = 16, int start
* @param[out] valAsBool the parsing result * @param[out] valAsBool the parsing result
* @return true if the string parsed correctly, false if an error occurred. * @return true if the string parsed correctly, false if an error occurred.
*/ */
bool parseBool(const Common::String &val, bool &valAsBool); bool parseBool(const String &val, bool &valAsBool);
/** /**
* List of game language. * List of game language.
@ -131,7 +131,7 @@ struct LanguageDescription {
const char *code; const char *code;
//const char *unixLocale; //const char *unixLocale;
const char *description; const char *description;
Common::Language id; Language id;
}; };
extern const LanguageDescription g_languages[]; extern const LanguageDescription g_languages[];
@ -182,7 +182,7 @@ struct PlatformDescription {
const char *code2; const char *code2;
const char *abbrev; const char *abbrev;
const char *description; const char *description;
Common::Platform id; Platform id;
}; };
extern const PlatformDescription g_platforms[]; extern const PlatformDescription g_platforms[];
@ -211,7 +211,7 @@ enum RenderMode {
struct RenderModeDescription { struct RenderModeDescription {
const char *code; const char *code;
const char *description; const char *description;
Common::RenderMode id; RenderMode id;
}; };
extern const RenderModeDescription g_renderModes[]; extern const RenderModeDescription g_renderModes[];

View file

@ -133,7 +133,7 @@ void PEResources::parseResourceLevel(Section &section, uint32 offset, int level)
_exe->seek(section.offset + (value & 0x7fffffff)); _exe->seek(section.offset + (value & 0x7fffffff));
// Read in the name, truncating from unicode to ascii // Read in the name, truncating from unicode to ascii
Common::String name; String name;
uint16 nameLength = _exe->readUint16LE(); uint16 nameLength = _exe->readUint16LE();
while (nameLength--) while (nameLength--)
name += (char)(_exe->readUint16LE() & 0xff); name += (char)(_exe->readUint16LE() & 0xff);

View file

@ -81,7 +81,7 @@ void XMLParser::close() {
_stream = 0; _stream = 0;
} }
bool XMLParser::parserError(const Common::String &errStr) { bool XMLParser::parserError(const String &errStr) {
_state = kParserError; _state = kParserError;
const int startPosition = _stream->pos(); const int startPosition = _stream->pos();

View file

@ -275,7 +275,7 @@ protected:
* Parser error always returns "false" so we can pass the return value * Parser error always returns "false" so we can pass the return value
* directly and break down the parsing. * directly and break down the parsing.
*/ */
bool parserError(const Common::String &errStr); bool parserError(const String &errStr);
/** /**
* Skips spaces/whitelines etc. * Skips spaces/whitelines etc.

View file

@ -54,7 +54,7 @@ bool uncompress(byte *dst, unsigned long *dstLen, const byte *src, unsigned long
* other SeekableReadStream and will then provide on-the-fly decompression support. * other SeekableReadStream and will then provide on-the-fly decompression support.
* Assumes the compressed data to be in gzip format. * Assumes the compressed data to be in gzip format.
*/ */
class GZipReadStream : public Common::SeekableReadStream { class GZipReadStream : public SeekableReadStream {
protected: protected:
enum { enum {
BUFSIZE = 16384 // 1 << MAX_WBITS BUFSIZE = 16384 // 1 << MAX_WBITS
@ -71,7 +71,7 @@ protected:
public: public:
GZipReadStream(Common::SeekableReadStream *w) : _wrapped(w), _stream() { GZipReadStream(SeekableReadStream *w) : _wrapped(w), _stream() {
assert(w != 0); assert(w != 0);
// Verify file header is correct // Verify file header is correct
@ -197,7 +197,7 @@ public:
* other WriteStream and will then provide on-the-fly compression support. * other WriteStream and will then provide on-the-fly compression support.
* The compressed data is written in the gzip format. * The compressed data is written in the gzip format.
*/ */
class GZipWriteStream : public Common::WriteStream { class GZipWriteStream : public WriteStream {
protected: protected:
enum { enum {
BUFSIZE = 16384 // 1 << MAX_WBITS BUFSIZE = 16384 // 1 << MAX_WBITS
@ -224,7 +224,7 @@ protected:
} }
public: public:
GZipWriteStream(Common::WriteStream *w) : _wrapped(w), _stream() { GZipWriteStream(WriteStream *w) : _wrapped(w), _stream() {
assert(w != 0); assert(w != 0);
// Adding 16 to windowBits indicates to zlib that it is supposed to // Adding 16 to windowBits indicates to zlib that it is supposed to
@ -300,7 +300,7 @@ public:
#endif // USE_ZLIB #endif // USE_ZLIB
Common::SeekableReadStream *wrapCompressedReadStream(Common::SeekableReadStream *toBeWrapped) { SeekableReadStream *wrapCompressedReadStream(SeekableReadStream *toBeWrapped) {
#if defined(USE_ZLIB) #if defined(USE_ZLIB)
if (toBeWrapped) { if (toBeWrapped) {
uint16 header = toBeWrapped->readUint16BE(); uint16 header = toBeWrapped->readUint16BE();
@ -315,7 +315,7 @@ Common::SeekableReadStream *wrapCompressedReadStream(Common::SeekableReadStream
return toBeWrapped; return toBeWrapped;
} }
Common::WriteStream *wrapCompressedWriteStream(Common::WriteStream *toBeWrapped) { WriteStream *wrapCompressedWriteStream(WriteStream *toBeWrapped) {
#if defined(USE_ZLIB) #if defined(USE_ZLIB)
if (toBeWrapped) if (toBeWrapped)
return new GZipWriteStream(toBeWrapped); return new GZipWriteStream(toBeWrapped);