00001 /* kakinoki.h 00002 */ 00003 #ifndef OSL_KAKINOKI_H 00004 #define OSL_KAKINOKI_H 00005 00006 #include "osl/record/record.h" 00007 #include "osl/state/numEffectState.h" 00008 #include <boost/shared_ptr.hpp> 00009 #include <string> 00010 #include <iosfwd> 00011 #include <stdexcept> 00012 00013 namespace osl 00014 { 00015 namespace record 00016 { 00017 namespace kakinoki 00018 { 00019 Move strToMove(const std::string&, const SimpleState&, 00020 Move last_move=Move()); 00021 00022 class InputStream : public IRecordStream 00023 { 00024 private: 00025 std::istream& is; 00026 SimpleState state; 00027 boost::shared_ptr<RecordVisitor> rv; 00028 public: 00029 InputStream(std::istream& is); 00030 InputStream(std::istream& is, boost::shared_ptr<RecordVisitor> rv); 00031 virtual ~InputStream(); 00032 00033 virtual void load(Record*); 00034 const SimpleState& getState() const { return state;} 00035 }; 00036 00037 class KakinokiFile 00038 { 00039 private: 00040 Record rec; 00041 public: 00042 KakinokiFile(const std::string& filename); 00043 ~KakinokiFile(); 00044 00045 Record const& getRecord() const; 00046 const NumEffectState getInitialState() const; 00047 00048 static bool isKakinokiFile(const std::string& filename); 00049 }; 00050 00051 struct KakinokiIOError : public std::runtime_error 00052 { 00053 KakinokiIOError(const std::string& w) : std::runtime_error(w) 00054 { 00055 } 00056 }; 00057 } // namespace kakinoki 00058 } 00059 using record::kakinoki::KakinokiFile; 00060 using record::kakinoki::KakinokiIOError; 00061 } 00062 00063 #endif /* OSL_KAKINOKI_H */ 00064 // ;;; Local Variables: 00065 // ;;; mode:c++ 00066 // ;;; c-basic-offset:2 00067 // ;;; End: