2 * FryingPan - Amiga CD/DVD Recording Software (User Interface and supporting Libraries only)
3 * Copyright (C) 2001-2011 Tomasz Wiszkowski Tomasz.Wiszkowski at gmail.com
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public License
7 * as published by the Free Software Foundation; either version 2.1
8 * of the License, or (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 #include "RRStructures.h"
21 #include "ISOStructures.h"
22 #include <LibC/LibC.h>
24 RRExt::RRExt(uint8 id1
, uint8 id2
, uint8 flags
, uint8 sets
)
41 uint8
* RRExt::PutData(uint8
* loc
)
54 void RRExt::SetFlags(uint8 flags
)
59 uint8
RRExt::GetFlags()
65 RR_NM::RR_NM(const char* name
) :
71 void RR_NM::SetName(const char* name
)
78 return RRExt::Length()+name
.Length();
81 uint8
*RR_NM::PutData(uint8
* loc
)
83 loc
= RRExt::PutData(loc
);
84 strncpy((char*)loc
, name
.Data(), name
.Length());
90 RR_RR::RR_RR(uint8 flags
) :
91 RRExt('R', 'R', flags
)
96 RR_AS::RR_AS(const char* comment
, uint8 protection
) :
99 this->comment
= comment
;
100 this->protection
= protection
;
103 uint8
RR_AS::Length()
108 size
= comment
.Length();
121 RRExt::SetFlags(flags
);
125 return RRExt::Length() + size
;
128 uint8
*RR_AS::PutData(uint8
* loc
)
130 uint8 flags
= RRExt::GetFlags();
135 loc
= RRExt::PutData(loc
);
147 *loc
++ = comment
.Length()+1;
148 strncpy((char*)loc
, comment
.Data(), comment
.Length());
149 loc
+= comment
.Length();
155 void RR_AS::SetFlags(uint8 flags
)
160 void RR_AS::SetElemComment(const char* comment
)
162 this->comment
= comment
;
165 const String
&RR_AS::GetElemComment() const
176 uint8
RR_SP::Length()
181 uint8
*RR_SP::PutData(uint8
* loc
)
194 RR_PX::RR_PX(uint8 prot
, bool dir
) :
201 uint8
RR_PX::Length()
206 uint8
*RR_PX::PutData(uint8
* loc
)
216 loc
+= sizeof(val733
);
220 loc
+= sizeof(val733
);
224 loc
+= sizeof(val733
);
228 loc
+= sizeof(val733
);
232 loc
+= sizeof(val733
);
237 void RR_PX::SetFlags(uint8 p
)
244 flags
|= S_IROTH
| S_IRGRP
| S_IRUSR
;
246 flags
|= S_IWOTH
| S_IWGRP
| S_IWUSR
;
248 flags
|= S_IXOTH
| S_IXGRP
| S_IXUSR
;
256 uint8
RR_PX::GetFlags()
261 void RR_PX::SetDir(bool dir
)
265 flags
&= ~(S_IFDIR
| S_IFREG
);
273 * RR_CE: content extension entry
277 RRExt('C', 'E', 0, 0)
281 void RR_CE::setBlock(uint32 block
)
283 this->block
= (block
);
286 void RR_CE::setOffset(uint32 offset
)
288 this->offset
= (offset
);
291 void RR_CE::setLength(uint32 length
)
293 this->length
= (length
);
296 uint8
RR_CE::Length()
301 uint8
*RR_CE::PutData(uint8
* loc
)
305 loc
= RRExt::PutData(loc
);