From 4a547c128264dc900cbd4806c37fee9a7fc3fc5b Mon Sep 17 00:00:00 2001 From: Tyler Dauwalder Date: Mon, 28 Apr 2003 22:59:34 +0000 Subject: [PATCH] Initial checkin. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3119 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/add-ons/kernel/file_systems/udf/Block.h | 41 +++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 src/add-ons/kernel/file_systems/udf/Block.h diff --git a/src/add-ons/kernel/file_systems/udf/Block.h b/src/add-ons/kernel/file_systems/udf/Block.h new file mode 100644 index 0000000000..1c57326bf2 --- /dev/null +++ b/src/add-ons/kernel/file_systems/udf/Block.h @@ -0,0 +1,41 @@ +//---------------------------------------------------------------------- +// 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_BLOCK_H +#define _UDF_BLOCK_H + +#include + +#include "cpp.h" + +namespace UDF { + +class Block { +public: + Block(uint32 size) + : fSize(size) + , fData(malloc(size)) + { + } + + ~Block() { free(fData); } + uint32 Size() { return fSize; } + void* Data() { return fData; } + status_t InitCheck() { return fData ? B_OK : B_NO_MEMORY; } + +private: + Block(); + Block(const Block&); + Block& operator=(const Block&); + + uint32 fSize; + void *fData; +}; + +}; // namespace UDF + +#endif // _UDF_BLOCK_H