Start of BVolumeRoster support by Eric
This commit is contained in:
121
bepascal/bepascal/be/storage/VolumeRoster.cpp
Normal file
121
bepascal/bepascal/be/storage/VolumeRoster.cpp
Normal file
@@ -0,0 +1,121 @@
|
||||
/* BePascal - A pascal wrapper around the BeOS API
|
||||
Copyright (C) 2002 Eric Jourde
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
#ifndef _VOLUMEROSTER_CPP_
|
||||
#define _VOLUMEROSTER_CPP_
|
||||
|
||||
#include "VolumeRoster.h"
|
||||
#include <beobj.h>
|
||||
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Method: BVolumeRoster::BVolumeRoster()
|
||||
* Descr:
|
||||
*/
|
||||
TCPlusObject BVolumeRoster_Create(TPasObject PasObject)
|
||||
{
|
||||
return new BVolumeRoster();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Method: BVolumeRoster::~BVolumeRoster()
|
||||
* Descr:
|
||||
*/
|
||||
void BVolumeRoster_Free(BVolumeRoster *VolumeRoster)
|
||||
{
|
||||
delete VolumeRoster;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Method: BVolumeRoster::GetNextVolume()
|
||||
* Descr:
|
||||
*/
|
||||
status_t
|
||||
BVolumeRoster_GetNextVolume(BVolumeRoster *VolumeRoster, BVolume *vol)
|
||||
{
|
||||
return VolumeRoster->GetNextVolume(vol);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Method: BVolumeRoster::Rewind()
|
||||
* Descr:
|
||||
*/
|
||||
void
|
||||
BVolumeRoster_Rewind(BVolumeRoster *VolumeRoster)
|
||||
{
|
||||
VolumeRoster->Rewind();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Method: BVolumeRoster::GetBootVolume()
|
||||
* Descr:
|
||||
*/
|
||||
status_t
|
||||
BVolumeRoster_GetBootVolume(BVolumeRoster *VolumeRoster, BVolume *vol)
|
||||
{
|
||||
return VolumeRoster->GetBootVolume(vol);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Method: BVolumeRoster::StartWatching()
|
||||
* Descr:
|
||||
*/
|
||||
status_t
|
||||
BVolumeRoster_StartWatching(BVolumeRoster *VolumeRoster, BMessenger msngr)
|
||||
{
|
||||
return VolumeRoster->StartWatching(msngr);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Method: BVolumeRoster::StopWatching()
|
||||
* Descr:
|
||||
*/
|
||||
void
|
||||
BVolumeRoster_StopWatching(BVolumeRoster *VolumeRoster, void)
|
||||
{
|
||||
VolumeRoster->StopWatching();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Method: BVolumeRoster::Messenger()
|
||||
* Descr:
|
||||
*/
|
||||
BMessenger
|
||||
BVolumeRoster_Messenger(BVolumeRoster *VolumeRoster, void)
|
||||
{
|
||||
return VolumeRoster->Messenger();
|
||||
}
|
||||
|
||||
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _VOLUMEROSTER_CPP_ */
|
||||
|
||||
95
bepascal/bepascal/be/storage/VolumeRoster.pp
Normal file
95
bepascal/bepascal/be/storage/VolumeRoster.pp
Normal file
@@ -0,0 +1,95 @@
|
||||
{ BePascal - A pascal wrapper around the BeOS API
|
||||
Copyright (C) 2002 Eric Jourde
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
}
|
||||
|
||||
unit volumeroster;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
beobj, SupportDefs, os , Volume;
|
||||
|
||||
type
|
||||
TVolumeRoster = class(TBeObject)
|
||||
private
|
||||
public
|
||||
constructor Create; override;
|
||||
destructor Destroy; override;
|
||||
|
||||
function GetNextVolume(val : TVolume): Tstatus_t;
|
||||
procedure Rewind;
|
||||
function GetBootVolume( vol: TVolume ):Tstatus_t;
|
||||
//function StartWatching( msngr : TMessenger): Tstatus_t;
|
||||
procedure StopWatching;
|
||||
end;
|
||||
|
||||
|
||||
function BVolumeRoster_Create(AObject : TBeObject): TCPlusObject;cdecl; external BePascalLibName name 'BVolumeRoster_Create';
|
||||
procedure BVolumeRoster_Free(AObject : TCPlusObject);cdecl; external BePascalLibName name 'BVolumeRoster_Free';
|
||||
|
||||
function BVolumeRoster_GetNextVolume(AObject : TCPlusObject;vol : TCPlusObject): Tstatus_t;cdecl; external BePascalLibName name 'BVolumeRoster_GetNextVolume';
|
||||
procedure BVolumeRoster_Rewind(AObject : TCPlusObject);cdecl; external BePascalLibName name 'BVolumeRoster_Rewind';
|
||||
function BVolumeRoster_GetBootVolume(AObject : TCPlusObject; vol: TCPlusObject ):Tstatus_t;cdecl; external BePascalLibName name 'BVolumeRoster_GetBootVolume';
|
||||
//function BVolumeRoster_StartWatching(AObject : TCPlusObject; msngr : TMessenger): Tstatus_t;cdecl; external BePascalLibName name 'BVolumeRoster_StartWatching';
|
||||
procedure BVolumeRoster_StopWatching(AObject : TCPlusObject);cdecl; external BePascalLibName name 'BVolumeRoster_StopWatching';
|
||||
|
||||
|
||||
|
||||
|
||||
implementation
|
||||
|
||||
|
||||
constructor TVolumeRoster.Create;
|
||||
begin
|
||||
inherited;
|
||||
CPlusObject := BVolumeRoster_Create(Self);
|
||||
end;
|
||||
|
||||
destructor TVolumeRoster.Destroy;
|
||||
begin
|
||||
if CPlusObject <> nil then
|
||||
BVolumeRoster_Free(CPlusObject);
|
||||
inherited;
|
||||
|
||||
end;
|
||||
|
||||
function TVolumeRoster.GetNextVolume(val : TVolume): Tstatus_t;
|
||||
begin
|
||||
result:=BVolumeRoster_GetNextVolume(CPlusObject,val.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure TVolumeRoster.Rewind;
|
||||
begin
|
||||
BVolumeRoster_Rewind(CPlusObject);
|
||||
end;
|
||||
|
||||
function TVolumeRoster.GetBootVolume( vol: TVolume ):Tstatus_t;
|
||||
begin
|
||||
result:=BVolumeRoster_GetBootVolume(CPlusObject,vol.CPlusObject);
|
||||
end;
|
||||
|
||||
//function TVolumeRoster.StartWatching( msngr : TMessenger): Tstatus_t;
|
||||
//begin
|
||||
// result:=BVolumeRoster_StartWatching(CPlusObject,msngr);
|
||||
//end;
|
||||
|
||||
procedure TVolumeRoster.StopWatching;
|
||||
begin
|
||||
BVolumeRoster_StopWatching(CPlusObject);
|
||||
end;
|
||||
|
||||
end.
|
||||
Binary file not shown.
Reference in New Issue
Block a user