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
|
typedef BOOST_DEDUCED_TYPENAME
|
||||||
expectations_type::const_iterator expectations_cit;
|
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::string context() const
|
||||||
{
|
{
|
||||||
std::stringstream s;
|
std::stringstream s;
|
||||||
s << parent_->tag() << name_;
|
serialize( s, "" );
|
||||||
serialize( s );
|
|
||||||
return s.str();
|
return s.str();
|
||||||
}
|
}
|
||||||
std::string context( const std::string& parameters ) const
|
std::string context( const std::string& parameters ) const
|
||||||
{
|
{
|
||||||
std::stringstream s;
|
std::stringstream s;
|
||||||
s << name_;
|
|
||||||
if( parameters.empty() )
|
if( parameters.empty() )
|
||||||
s << "()";
|
serialize( s, "()" );
|
||||||
else
|
else
|
||||||
s << "( " << parameters << " )";
|
serialize( s, "( " + parameters + " )" );
|
||||||
serialize( s );
|
|
||||||
return s.str();
|
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_;
|
std::string name_;
|
||||||
node* parent_;
|
node* parent_;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue