aboutsummaryrefslogtreecommitdiff
path: root/src/lib/convertlib.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/convertlib.h')
-rwxr-xr-xsrc/lib/convertlib.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/lib/convertlib.h b/src/lib/convertlib.h
new file mode 100755
index 0000000..3e742ff
--- /dev/null
+++ b/src/lib/convertlib.h
@@ -0,0 +1,39 @@
1#ifndef __convert_h__
2#define __convert_h__
3
4using namespace std;
5
6#include "config.h"
7#include <string>
8#include <iostream>
9
10class Convert
11{
12 public:
13 Convert() {};
14 ~Convert() {};
15
16 static bool isnibble(string x);
17 static long str2long(string hexstr);
18 static double str2dbl(string hexstr);
19 static long hex2long(string hexstr);
20 static string* byte2hex(unsigned char x);
21 static string* int2str(int x,unsigned int pad,string padchar);
22 static string* int2str(int x);
23 static string* int32tostr(__uint32 x);
24 static string* int64tostr(__sint64 x);
25 static string* int64tohex(__sint64 x);
26 static string* int32tohex(unsigned long x);
27 static string* readstring(unsigned char * orig,int offset,int len);
28 static string* padright(string & strinput,int inlen,string strpad);
29 static string* padleft(string & strinput,int inlen,string strpad);
30 static unsigned int getint32(unsigned char * buf,int loc);
31 static unsigned int getint24(unsigned char * buf,int loc);
32 static void setint32(unsigned char * buf,int loc,__uint32 newval);
33 static void setfloat80(unsigned char * buf, int loc, __uint32 newval); /* Only for use in AIFF files */
34 static unsigned char hex2byte(string hexstr);
35 static unsigned char safebyte(unsigned char x);
36 static string* trim(string* strinput);
37};
38
39#endif