changed: ModelData moved outside Model

added:   using ModelData in BaseExpression so Model::to_text() functions can use a ModelData object now





git-svn-id: svn://ttmath.org/publicrep/morm/trunk@1175 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
2019-03-07 18:02:29 +00:00
parent 41684eb969
commit cf0a0c96fe
8 changed files with 188 additions and 48 deletions

View File

@@ -129,8 +129,7 @@ bool Model::found()
}
void Model::to_text(PT::TextStream & stream, bool clear_stream)
void Model::to_text(PT::TextStream & stream, ModelData * model_data, bool clear_stream)
{
if( clear_stream )
{
@@ -145,7 +144,9 @@ void Model::to_text(PT::TextStream & stream, bool clear_stream)
if( flat_connector )
{
this->model_data = model_data;
flat_connector->to_text(stream, *this);
this->model_data = nullptr;
}
}
@@ -153,7 +154,20 @@ void Model::to_text(PT::TextStream & stream, bool clear_stream)
}
void Model::to_text(std::string & str, bool clear_string)
void Model::to_text(PT::TextStream & stream, ModelData & model_data, bool clear_stream)
{
to_text(stream, &model_data, clear_stream);
}
void Model::to_text(PT::TextStream & stream, bool clear_stream)
{
to_text(stream, nullptr, clear_stream);
}
void Model::to_text(std::string & str, ModelData * model_data, bool clear_string)
{
if( model_connector )
{
@@ -162,13 +176,25 @@ void Model::to_text(std::string & str, bool clear_string)
if( out_stream )
{
to_text(*out_stream, true);
to_text(*out_stream, model_data, true);
out_stream->to_string(str, clear_string);
}
}
}
void Model::to_text(std::string & str, ModelData & model_data, bool clear_string)
{
to_text(str, &model_data, clear_string);
}
void Model::to_text(std::string & str, bool clear_string)
{
to_text(str, nullptr, clear_string);
}
std::string Model::to_text()
{
std::string str;