further implementing
This commit is contained in:
@@ -23,7 +23,8 @@
|
||||
#ifndef GUID_HEADER
|
||||
#define GUID_HEADER
|
||||
|
||||
#include <istream>
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "U8.h"
|
||||
@@ -62,6 +63,12 @@ struct GUID
|
||||
_C8.read(cont);
|
||||
}
|
||||
|
||||
std::string toString()const{
|
||||
std::stringstream strm;
|
||||
strm << "{" << std::hex << _A1 << "-" << _B1 << _B2 << "-" << _C1 << _C2 << _C3 << _C4 << _C5 << _C6 << _C7 << _C8 << "}";
|
||||
return strm.str();
|
||||
}
|
||||
|
||||
U32 _A1;
|
||||
|
||||
U16 _B1;
|
||||
|
||||
@@ -30,7 +30,7 @@ void JtReader::setFile(const std::string fileName)
|
||||
this->_fileName = fileName;
|
||||
}
|
||||
|
||||
void JtReader::readToc()
|
||||
const std::vector<TOC_Entry>& JtReader::readToc()
|
||||
{
|
||||
ifstream strm;
|
||||
|
||||
@@ -56,11 +56,11 @@ void JtReader::readToc()
|
||||
|
||||
I32 Entry_Count(cont);
|
||||
|
||||
vector<TOC_Entry> TocEntries(Entry_Count);
|
||||
|
||||
|
||||
|
||||
TocEntries.resize(Entry_Count);
|
||||
|
||||
for (std::vector<TOC_Entry>::iterator i = TocEntries.begin(); i != TocEntries.end(); ++i)
|
||||
i->read(cont);
|
||||
|
||||
return TocEntries;
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include "TOC_Entry.h"
|
||||
|
||||
|
||||
class JtReader
|
||||
@@ -11,11 +13,16 @@ public:
|
||||
|
||||
void setFile(const std::string fileName);
|
||||
|
||||
void readToc();
|
||||
const std::vector<TOC_Entry>& readToc();
|
||||
|
||||
void readSegment(int tocIndex);
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
std::string _fileName;
|
||||
vector<TOC_Entry> TocEntries;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -54,6 +54,18 @@ struct TOC_Entry
|
||||
Segment_Attributes.read(cont);
|
||||
};
|
||||
|
||||
uint8_t getSegmentType()const
|
||||
{
|
||||
return Segment_Attributes << 24;
|
||||
}
|
||||
|
||||
std::string toString()const{
|
||||
stringstream strm;
|
||||
strm << getSegmentType() << ":" << Segment_Offset << ":" << Segment_Length << ":" << Segment_ID.toString();
|
||||
|
||||
return strm.str();
|
||||
}
|
||||
|
||||
GUID Segment_ID;
|
||||
I32 Segment_Offset;
|
||||
I32 Segment_Length;
|
||||
|
||||
Reference in New Issue
Block a user