File: packedstorage.h

package info (click to toggle)
vdr-plugin-osdteletext 0.9.7-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 684 kB
  • sloc: ansic: 9,963; makefile: 59; sh: 14
file content (36 lines) | stat: -rw-r--r-- 1,418 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/*************************************************************** -*- c++ -*-
 *       Copyright (c) 2003,2004 by Marcel Wiesweg                         *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

#ifndef __PACKEDSTORAGE_H
#define __PACKEDSTORAGE_H

#include "legacystorage.h"

class PackedStorage : public LegacyStorage {
public:
   PackedStorage(int maxMB);

   virtual void getFilename(char *buffer, int bufLength, PageID page);
   virtual StorageHandle openForWriting(PageID page);
   virtual StorageHandle openForReading(PageID page, bool countAsAccess);
protected:
   struct PageAddress {
      bool operator==(const PageID &id) const
        { return page==id.page && subPage==id.subPage; }
      void operator=(const PageID &id)
        { page=id.page; subPage=id.subPage; }
      int page;
      int subPage;
   };
   bool seekTo(PageID page, int fd, bool create);
   void registerFile(PageID page);
};

#endif