31 #include <boost/tokenizer.hpp>
33 #include "WStringUtils.h"
35 #include "exceptions/WPropertyUnknown.h"
36 #include "exceptions/WPropertyNotUnique.h"
38 #include "WPropertyHelper.h"
40 #include "WPropertyGroupBase.h"
79 return ( prop1->getName() == prop2->getName() );
84 boost::shared_ptr< WPropertyBase > result = boost::shared_ptr< WPropertyBase >();
90 for( PropertyContainerType::const_iterator it = l->get().begin(); it != l->get().end(); ++it )
92 if( ( *it )->getName() == name )
105 boost::shared_ptr< WPropertyBase > result = boost::shared_ptr< WPropertyBase >();
108 typedef boost::tokenizer<boost::char_separator< char > > tokenizer;
109 boost::char_separator< char > sep(
"/" );
110 tokenizer tok( name, sep );
114 for( tokenizer::iterator it = tok.begin(); it != tok.end(); ++it )
120 return boost::shared_ptr< WPropertyBase >();
128 return boost::shared_ptr< WPropertyBase >();
142 return (
findProperty( name ) != boost::shared_ptr< WPropertyBase >() );
147 boost::shared_ptr< WPropertyBase > p =
findProperty( name );
148 if( p == boost::shared_ptr< WPropertyBase >() )
150 throw WPropertyUnknown( std::string(
"Property \"" + name +
"\" can't be found." ) );
164 if( std::count_if( l->get().begin(), l->get().end(),
173 throw WPropertyNotUnique( std::string(
"Property \"" + prop->getName() +
"\" is not unique in this group (\"" +
getName() +
"\")." ) );
177 throw WPropertyNotUnique( std::string(
"Property \"" + prop->getName() +
"\" is not unique in this group (unnamed root)." ) );
184 prop->setPurpose( PV_PURPOSE_INFORMATION );
188 l->get().push_back( prop );