Implemented construction of SAS and PDDL Descriptions from Parser object.
This commit is contained in:
@@ -31,6 +31,20 @@ Description::Description()
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Description Description::fromParser(utils::Parser &&parser)
|
||||
{
|
||||
Description description;
|
||||
|
||||
description.m_parser = std::move(parser);
|
||||
|
||||
description.parseContent();
|
||||
description.checkConsistency();
|
||||
|
||||
return description;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Description Description::fromStream(std::istream &istream)
|
||||
{
|
||||
Description description;
|
||||
|
@@ -28,6 +28,16 @@ Description::Description()
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Description Description::fromParser(utils::Parser &&parser)
|
||||
{
|
||||
Description description;
|
||||
description.parseContent(parser);
|
||||
|
||||
return description;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Description Description::fromStream(std::istream &istream)
|
||||
{
|
||||
utils::Parser parser;
|
||||
|
@@ -41,6 +41,29 @@ Parser::Parser(std::string streamName, std::istream &istream)
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Parser::Parser(Parser &&other)
|
||||
: m_stream{std::move(other.m_stream)},
|
||||
m_streamDelimiters{std::move(other.m_streamDelimiters)},
|
||||
m_isCaseSensitive{other.m_isCaseSensitive}
|
||||
{
|
||||
other.m_isCaseSensitive = true;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Parser &Parser::operator=(Parser &&other)
|
||||
{
|
||||
m_stream = std::move(other.m_stream);
|
||||
m_streamDelimiters = std::move(other.m_streamDelimiters);
|
||||
m_isCaseSensitive = other.m_isCaseSensitive;
|
||||
|
||||
other.m_isCaseSensitive = true;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void Parser::readStream(std::string streamName, std::istream &istream)
|
||||
{
|
||||
// Store position of new section
|
||||
|
Reference in New Issue
Block a user