1 /* 2 * Copyright 2020, Andrew Lindesay <apl@lindesay.co.nz>. 3 * All rights reserved. Distributed under the terms of the MIT License. 4 */ 5 6 #include "IconTarPtr.h" 7 8 IconTarPtr(const BString & name)9IconTarPtr::IconTarPtr(const BString& name) 10 : 11 fName(name), 12 fOffsetsMask(0) 13 { 14 } 15 16 ~IconTarPtr()17IconTarPtr::~IconTarPtr() 18 { 19 } 20 21 22 const BString& Name() const23IconTarPtr::Name() const 24 { 25 return fName; 26 } 27 28 29 off_t Offset(BitmapSize size) const30IconTarPtr::Offset(BitmapSize size) const 31 { 32 return fOffsets[size]; 33 } 34 35 36 bool HasOffset(BitmapSize size) const37IconTarPtr::HasOffset(BitmapSize size) const 38 { 39 return 0 != (fOffsetsMask & (1 << size)); 40 } 41 42 43 void SetOffset(BitmapSize size,off_t value)44IconTarPtr::SetOffset(BitmapSize size, off_t value) 45 { 46 fOffsets[size] = value; 47 fOffsetsMask |= (1 << size); 48 } 49