main
Line | |
---|
1 | /* CrO2 datassette emulator
|
---|
2 | * Copyright 2012, Adrien Destugues <pulkomandy@pulkomandy.ath.cx>
|
---|
3 | *
|
---|
4 | * Distributed under the terms of the MIT licence.
|
---|
5 | */
|
---|
6 | #pragma once
|
---|
7 |
|
---|
8 | #include <stdint.h>
|
---|
9 | #include <string>
|
---|
10 | #include <vector>
|
---|
11 |
|
---|
12 | class Tape {
|
---|
13 | public:
|
---|
14 | class Block {
|
---|
15 | public:
|
---|
16 | Block(int length);
|
---|
17 | Block(const Block& other);
|
---|
18 | virtual ~Block();
|
---|
19 | const Block& operator=(const Block& other);
|
---|
20 |
|
---|
21 | virtual bool isFile() const = 0;
|
---|
22 | // Does this block mark the start of a file ?
|
---|
23 | virtual bool isControl() const = 0;
|
---|
24 | // Is this block a control (sync, eof, ...) or data block ?
|
---|
25 | virtual const std::string getName() const = 0;
|
---|
26 |
|
---|
27 | int length;
|
---|
28 | uint8_t* data;
|
---|
29 | private:
|
---|
30 | Block() = delete;
|
---|
31 | };
|
---|
32 |
|
---|
33 | virtual ~Tape();
|
---|
34 |
|
---|
35 | static Tape* load(const char* filename) throw (const char*);
|
---|
36 |
|
---|
37 | int getBlockCount() const;
|
---|
38 | Block& getBlock(int number);
|
---|
39 | const Block& getBlock(int number) const;
|
---|
40 | protected:
|
---|
41 | Tape() {};
|
---|
42 | std::vector<Block*> blocks;
|
---|
43 | };
|
---|
Note:
See
TracBrowser
for help on using the repository browser.