1 /* 2 * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de. 3 * Distributed under the terms of the MIT License. 4 */ 5 6 7 #include <package/hpkg/PackageData.h> 8 9 #include <string.h> 10 11 #include <package/hpkg/HPKGDefsPrivate.h> 12 13 14 namespace BPackageKit { 15 16 namespace BHPKG { 17 18 19 using namespace BPrivate; 20 21 BPackageData()22BPackageData::BPackageData() 23 : 24 fSize(0), 25 fEncodedInline(true) 26 { 27 } 28 29 30 void SetData(uint64 size,uint64 offset)31BPackageData::SetData(uint64 size, uint64 offset) 32 { 33 fSize = size; 34 fOffset = offset; 35 fEncodedInline = false; 36 } 37 38 39 void SetData(uint8 size,const void * data)40BPackageData::SetData(uint8 size, const void* data) 41 { 42 fSize = size; 43 if (size > 0) 44 memcpy(fInlineData, data, size); 45 fEncodedInline = true; 46 } 47 48 49 } // namespace BHPKG 50 51 } // namespace BPackageKit 52