50template<AUDIOSAMPLETYPE Type,
class ValueType,
class SampleValueType = AudioSampleValue<Type,ValueType> >
64 std::vector<ValueType>
Data ;
73template<AUDIOSAMPLETYPE Type,
class ValueType,
class SampleValueType>
80 Data.push_back (readValue(io)) ;
85 for (
UWORD32 i = 0 ; i < n ; i++) {
86 Data[i] = readValue(io) ;
94 throw SteghideError (
_(
"an error occured while reading the audio data from the file \"%s\"."), io->
getName().c_str()) ;
100 throw SteghideError (
_(
"premature end of file \"%s\" while reading audio data."), io->
getName().c_str()) ;
106 throw SteghideError (
_(
"an error occured while reading the audio data from standard input.")) ;
112 throw SteghideError (
_(
"premature end of data from standard input while reading audio data.")) ;
119template<AUDIOSAMPLETYPE Type,
class ValueType,
class SampleValueType>
126 for (
UWORD32 i = 0 ; i < n ; i++) {
127 writeValue (io, Data[i]) ;
134 throw SteghideError (
_(
"an error occured while writing the audio data to the file \"%s\"."), io->
getName().c_str()) ;
140 throw SteghideError (
_(
"an error occured while writing the audio data to standard output.")) ;
147template<AUDIOSAMPLETYPE Type,
class ValueType,
class SampleValueType>
153template<AUDIOSAMPLETYPE Type,
class ValueType,
class SampleValueType>
157 return ((
SampleValue*)
new SampleValueType (Data[pos])) ;
160template<AUDIOSAMPLETYPE Type,
class ValueType,
class SampleValueType>
163 const SampleValueType* sample =
dynamic_cast<const SampleValueType*
> (s) ;
166 Data[pos] = sample->getValue() ;
implementation of the AudioData-Interface
Definition: AudioData.h:51
ValueType readValue(BinaryIO *io) const
Definition: AuData.h:29
void replaceSample(const SamplePos pos, const SampleValue *s)
Definition: AudioData.h:161
SampleValue * getSampleValue(const SamplePos pos) const
Definition: AudioData.h:154
AudioDataImpl(CvrStgFile *f)
Definition: AudioData.h:53
void write(BinaryIO *io, UWORD32 n=AudioData::NoLimit)
Definition: AudioData.h:120
void read(BinaryIO *io, UWORD32 n=AudioData::NoLimit)
Definition: AudioData.h:74
virtual ~AudioDataImpl(void)
Definition: AudioData.h:54
unsigned long getNumSamples(void) const
Definition: AudioData.h:148
std::vector< ValueType > Data
Definition: AudioData.h:64
CvrStgFile * TheCvrStgFile
Definition: AudioData.h:65
void writeValue(BinaryIO *io, ValueType v) const
interface definition for AudioData objects.
Definition: AudioData.h:37
virtual void read(BinaryIO *io, UWORD32 n=NoLimit)=0
static const UWORD32 NoLimit
constant that can be used as parameter to read and write to indicate that there is no limit
Definition: AudioData.h:40
virtual void write(BinaryIO *io, UWORD32 n=NoLimit)=0
provides methods for file i/o as needed by the rest of steghide
Definition: BinaryIO.h:33
bool eof(void) const
Definition: BinaryIO.cc:123
const std::string & getName(void) const
Definition: BinaryIO.h:53
TYPE getType(void)
Definition: error.cc:102
@ STDOUT_ERR
Definition: error.h:55
@ FILE_ERR
Definition: error.h:55
a cover-/stego-file
Definition: CvrStgFile.h:46
an object that can hold embedded data
Definition: CvrStgObject.h:40
the value of a sample in a CvrStgFile
Definition: SampleValue.h:61
Definition: SteghideError.h:28
UWORD32 SamplePos
Definition: common.h:67
unsigned long UWORD32
Definition: common.h:45
#define _(S)
Definition: common.h:78
#define myassert(expr)
Definition: common.h:89