source: thomson/elec/CrO2/software/Tape.h@ e017851

main
Last change on this file since e017851 was e017851, checked in by Adrien Destugues <pulkomandy@…>, 11 years ago

Port to Haiku. Untested.

git-svn-id: svn://localhost/thomson@28 85ae3b6b-dc8f-4344-a89d-598714f2e4e5

  • Property mode set to 100644
File size: 1.0 KB
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#ifndef __TAPE_H__
7#define __TAPE_H__
8
9#include <stdint.h>
10#include <string>
11#include <vector>
12
13class Tape {
14 public:
15 class Block {
16 public:
17 Block(int length);
18 Block(const Block& other);
19 virtual ~Block();
20 const Block& operator=(const Block& other);
21
22 virtual bool isFile() const = 0;
23 // Does this block mark the start of a file ?
24 virtual bool isControl() const = 0;
25 // Is this block a control (sync, eof, ...) or data block ?
26 virtual const std::string getName() const = 0;
27
28 int length;
29 uint8_t* data;
30 private:
31 Block() = delete;
32 };
33
34 virtual ~Tape();
35
36 static Tape* load(const char* filename) throw (const char*);
37
38 int getBlockCount() const;
39 Block& getBlock(int number);
40 const Block& getBlock(int number) const;
41 protected:
42 Tape() {};
43 std::vector<Block*> blocks;
44};
45
46#endif
47
Note: See TracBrowser for help on using the repository browser.