mirror of
https://github.com/XRPLF/rippled.git
synced 2026-07-23 23:20:33 +00:00
This change updates the ColumnLimit from 80 to 120, and applies clang-format to reformat the code.
35 lines
560 B
C++
35 lines
560 B
C++
#include <xrpl/protocol/Book.h>
|
|
#include <xrpl/protocol/Issue.h>
|
|
|
|
#include <ostream>
|
|
#include <string>
|
|
|
|
namespace xrpl {
|
|
|
|
bool
|
|
isConsistent(Book const& book)
|
|
{
|
|
return isConsistent(book.in) && isConsistent(book.out) && book.in != book.out;
|
|
}
|
|
|
|
std::string
|
|
to_string(Book const& book)
|
|
{
|
|
return to_string(book.in) + "->" + to_string(book.out);
|
|
}
|
|
|
|
std::ostream&
|
|
operator<<(std::ostream& os, Book const& x)
|
|
{
|
|
os << to_string(x);
|
|
return os;
|
|
}
|
|
|
|
Book
|
|
reversed(Book const& book)
|
|
{
|
|
return Book(book.out, book.in, book.domain);
|
|
}
|
|
|
|
} // namespace xrpl
|