My Project
Classes | Functions
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::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 
)

◆ parseBoard()

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

盤面を取得する.

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

Parameters
boardUSIの文字列
stateboardの解析結果が出力される

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)

◆ show() [2/4]

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

Definition at line 145 of file usi.cc.

References osl::Move::isNormal(), and osl::Move::isPass().

Referenced by osl::record::CsaFile::makeInfo().

◆ show() [3/4]

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

Definition at line 172 of file usi.cc.

References osl::Piece::ptypeO().

◆ show() [4/4]

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

◆ strToMove()

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

Definition at line 225 of file usi.cc.

References osl::SimpleState::turn().

Referenced by osl::record::CsaFile::makeInfo().

◆ unescape()

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

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

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

Definition at line 19 of file usiRecord.cc.