29 #include "../kernel/WProjectFile.h"
31 #include "WProjectFileIO.h"
35 m_applyOrder( POST_MODULES )
83 std::string prefix,
unsigned int index, std::string indexPrefix )
88 output << indent <<
"// Property Group: " << props->getName() << std::endl;
94 if( ( *iter )->getPurpose() == PV_PURPOSE_INFORMATION )
98 if( ( *iter )->getType() != PV_GROUP )
100 output << indent +
" " <<
"PROPERTY:(" << indexPrefix << index <<
"," << prefix + ( *iter )->getName() <<
")="
101 << ( *iter )->getAsString() << std::endl;
108 printProperties( output, ( *iter )->toPropGroup(), indent +
" ", ( *iter )->getName() +
"/", index, indexPrefix );
112 printProperties( output, ( *iter )->toPropGroup(), indent +
" ", prefix + ( *iter )->getName() +
"/", index, indexPrefix );
117 output << indent <<
"// Property Group END: " << props->getName() << std::endl;
std::vector< std::string > m_errors
List of errors if any.
void setProject(WProjectFile *project)
Set the project using this parser.
std::vector< std::string > m_warnings
List of warnings if any.
WProjectFile * m_project
The project using this parser.
ApplyOrder getApplyOrder() const
Return the apply order of this IO.
bool hadWarnings() const
Checks whether there where warnings during load or save.
WProjectFileIO()
Default constructor.
virtual void done()
Called whenever the end of the project file has been reached.
const std::vector< std::string > & getErrors() const
Get error list.
bool hadErrors() const
Checks whether there where errors during load or save.
virtual ~WProjectFileIO()
Destructor.
ApplyOrder
When to apply this parser.
void setApplyOrder(ApplyOrder order)
Set the order of calls to "done".
WProjectFile * getProject() const
The project using this parser.
ApplyOrder m_applyOrder
The order in which the "done" functions are called.
void addError(std::string description)
Add an error.
void addWarning(std::string description)
Add an warning.
void printProperties(std::ostream &output, std::shared_ptr< WProperties > props, std::string indent, std::string prefix, unsigned int index, std::string indexPrefix="")
Recursively prints the properties and nested properties.
const std::vector< std::string > & getWarnings() const
Get warnings list.
Class loading project files.
WPropertyGroupBase::PropertyConstIterator PropertyConstIterator
The const iterator type of the container.
std::shared_ptr< WSharedObjectTicketRead< T > > ReadTicket
Type for read tickets.
WStreamedLogger warn(const std::string &source)
Logging a warning message.
WStreamedLogger error(const std::string &source)
Logging an error message.