21Suite::Suite( std::string
const &a_keyName ) :
23 m_keyName( a_keyName ) {
32Suite::Suite( std::string
const &a_moniker, std::string
const &a_keyName ) :
34 m_keyName( a_keyName ) {
46 m_keyName( a_keyName ) {
48 parse( a_node, a_parseSuite );
56 for( std::vector<Entry *>::const_iterator iter = m_entries.begin( ); iter < m_entries.end( ); ++iter )
delete *iter;
69 Entry *form = a_parseSuite(
this, child );
70 if( form !=
nullptr )
add( form );
82 auto const iter = m_map.find( a_keyValue );
83 if( iter == m_map.end( ) ) {
87 return( iter->second );
100 for(
Suite::iterator iter = m_entries.begin( ); iter != m_entries.end( ); ++iter, ++i1 ) {
101 if( (*iter)->keyValue( ) == a_form->
keyValue( ) ) {
102 m_entries[i1] = a_form;
107 m_map[a_form->
keyValue( )] = m_entries.size( );
108 m_entries.push_back( a_form );
122 for(
Suite::iterator iter = m_entries.begin( ); iter != m_entries.end( ); ++iter ) {
123 if( (*iter)->keyName( ) == a_keyValue )
return( iter );
126 return( m_entries.end( ) );
140 if( (*iter)->keyValue( ) == a_keyValue )
return( iter );
143 return( m_entries.end( ) );
156 std::vector<Suite::iterator> iters;
158 for(
Suite::iterator iter = m_entries.begin( ); iter != m_entries.end( ); ++iter ) {
159 if( (*iter)->moniker( ) == a_moniker ) iters.push_back( iter );
175 std::vector<Suite::const_iterator> iters;
178 if( (*iter)->moniker( ) == a_moniker ) iters.push_back( iter );
193 std::size_t index( a_item.find(
'=' ) ), lastQuote = a_item.size( ) - 2;
195 if( index == std::string::npos )
return(
nullptr );
197 if( index > lastQuote )
throw LUPI::Exception(
"Suite::findInAncestry3: invalide xlink" );
198 if( a_item[index] !=
'\'' )
throw LUPI::Exception(
"Suite::findInAncestry3: invalid xlink, missing '." );
200 if( a_item[lastQuote] !=
'\'' )
throw LUPI::Exception(
"Suite::findInAncestry3: invalid xlink, missing endl '." );
202 std::string keyValue( a_item.substr( index, lastQuote - index ) );
216 std::size_t index( a_item.find(
'=' ) ), lastQuote = a_item.size( ) - 2;
218 if( index == std::string::npos )
return(
nullptr );
220 if( index > lastQuote )
throw LUPI::Exception(
"Suite::findInAncestry3: invalide xlink" );
221 if( a_item[index] !=
'\'' )
throw LUPI::Exception(
"Suite::findInAncestry3: invalid xlink, missing '." );
223 if( a_item[lastQuote] !=
'\'' )
throw LUPI::Exception(
"Suite::findInAncestry3: invalid xlink, missing endl '." );
225 std::string keyValue( a_item.substr( index, lastQuote - index ) );
241 if(
size( ) == 0 )
return;
243 std::string XMLLine( a_indent +
"<" +
moniker( ) +
">" );
246 for(
Suite::const_iterator iter = m_entries.begin( ); iter != m_entries.end( ); ++iter ) (*iter)->toXMLList( a_writeInfo, indent2 );
259 std::cout << a_header <<
": size = " <<
size( ) << std::endl;
262 std::cout <<
" " << (*iter)->keyValue( ) << std::endl;
void setAncestor(Ancestry *a_ancestor)
std::string const & moniker() const
Ancestry(std::string const &a_moniker, std::string const &a_attribute="")
std::string const & keyValue() const
T * get(std::size_t a_Index)
Entries::iterator iterator
void printEntryLabels(std::string const &a_header) const
void toXMLList(WriteInfo &a_writeInfo, std::string const &a_indent="") const
iterator find(std::string const &a_label)
std::vector< iterator > findAllOfMoniker(std::string const &a_moniker)
Entries::const_iterator const_iterator
void parse(HAPI::Node const &a_node, GUPI_parseSuite a_parseSuite)
Ancestry * findInAncestry3(std::string const &a_item)
std::size_t operator[](std::string const &a_label) const
void push_back(std::string const &a_line)
void addNodeEnder(std::string const &a_moniker)
std::string incrementalIndent(std::string const &indent)
Entry *(* GUPI_parseSuite)(Suite *a_parent, HAPI::Node const &a_node)