Move code from devices.hpp and iso9660.hpp headers into external files -

cdio.cpp, device.cpp, iso9660.cpp

configure.ac, C++/OO/Makefile.am: Found some bugs libraries acces in doing the
above move.
This commit is contained in:
rocky
2006-03-07 10:46:36 +00:00
parent 577774dd7b
commit 67d4aa6fe9
10 changed files with 682 additions and 436 deletions

View File

@@ -1,5 +1,5 @@
/* -*- C++ -*-
$Id: devices.hpp,v 1.3 2006/01/25 07:21:52 rocky Exp $
$Id: devices.hpp,v 1.4 2006/03/07 10:46:36 rocky Exp $
Copyright (C) 2005, 2006 Rocky Bernstein <rocky@panix.com>
@@ -32,12 +32,8 @@
@param driver_id is the driver to be used or that got used if
it was DRIVER_UNKNOWN or DRIVER_DEVICE; If this is NULL, we won't
report back the driver used.
v*/
void closeTray (const char *psz_drive, /*in/out*/ driver_id_t &driver_id)
{
driver_return_code_t drc = cdio_close_tray (psz_drive, &driver_id);
possible_throw_device_exception(drc);
}
*/
void closeTray (const char *psz_drive, /*in/out*/ driver_id_t &driver_id);
/*!
Close media tray in CD drive if there is a routine to do so.
@@ -45,11 +41,7 @@ void closeTray (const char *psz_drive, /*in/out*/ driver_id_t &driver_id)
@param psz_drive the name of CD-ROM to be closed. If omitted or
NULL, we'll scan for a suitable CD-ROM.
*/
void closeTray (const char *psz_drive=(const char *)NULL)
{
driver_id_t driver_id = DRIVER_UNKNOWN;
closeTray(psz_drive, driver_id);
}
void closeTray (const char *psz_drive=(const char *)NULL);
/*!
Get a string decribing driver_id.
@@ -57,23 +49,14 @@ void closeTray (const char *psz_drive=(const char *)NULL)
@param driver_id the driver you want the description for
@return a sring of driver description
*/
const char *
driverDescribe (driver_id_t driver_id)
{
return cdio_driver_describe(driver_id);
}
const char *driverDescribe (driver_id_t driver_id);
/*!
Eject media in CD drive if there is a routine to do so.
If the CD is ejected, object is destroyed.
*/
void
ejectMedia (const char *psz_drive)
{
driver_return_code_t drc = cdio_eject_media_drive(psz_drive);
possible_throw_device_exception(drc);
}
void ejectMedia (const char *psz_drive);
/*!
Free device list returned by GetDevices
@@ -83,11 +66,7 @@ ejectMedia (const char *psz_drive)
@see GetDevices
*/
void
freeDeviceList (char * device_list[])
{
cdio_free_device_list(device_list);
}
void freeDeviceList (char * device_list[]);
/*!
Return a string containing the default CD device if none is specified.
@@ -96,11 +75,7 @@ freeDeviceList (char * device_list[])
NULL is returned if we couldn't get a default device.
*/
char *
getDefaultDevice(/*in/out*/ driver_id_t &driver_id)
{
return cdio_get_default_device_driver(&driver_id);
}
char * getDefaultDevice(/*in/out*/ driver_id_t &driver_id);
/*! Return an array of device names. If you want a specific
devices for a driver, give that device. If you want hardware
@@ -113,11 +88,7 @@ getDefaultDevice(/*in/out*/ driver_id_t &driver_id)
there is no media in it and it is possible for this routine to return
NULL even though there may be a hardware CD-ROM.
*/
char **
getDevices(driver_id_t driver_id=DRIVER_DEVICE)
{
return cdio_get_devices(driver_id);
}
char ** getDevices(driver_id_t driver_id=DRIVER_DEVICE);
/*! Like GetDevices above, but we may change the p_driver_id if we
were given DRIVER_DEVICE or DRIVER_UNKNOWN. This is because
@@ -126,11 +97,7 @@ getDevices(driver_id_t driver_id=DRIVER_DEVICE)
things up for libcdio as well.
*/
char **
getDevices (driver_id_t &driver_id)
{
return cdio_get_devices_ret(&driver_id);
}
char **getDevices (driver_id_t &driver_id);
/*!
Get an array of device names in search_devices that have at least
@@ -149,12 +116,8 @@ getDevices (driver_id_t &driver_id)
after dereferencing the the value is NULL. This also means nothing
was found.
*/
char **
getDevices(/*in*/ char *ppsz_search_devices[],
cdio_fs_anal_t capabilities, bool b_any=false)
{
return cdio_get_devices_with_cap(ppsz_search_devices, capabilities, b_any);
}
char ** getDevices(/*in*/ char *ppsz_search_devices[],
cdio_fs_anal_t capabilities, bool b_any=false);
/*!
Like GetDevices above but we return the driver we found
@@ -162,21 +125,12 @@ getDevices(/*in*/ char *ppsz_search_devices[],
and then *open* it afterwards. Giving the driver back facilitates this,
and speeds things up for libcdio as well.
*/
char **
getDevices(/*in*/ char* ppsz_search_devices[],
cdio_fs_anal_t capabilities, /*out*/ driver_id_t &driver_id,
bool b_any=false)
{
return cdio_get_devices_with_cap_ret(ppsz_search_devices, capabilities,
b_any, &driver_id);
}
char ** getDevices(/*in*/ char* ppsz_search_devices[],
cdio_fs_anal_t capabilities, /*out*/ driver_id_t &driver_id,
bool b_any=false);
/*! Like cdio_have_xxx but uses an enumeration instead. */
bool
haveDriver (driver_id_t driver_id)
{
return cdio_have_driver(driver_id);
}
/*! Return true if we Have driver for driver_id */
bool haveDriver (driver_id_t driver_id);
/*!
@@ -186,11 +140,8 @@ Determine if bin_name is the bin file part of a CDRWIN CD disk image.
@return the corresponding CUE file if bin_name is a BIN file or
NULL if not a BIN file.
*/
char *
isBinFile(const char *bin_name)
{
return cdio_is_binfile(bin_name);
}
char *isBinFile(const char *psz_bin_name);
/*!
Determine if cue_name is the cue sheet for a CDRWIN CD disk image.
@@ -198,37 +149,7 @@ isBinFile(const char *bin_name)
@return corresponding BIN file if cue_name is a CDRWIN cue file or
NULL if not a CUE file.
*/
char *
isCueFile(const char *cue_name)
{
return cdio_is_cuefile(cue_name);
}
/*!
Determine if psg_nrg is a Nero CD disk image.
@param psz_nrg location of presumed NRG image file.
@return true if psz_nrg is a Nero NRG image or false
if not a NRG image.
*/
bool
isNero(const char *psz_nrg)
{
return cdio_is_nrg(psz_nrg);
}
/*!
Determine if psg_toc is a TOC file for a cdrdao CD disk image.
@param psz_toc location of presumed TOC image file.
@return true if toc_name is a cdrdao TOC file or false
if not a TOC file.
*/
bool
isTocFile(const char *psz_toc)
{
return cdio_is_tocfile(psz_toc);
}
char *isCueFile(const char *psz_cue_name);
/*!
Determine if psz_source refers to a real hardware CD-ROM.
@@ -239,8 +160,23 @@ isTocFile(const char *psz_toc)
@return true if psz_source is a device; If false is returned we
could have a CD disk image.
*/
bool
isDevice(const char *psz_source, driver_id_t driver_id)
{
return cdio_is_device(psz_source, driver_id);
}
bool isDevice(const char *psz_source, driver_id_t driver_id);
/*!
Determine if psz_nrg is a Nero CD disk image.
@param psz_nrg location of presumed NRG image file.
@return true if psz_nrg is a Nero NRG image or false
if not a NRG image.
*/
bool isNero(const char *psz_nrg);
/*!
Determine if psz_toc is a TOC file for a cdrdao CD disk image.
@param psz_toc location of presumed TOC image file.
@return true if toc_name is a cdrdao TOC file or false
if not a TOC file.
*/
bool isTocFile(const char *psz_toc);