/*
 * This file is part of DesktopBSD, see the README file.
 *
 * Author: Peter Hofer <ph@desktopbsd.net>
 *         (C) 2004, 2005
 *
 * Copyright: BSD, see the COPYING file included in this distribution
 *
 */

#ifndef __CHUNK_H
#define __CHUNK_H

#include <disk.h>

#include <fsdevice.h>

/** @brief Provides operations on single disk chunks.
  *
  * This class represents a subpart of a disk (class Disk).
  *
  * @warning
  *  A Disk::Chunk object gets INVALID after a
  *  non-const operation was performed or
  *  when the parent disk is deleted.
  */
class Disk::Chunk : public FSDevice {
    friend class Disk;

public:
    bool  create(FSType, const Size &);

    bool  free();

    bool  inUse()  const;

    bool  isValid()  const;

	 bool	 newFS();

private:
    Chunk(chunk *,  Disk *);

    Disk   *parent;
    chunk  *cnk;
};

#endif /* __CHUNK_H */
