All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
kakinoki.h
Go to the documentation of this file.
1 /* kakinoki.h
2  */
3 #ifndef OSL_KAKINOKI_H
4 #define OSL_KAKINOKI_H
5 
6 #include "osl/record/record.h"
8 #include <boost/shared_ptr.hpp>
9 #include <string>
10 #include <iosfwd>
11 #include <stdexcept>
12 
13 namespace osl
14 {
15  namespace record
16  {
17  namespace kakinoki
18  {
19  Move strToMove(const std::string&, const SimpleState&,
20  Move last_move=Move());
21  std::pair<Player,Ptype> strToPiece(const std::string&);
22 
23  class InputStream : public IRecordStream
24  {
25  private:
26  std::istream& is;
27  SimpleState state;
28  boost::shared_ptr<RecordVisitor> rv;
29  public:
30  InputStream(std::istream& is);
31  InputStream(std::istream& is, boost::shared_ptr<RecordVisitor> rv);
32  virtual ~InputStream();
33 
34  virtual void load(Record*);
35  const SimpleState& getState() const { return state;}
36  };
37 
39  {
40  private:
42  public:
43  KakinokiFile(const std::string& filename);
44  ~KakinokiFile();
45 
46  Record const& getRecord() const;
47  const NumEffectState getInitialState() const;
48 
49  static bool isKakinokiFile(const std::string& filename);
50  };
51 
52  struct KakinokiIOError : public std::runtime_error
53  {
54  KakinokiIOError(const std::string& w) : std::runtime_error(w)
55  {
56  }
57  };
58  } // namespace kakinoki
59  }
60  using record::kakinoki::KakinokiFile;
61  using record::kakinoki::KakinokiIOError;
62 }
63 
64 #endif /* OSL_KAKINOKI_H */
65 // ;;; Local Variables:
66 // ;;; mode:c++
67 // ;;; c-basic-offset:2
68 // ;;; End: