mirror of
https://github.com/XRPLF/rippled.git
synced 2026-07-27 09:00:32 +00:00
Per XLS-0095, we are taking steps to rename ripple(d) to xrpl(d). This change specifically removes all copyright notices referencing Ripple, XRPLF, and certain affiliated contributors upon mutual agreement, so the notice in the LICENSE.md file applies throughout. Copyright notices referencing external contributions remain as-is. Duplicate verbiage is also removed.
36 lines
572 B
C++
36 lines
572 B
C++
#include <xrpl/protocol/Book.h>
|
|
#include <xrpl/protocol/Issue.h>
|
|
|
|
#include <ostream>
|
|
#include <string>
|
|
|
|
namespace ripple {
|
|
|
|
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 ripple
|