[linux-audio-dev] light C++ set for WAV
Erik de Castro Lopo
mle+la at mega-nerd.com
Wed Jul 26 11:52:27 UTC 2006
Taybin Rutkin wrote:
> I prefer the unix-y open_read(). I don't think method names should
> ever start with a capital, unless it's the ctor or dtor.
I'm actually tending towards openRead().
> I noticed that the constructor SndFile::SndFile (const char *path,
> int mode, SF_INFO *sfinfo)
> isn't declared in the class. Also, since this constructor can fail
> if sf_open() fails up, it should throw an exception. Maybe
> containing the results of sf_strerror().
>
> Something like
>
> SndFile::SndFile (const char *path, int mode, SF_INFO *sfinfo)
> {
> psf = sf_open (path, mode, sfinfo) ;
> if (!psf) {
> throw sf_error(psf);
> }
> }
Good tip, thanks.
Erik
--
+-----------------------------------------------------------+
Erik de Castro Lopo
+-----------------------------------------------------------+
"If you think C++ is not overly complicated, just what is a
protected abstract virtual base pure virtual private destructor
and when was the last time you needed one?" -- Tom Cargill
More information about the Linux-audio-dev
mailing list