Initial checkin. Mostly empty implementation of UDF 2.01 virtual partitions.

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5233 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Tyler Dauwalder 2003-11-02 01:13:43 +00:00
parent 3b9617bcc4
commit 4e77893b64
2 changed files with 90 additions and 0 deletions

View File

@ -0,0 +1,44 @@
#include "VirtualPartition.h"
#define B_NOT_IMPLEMENTED B_ERROR
using namespace Udf;
/*! \brief Creates a new VirtualPartition object.
VirtualPartition objects require a valid VAT to be found on disc. This involves
looking up the last recorded sector on the disc (via the "READ CD RECORDED
CAPACITY" SCSI-MMC call (code 0x25)), which should contain the file entry for
the VAT. Once found, the VAT can be loaded and accessed like a normal file.
*/
VirtualPartition::VirtualPartition(PhysicalPartition &physicalPartition)
: fPhysicalPartition(physicalPartition)
{
// Find VAT
}
/*! \brief Destroys the VirtualPartition object.
*/
VirtualPartition::~VirtualPartition()
{
}
/*! \brief Maps the given logical block to a physical block on disc.
The given logical block is indexed into the VAT. If a corresponding
mapped block exists, that block is mapped to a physical block via the
VirtualPartition object's physical partition.
*/
status_t
VirtualPartition::MapBlock(uint32 logicalBlock, uint32 &physicalBlock)
{
return B_NOT_IMPLEMENTED;
}
/*! Returns the initialization status of the object.
*/
status_t
VirtualPartition::InitCheck()
{
return B_NO_INIT;
}

View File

@ -0,0 +1,46 @@
//----------------------------------------------------------------------
// This software is part of the OpenBeOS distribution and is covered
// by the OpenBeOS license.
//
// Copyright (c) 2003 Tyler Dauwalder, tyler@dauwalder.net
//---------------------------------------------------------------------
#ifndef _UDF_VIRTUAL_PARTITION_H
#define _UDF_VIRTUAL_PARTITION_H
/*! \file VirtualPartition.h
*/
#include <kernel_cpp.h>
#include "Partition.h"
#include "PhysicalPartition.h"
#include "UdfDebug.h"
namespace Udf {
/*! \brief Type 2 virtual partition
VirtualPartitions add an extra layer of indirection between logical
block numbers and physical block numbers, allowing the underlying
physical block numbers to be changed without changing the original
references to (virtual) logical block numbers.
Note that VirtualPartitions should be found only on sequentially written
media such as CD-R, per UDF-2.01 2.2.10.
See also UDF-2.01 2.2.8, UDF-2.01 2.2.10
*/
class VirtualPartition : public Partition {
public:
VirtualPartition(PhysicalPartition &physicalPartition);
virtual ~VirtualPartition();
virtual status_t MapBlock(uint32 logicalBlock, uint32 &physicalBlock);
status_t InitCheck();
private:
PhysicalPartition fPhysicalPartition;
};
}; // namespace Udf
#endif // _UDF_VIRTUAL_PARTITION_H