CUETools.CTDB: split classes into separate files.

This commit is contained in:
karamanolev
2011-10-24 14:32:51 +00:00
parent ce79dd8641
commit 426f733d19
11 changed files with 306 additions and 250 deletions

47
CUETools.CTDB/ReadDB.cs Normal file
View File

@@ -0,0 +1,47 @@
using System.Text;
namespace CUETools.CTDB
{
class ReadDB
{
private byte[] contents;
public int pos;
public ReadDB(byte[] contents)
{
this.contents = contents;
this.pos = 0;
}
public string ReadHDR(out int end)
{
int size = this.ReadInt();
string res = Encoding.ASCII.GetString(contents, pos, 4);
this.pos += 4;
end = pos + size - 8;
return res;
}
public int ReadInt()
{
int value =
(this.contents[this.pos + 3] +
(this.contents[this.pos + 2] << 8) +
(this.contents[this.pos + 1] << 16) +
(this.contents[this.pos + 0] << 24));
this.pos += 4;
return value;
}
public uint ReadUInt()
{
uint value =
((uint)this.contents[this.pos + 3] +
((uint)this.contents[this.pos + 2] << 8) +
((uint)this.contents[this.pos + 1] << 16) +
((uint)this.contents[this.pos + 0] << 24));
this.pos += 4;
return value;
}
}
}