osl::usi Namespace Reference

## Classes

class | ParseError
class | UsiFile

## Functions

const Move | strToMove (const std::string &, const NumEffectState &)
PtypeO | charToPtypeO (char)
const std::string | show (Move)
const std::string | show (PtypeO)
const std::string | show (Piece)
const std::string | show (const NumEffectState &)
void | parseBoard (const std::string &board, NumEffectState &)
| 盤面を取得する.
void | parse (const std::string &line, NumEffectState &)
| [sfen <sfenstring> | startpos ] moves <move1> ... <movei>
void | parse (const std::string &line, NumEffectState &initial, std::vector< Move > &moves)
NumEffectState | makeState (const std::string &line)
void | escape (std::string &str)
| URIやFile systemとして使えるように、文字をescape.
void | unescape (std::string &str)
| escapeされた文字を元に戻す.

## Function Documentation

## charToPtypeO()

osl::PtypeO osl::usi::charToPtypeO | ( | char | c | ) |

Definition at line 245 of file usi.cc.

References osl::BLACK, osl::psn::charToPtype(), osl::newPtypeO(), osl::PTYPE_EMPTY, and osl::WHITE.

Referenced by parse(), and parseBoard().

## escape()

void osl::usi::escape | ( | std::string & | str | ) |

URIやFile systemとして使えるように、文字をescape.

これはGPSShogiによる拡張であり、standardではない. @str str自体が修正される

Definition at line 11 of file usiRecord.cc.

## makeState()

osl::NumEffectState osl::usi::makeState | ( | const std::string & | line | ) |

Definition at line 312 of file usi.cc.

References parse().

## parse() [1/2]

void osl::usi::parse | ( | const std::string & | line,
|  | NumEffectState & | state )

[sfen <sfenstring> | startpos ] moves <move1> ... <movei>

Definition at line 301 of file usi.cc.

References osl::NumEffectState::copyFrom(), osl::NumEffectState::makeMove(), and parse().

Referenced by makeState(), parse(), and osl::usi::UsiFile::UsiFile().

## parse() [2/2]

void osl::usi::parse | ( | const std::string & | line,
|  | NumEffectState & | initial,
|  | std::vector< Move > & | moves )

Definition at line 318 of file usi.cc.

References osl::BLACK, charToPtypeO(), osl::getOwner(), osl::getPtype(), osl::HIRATE, osl::SimpleState::init(), osl::SimpleState::initPawnMask(), osl::Move::isNormal(), osl::SimpleState::isValidMove(), osl::NumEffectState::makeMove(), parseBoard(), osl::SimpleState::setPiece(), osl::SimpleState::setTurn(), osl::Square::STAND(), strToMove(), and osl::WHITE.

## parseBoard()

void osl::usi::parseBoard | ( | const std::string & | board,
|  | NumEffectState & | out )

盤面を取得する.

board文字列が不正なときは、ParseErrorがthrowされる.

Parameters

  board | USIの文字列
  state | boardの解析結果が出力される

Definition at line 255 of file usi.cc.

References osl::canPromote(), charToPtypeO(), osl::getOwner(), osl::getPtype(), osl::SimpleState::init(), osl::promote(), and osl::SimpleState::setPiece().

Referenced by parse().

## show() [1/4]

const std::string osl::usi::show | ( | const NumEffectState & | state | ) |

Definition at line 178 of file usi.cc.

References osl::SimpleState::countPiecesOnStand(), osl::HIRATE, osl::indexToPlayer(), osl::Piece::isEmpty(), osl::newPtypeO(), osl::PieceStand::order, osl::SimpleState::pieceOnBoard(), show(), osl::SimpleState::turn(), and osl::WHITE.

## show() [2/4]

const std::string osl::usi::show | ( | Move | m | ) |

Definition at line 145 of file usi.cc.

References osl::Move::DeclareWin(), osl::Move::isNormal(), osl::Move::isPass(), and osl::psn::show().

Referenced by osl::record::CsaFile::makeInfo(), show(), and show().

## show() [3/4]

const std::string osl::usi::show | ( | Piece | p | ) |

Definition at line 172 of file usi.cc.

References osl::Piece::ptypeO(), and show().

## show() [4/4]

const std::string osl::usi::show | ( | PtypeO | ptypeo | ) |

Definition at line 157 of file usi.cc.

References osl::getOwner(), osl::getPtype(), osl::isPiece(), osl::isPromoted(), osl::psn::show(), osl::unpromote(), and osl::WHITE.

## strToMove()

const osl::Move osl::usi::strToMove | ( | const std::string & | str,
|  | const NumEffectState & | s )

Definition at line 225 of file usi.cc.

References osl::Move::DeclareWin(), osl::Move::INVALID(), osl::Move::PASS(), osl::psn::strToMove(), and osl::SimpleState::turn().

Referenced by osl::record::CsaFile::makeInfo(), and parse().

## unescape()

void osl::usi::unescape | ( | std::string & | str | ) |

escapeされた文字を元に戻す.

これはGPSShogiによる拡張であり、standardではない. @str str自体が修正される

Definition at line 19 of file usiRecord.cc.