Go to the documentation of this file.00001
00002
00003
00004
00005 #ifndef SG_GAMEWRITER_H
00006 #define SG_GAMEWRITER_H
00007
00008 #include <iosfwd>
00009 #include "SgProp.h"
00010
00011 class SgNode;
00012
00013
00014
00015
00016 class SgGameWriter
00017 {
00018 public:
00019 SgGameWriter(std::ostream& out);
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 void WriteGame(const SgNode& root, bool allProps, int fileFormat,
00031 int gameNumber, int defaultSize);
00032
00033 private:
00034 std::ostream& m_out;
00035
00036 int m_fileFormat;
00037
00038
00039 int m_numPropsOnLine;
00040
00041 void ConvertFormat(SgNode& root);
00042
00043 void HandleProps(const SgNode* node, int& boardSize) const;
00044
00045
00046 bool ShouldWriteProperty(const SgProp& prop);
00047
00048 void StartNewLine();
00049
00050 void WriteNode(const SgNode& node, bool allProps, int boardSize,
00051 SgPropPointFmt fmt);
00052
00053 void WriteSubtree(const SgNode& node, bool allProps, int boardSize,
00054 SgPropPointFmt fmt);
00055
00056
00057 SgGameWriter(const SgGameWriter&);
00058
00059
00060 SgGameWriter& operator=(const SgGameWriter&);
00061 };
00062
00063
00064
00065 #endif // SG_GAMEWRITER_H