Index   Main   Namespaces   Classes   Hierarchy   Annotated   Files   Compound   Global   Pages  

SgPropUtil Namespace Reference


Functions

SgPropPointFmt GetPointFmt (int gameNumber)
 Return point format for a given game.
string PointToSgfString (SgMove p, int boardSize, SgPropPointFmt fmt, int fileFormat=4)
 Convert point to SGF point string.
string EscapeSpecialCharacters (const string &s, bool escapeColon)
SgMove SgfStringToPoint (const std::string &s, int boardSize, SgPropPointFmt fmt)
 Convert SGF point string to point.


Function Documentation

SgPropPointFmt SgPropUtil::GetPointFmt ( int  gameNumber  ) 

Return point format for a given game.

Returns SG_PROPPOINTFMT_GO for unknown game numbers.

Definition at line 31 of file SgProp.cpp.

References SG_PROPPOINTFMT_GO, and SG_PROPPOINTFMT_HEX.

Referenced by SgGameReader::HandleProperties(), and SgGameWriter::WriteGame().

std::string SgPropUtil::PointToSgfString ( SgMove  p,
int  boardSize,
SgPropPointFmt  fmt,
int  fileFormat = 4 
)

Convert point to SGF point string.

Definition at line 43 of file SgProp.cpp.

References SgPointUtil::Col(), SgPointUtil::Row(), SG_ASSERT, SG_MAX_SIZE, SG_MIN_SIZE, SG_NULLMOVE, SG_PASS, SG_PROPPOINTFMT_GO, and SG_PROPPOINTFMT_HEX.

Referenced by SgPropMove::ToString(), SgPropTextList::ToString(), and SgPropPointList::ToString().

std::string SgPropUtil::EscapeSpecialCharacters ( const string &  s,
bool  escapeColon 
)

Definition at line 83 of file SgProp.cpp.

Referenced by SgPropTextList::ToString(), SgPropText::ToString(), and SgPropUnknown::ToString().

SgPoint SgPropUtil::SgfStringToPoint ( const std::string &  s,
int  boardSize,
SgPropPointFmt  fmt 
)

Convert SGF point string to point.

Returns:
The point or SG_PASS (only allowed if point format is SG_PROPPOINTFMT_GO) or SG_NULLMOVE, if s is not a valid point.

Definition at line 99 of file SgProp.cpp.

References SgUtil::InRange(), SgPointUtil::Pt(), SG_ASSERT, SG_MAX_SIZE, SG_MIN_SIZE, SG_NULLMOVE, SG_PASS, SG_PROPPOINTFMT_GO, and SG_PROPPOINTFMT_HEX.

Referenced by SgPropMove::FromString(), SgPropTextList::FromString(), and SgPropPointList::FromString().


17 Jun 2010 Doxygen 1.4.7