Initial checkin.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3119 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
cba5c5b207
commit
4a547c1282
41
src/add-ons/kernel/file_systems/udf/Block.h
Normal file
41
src/add-ons/kernel/file_systems/udf/Block.h
Normal file
@ -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 <malloc.h>
|
||||
|
||||
#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
|
Loading…
Reference in New Issue
Block a user