/home/kkrizka/Projects/libmidi/src/types.cpp File Reference

#include "types.h"
#include <math.h>
#include <iostream>
#include <iomanip>
Include dependency graph for types.cpp:

Go to the source code of this file.

Functions

unsigned int char2num (char c)
 Converts a char into an unsigned integer.
char num2char (unsigned int i)
 Converts a an unsigned number into a character.
dword byte2dword (byte array[])
 Concatonates (bitwise) 4 byte-long variables into 1 variable.
bytedword2byte (dword var)
 Concatonates 1 variable into 4 byte-long variables.
word byte2word (byte array[])
 Concatonates (bitwise) 2 byte-long variables into 1 variable.
byteword2byte (word var)
 Concatonates 1 variable into 2 byte-long variables.

Function Documentation

dword byte2dword ( byte  array[]  ) 

Concatonates (bitwise) 4 byte-long variables into 1 variable.

Parameters:
array Array of length 4
Returns:
Concatonated array

Definition at line 46 of file types.cpp.

word byte2word ( byte  array[]  ) 

Concatonates (bitwise) 2 byte-long variables into 1 variable.

Parameters:
array Array of length 2
Returns:
Concatonated array

Definition at line 69 of file types.cpp.

unsigned int char2num ( char  c  ) 

Converts a char into an unsigned integer.

Parameters:
c Input character
Returns:
c as an unsigned number. Range is 0 to 255

Definition at line 31 of file types.cpp.

byte* dword2byte ( dword  var  ) 

Concatonates 1 variable into 4 byte-long variables.

Parameters:
var Some variable
Returns:
Array of bytes that var was split into

Definition at line 58 of file types.cpp.

char num2char ( unsigned int  i  ) 

Converts a an unsigned number into a character.

Parameters:
i Input number, must be in range 0 to 255
Returns:
Character c represented by code c

Definition at line 38 of file types.cpp.

byte* word2byte ( word  var  ) 

Concatonates 1 variable into 2 byte-long variables.

Parameters:
var Some variable
Returns:
Array of bytes that var was split into

Definition at line 81 of file types.cpp.

 All Classes Namespaces Files Functions Typedefs Enumerations Enumerator Defines

Generated on Tue Jan 5 16:09:42 2010 for libmidi by  doxygen 1.6.1