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