1 /* 2 * Copyright 2013-2014, Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 * 5 * Authors: 6 * Ingo Weinhold <ingo_weinhold@gmx.de> 7 */ 8 9 10 #include "Package.h" 11 12 #include <fcntl.h> 13 14 #include <File.h> 15 16 #include <AutoDeleter.h> 17 18 #include "DebugSupport.h" 19 20 21 Package::Package(PackageFile* file) 22 : 23 fFile(file), 24 fActive(false), 25 fFileNameHashTableNext(NULL), 26 fNodeRefHashTableNext(NULL) 27 { 28 fFile->AcquireReference(); 29 } 30 31 32 Package::~Package() 33 { 34 fFile->ReleaseReference(); 35 } 36 37 38 Package* 39 Package::Clone() const 40 { 41 Package* clone = new(std::nothrow) Package(fFile); 42 if (clone != NULL) 43 clone->fActive = fActive; 44 return clone; 45 } 46