#include <ExtractStringFromDDD.h>
Static Public Member Functions | |
static std::string | getString (std::string const &, DDFilteredView *) |
Helper function to extract a string from a SpecPar; only returns the first one and complains if more than 1 is found.
Definition at line 14 of file ExtractStringFromDDD.h.
std::string ExtractStringFromDDD::getString | ( | std::string const & | s, |
DDFilteredView * | fv | ||
) | [static] |
Definition at line 9 of file ExtractStringFromDDD.cc.
References DDfetch(), Exception, query::result, DDFilteredView::specificsV(), DDValue::strings(), and groupFilesInBlocks::temp.
Referenced by CmsTrackerPetalBuilder::buildComponent(), CmsTrackerBuilder::buildComponent(), CmsTrackerWheelBuilder::buildComponent(), CmsTrackerSubStrctBuilder::buildComponent(), CmsTrackerLayerBuilder::buildComponent(), CmsDetConstruction::buildComponent(), CmsTrackerDiskBuilder::buildComponent(), CmsTrackerPanelBuilder::buildComponent(), CmsDetConstruction::buildSmallDets(), DDDCmsTrackerContruction::construct(), and CmsTrackerRingBuilder::sortNS().
{ DDValue val(s); std::vector<const DDsvalues_type *> result; fv->specificsV(result); std::vector<const DDsvalues_type *>::iterator it = result.begin(); bool foundIt = false; for (; it != result.end(); ++it) { foundIt = DDfetch(*it,val); if (foundIt) break; } if (foundIt) { std::vector<std::string> const & temp = val.strings(); if (temp.size() != 1) { throw cms::Exception("Configuration")<< " ERROR: I need 1 "<< s << " tags"; } return temp[0]; } return "NotFound"; }