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 37 38 39 40 41 42 43 44 45 46 47
|
/* pvFile.h
*/
#ifndef GPSSHOGI_PVFILE_H
#define GPSSHOGI_PVFILE_H
#include "pvVector.h"
#include "osl/container.h"
#include <zlib.h>
namespace gpsshogi
{
using namespace osl;
/**
* file := [record-id, position-id, pv*, MOVE_INVALID]*
* pv := MOVE+ MOVE_INVALID
*/
class PVFileWriter
{
gzFile fp;
int written;
public:
PVFileWriter(const char *filename);
~PVFileWriter();
void newPosition(int record, int position);
void addPv(const PVVector&);
};
class PVFileReader
{
gzFile fp;
public:
PVFileReader(const char *filename);
~PVFileReader();
bool newPosition(int& record, int& position);
bool readPv(PVVector&);
static int countPosition(const char *filename);
static void count(const char *filename, int& position, int& pv);
};
}
#endif /* _PVFILE_H */
// ;;; Local Variables:
// ;;; mode:c++
// ;;; c-basic-offset:2
// ;;; End:
|