mirror of
https://github.com/mat007/turtle.git
synced 2026-06-22 12:13:43 +00:00
Refactoring
git-svn-id: https://svn.code.sf.net/p/turtle/code/trunk@140 860be788-9bd5-4423-9f1e-828f051e677b
This commit is contained in:
parent
f6f80d4192
commit
a2cf4dbb02
1 changed files with 11 additions and 13 deletions
|
|
@ -267,31 +267,29 @@ namespace mock
|
|||
typedef BOOST_DEDUCED_TYPENAME
|
||||
expectations_type::const_iterator expectations_cit;
|
||||
|
||||
void serialize( std::ostream& s ) const
|
||||
{
|
||||
for( expectations_cit it = expectations_.begin();
|
||||
it != expectations_.end(); ++it )
|
||||
s << std::endl << *it;
|
||||
}
|
||||
|
||||
std::string context() const
|
||||
{
|
||||
std::stringstream s;
|
||||
s << parent_->tag() << name_;
|
||||
serialize( s );
|
||||
serialize( s, "" );
|
||||
return s.str();
|
||||
}
|
||||
std::string context( const std::string& parameters ) const
|
||||
{
|
||||
std::stringstream s;
|
||||
s << name_;
|
||||
if( parameters.empty() )
|
||||
s << "()";
|
||||
serialize( s, "()" );
|
||||
else
|
||||
s << "( " << parameters << " )";
|
||||
serialize( s );
|
||||
serialize( s, "( " + parameters + " )" );
|
||||
return s.str();
|
||||
}
|
||||
void serialize( std::ostream& s,
|
||||
const std::string& parameters ) const
|
||||
{
|
||||
s << parent_->tag() << name_ << parameters;
|
||||
for( expectations_cit it = expectations_.begin();
|
||||
it != expectations_.end(); ++it )
|
||||
s << std::endl << *it;
|
||||
}
|
||||
|
||||
std::string name_;
|
||||
node* parent_;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue