31 #include <boost/tokenizer.hpp>
32 #include <boost/algorithm/string/predicate.hpp>
34 #include "WStringUtils.h"
36 #include "exceptions/WPropertyUnknown.h"
37 #include "exceptions/WPropertyNotUnique.h"
39 #include "WPropertyHelper.h"
41 #include "WPropertyGroupBase.h"
82 return ( prop1->getName() == prop2->getName() );
87 boost::shared_ptr< WPropertyBase > result = boost::shared_ptr< WPropertyBase >();
93 for( PropertyContainerType::const_iterator it = l->get().begin(); it != l->get().end(); ++it )
95 if( ( *it )->getName() == name )
108 boost::shared_ptr< WPropertyBase > result = boost::shared_ptr< WPropertyBase >();
111 typedef boost::tokenizer<boost::char_separator< char > > tokenizer;
113 tokenizer tok( name, sep );
117 for( tokenizer::iterator it = tok.begin(); it != tok.end(); ++it )
123 return boost::shared_ptr< WPropertyBase >();
131 return boost::shared_ptr< WPropertyBase >();
156 propName = pathPrefix + ( *it )->getName();
159 if( pathPrefix.empty() )
161 propName = ( *it )->getName();
169 g->visitAsString( visitor, propName );
174 std::string value = ( *it )->getAsString();
175 visitor( propName, value );
182 return (
findProperty( name ) != boost::shared_ptr< WPropertyBase >() );
187 boost::shared_ptr< WPropertyBase > p =
findProperty( name );
188 if( p == boost::shared_ptr< WPropertyBase >() )
190 throw WPropertyUnknown( std::string(
"Property \"" + name +
"\" can't be found." ) );
204 if( std::count_if( l->get().begin(), l->get().end(),
213 throw WPropertyNotUnique( std::string(
"Property \"" + prop->getName() +
"\" is not unique in this group (\"" +
getName() +
"\")." ) );
217 throw WPropertyNotUnique( std::string(
"Property \"" + prop->getName() +
"\" is not unique in this group (unnamed root)." ) );
224 prop->setPurpose( PV_PURPOSE_INFORMATION );
228 l->get().push_back( prop );