helper.h File Reference

#include <string.h>
#include <string>
#include <sstream>
#include "RIFF.h"

Go to the source code of this file.

Functions

template<class T>
std::string ToString (T o)
long Min (long A, long B)
long Abs (long val)
void SwapMemoryArea (void *pData, unsigned long AreaSize, uint WordSize)
 Swaps the order of the data words in the given memory area with a granularity given by WordSize.
void LoadString (RIFF::Chunk *ck, std::string &s)
 Load given info field (string).
void SaveString (uint32_t ChunkID, RIFF::Chunk *ck, RIFF::List *lstINFO, const std::string &s, const std::string &sDefault, bool bUseFixedLengthStrings, int size)
 Apply given INFO field to the respective chunk.


Function Documentation

long Abs ( long  val  )  [inline]

Definition at line 46 of file helper.h.

Referenced by gig::Sample::ReadAndLoop().

void LoadString ( RIFF::Chunk ck,
std::string &  s 
) [inline]

Load given info field (string).

Load info field string from given info chunk (ck) and save value to s.

Definition at line 111 of file helper.h.

References RIFF::Chunk::GetSize(), RIFF::Chunk::LoadChunkData(), and RIFF::Chunk::ReleaseChunkData().

Referenced by gig::Group::Group().

long Min ( long  A,
long  B 
) [inline]

Definition at line 42 of file helper.h.

Referenced by gig::Sample::ReadAndLoop().

void SaveString ( uint32_t  ChunkID,
RIFF::Chunk ck,
RIFF::List lstINFO,
const std::string &  s,
const std::string &  sDefault,
bool  bUseFixedLengthStrings,
int  size 
) [inline]

Apply given INFO field to the respective chunk.

Apply given info value string to given info chunk, which is a subchunk of INFO list chunk lstINFO. If the given chunk already exists, value s will be applied. Otherwise if it doesn't exist yet and either s or sDefault is not an empty string, such a chunk will be created and either s or sDefault will be applied (depending on which one is not an empty string, if both are not an empty string s will be preferred).

Parameters:
ChunkID - 32 bit RIFF chunk ID of INFO subchunk (only used in case ck is NULL)
ck - INFO (sub)chunk where string should be stored to
lstINFO - parent (INFO) RIFF list chunk
s - current value of info field
sDefault - default value
bUseFixedLengthStrings - should a specific string size be forced in the chunk?
size - wanted size of the INFO chunk. This is ignored if bUseFixedLengthStrings is false.

Definition at line 141 of file helper.h.

References RIFF::List::AddSubChunk(), RIFF::Chunk::LoadChunkData(), and RIFF::Chunk::Resize().

Referenced by gig::Group::UpdateChunks().

void SwapMemoryArea ( void *  pData,
unsigned long  AreaSize,
uint  WordSize 
) [inline]

Swaps the order of the data words in the given memory area with a granularity given by WordSize.

Parameters:
pData - pointer to the memory area to be swapped
AreaSize - size of the memory area to be swapped (in bytes)
WordSize - size of the data words (in bytes)

Definition at line 58 of file helper.h.

Referenced by gig::Sample::ReadAndLoop().

template<class T>
std::string ToString ( o  )  [inline]

Definition at line 36 of file helper.h.


Generated on Wed Dec 6 19:25:57 2006 for libgig by  doxygen 1.5.1