diff --git a/src/add-ons/kernel/file_systems/udf/PartitionMap.cpp b/src/add-ons/kernel/file_systems/udf/PartitionMap.cpp deleted file mode 100644 index e34a75b26e..0000000000 --- a/src/add-ons/kernel/file_systems/udf/PartitionMap.cpp +++ /dev/null @@ -1,74 +0,0 @@ -#include "PartitionMap.h" - -using namespace Udf; - -/*! \brief Initializes the empty partition map. -*/ -PartitionMap::PartitionMap() - : fCount(0) -{ -} - -/*! Debugging dump function. -*/ -void -PartitionMap::dump() -{ - DUMP_INIT(CF_DUMP, "PartitionMap"); - PRINT(("fCount: %ld\n", fCount)); - PRINT(("fList:\n")); - - SinglyLinkedList::Iterator i = fList.Begin(); - if (i != fList.End()) { - for ( ; i != fList.End(); ++i) { - PRINT((" partition #%d: start: %ld, length: %ld\n", i->partition_number(), - i->start(), i->length())); - } - } else { - PRINT((" (empty)\n")); - } -} - - -/*! \brief Adds a copy of the given partition to the mapping, - replacing any existing partition with the same partition - number. -*/ -status_t -PartitionMap::Add(const udf_partition_descriptor* partition) -{ - status_t err = partition ? B_OK : B_BAD_VALUE; - if (!err) { - udf_partition_descriptor *temp = const_cast(Find(partition->partition_number())); - if (temp) { - *temp = *partition; - } else { - err = fList.PushBack(*partition) ? B_OK : B_ERROR; - } - } - return err; -} - -/*! \brief Returns a pointer to the partition in the list with the - given number, or NULL if no such partition exists. -*/ -const udf_partition_descriptor* -PartitionMap::Find(uint32 partitionNumber) const -{ - DEBUG_INIT_ETC(CF_PUBLIC | CF_HELPER, "PartitionMap", ("partitionNumber: %ld", partitionNumber)); - SinglyLinkedList::ConstIterator i; - for (i = fList.Begin(); i != fList.End(); ++i) { - if (i->partition_number() == partitionNumber) { - PRINT(("found partition #%ld, start == %ld, length == %ld\n", partitionNumber, - i->start(), i->length())); - return &(*i); - } - } - return NULL; -} - -const udf_partition_descriptor* -PartitionMap::operator[](uint32 partitionNumber) const -{ - return Find(partitionNumber); -} diff --git a/src/add-ons/kernel/file_systems/udf/PartitionMap.h b/src/add-ons/kernel/file_systems/udf/PartitionMap.h deleted file mode 100644 index d882bc173e..0000000000 --- a/src/add-ons/kernel/file_systems/udf/PartitionMap.h +++ /dev/null @@ -1,37 +0,0 @@ -//---------------------------------------------------------------------- -// 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_PARTITION_MAP_H -#define _UDF_PARTITION_MAP_H - -/*! \file PartitionMap.h -*/ - -#include "kernel_cpp.h" -#include "UdfDebug.h" -#include "DiskStructures.h" - -#include "SinglyLinkedList.h" - -namespace Udf { - -class PartitionMap { -public: - PartitionMap(); - - status_t Add(const udf_partition_descriptor* partition); - const udf_partition_descriptor* Find(uint32 partitionNumber) const; - const udf_partition_descriptor* operator[](uint32 partitionNumber) const; - - void dump(); -private: - SinglyLinkedList fList; - uint32 fCount; -}; - -}; // namespace Udf - -#endif // _UDF_PARTITION_MAP_H