29 #include "../common/WException.h"
30 #include "../common/WLogger.h"
31 #include "../common/WStructuredTextParser.h"
34 #include "WModuleMetaInformation.h"
44 m_name( module->getName() ),
45 m_description( module->getDescription() ),
47 m_localPath( module->getLocalPath() )
50 boost::filesystem::path metafile = module->getLocalPath() /
"META";
51 if( !boost::filesystem::exists( metafile ) )
65 wlog::error(
"Module (" +
m_name +
")" ) <<
"Meta file loaded but no entry for module \"" <<
m_name <<
"\" found. Ignoring.";
89 return boost::filesystem::path();
137 return boost::filesystem::path();
146 std::vector< WModuleMetaInformation::Author > r;
161 if( authors.empty() )
169 r.resize( authors.size() );
170 for( std::vector< std::string >::const_iterator i = authors.begin(); i != authors.end(); ++i )
172 r[ i - authors.begin() ].m_name = *i;
183 std::vector< WModuleMetaInformation::Online > r;
191 typedef std::vector< WStructuredTextParser::StructuredValueTree > TreeList;
193 for( TreeList::const_iterator i = onlineInfos.begin(); i != onlineInfos.end(); ++i )
200 o.
m_name = ( *i ).getValue< std::string >(
"name",
"" );
201 o.
m_url = ( *i ).getValue< std::string >(
"url",
"" );
208 o.
m_description = ( *i ).getValue< std::string >(
"description",
"" );
222 return std::vector< std::string >();
231 std::vector< WModuleMetaInformation::Screenshot > r;
239 typedef std::vector< WStructuredTextParser::StructuredValueTree > TreeList;
241 for( TreeList::const_iterator i = screenshotInfos.begin(); i != screenshotInfos.end(); ++i )
248 s.
m_filename = ( *i ).getValue< boost::filesystem::path >(
"filename",
"" );
255 s.
m_description = ( *i ).getValue< std::string >(
"description",
"" );