//---------------------------------------------------------------------------------------------------------------------- void FileList::load(const std::string & _fname) { std::ifstream input; std::string line; input.open(_fname); if(!input.is_open()) { std::cerr<<"Problem Opening File"<<_fname<<"\n"; exit(EXIT_FAILURE); } while(!input.eof()) { input>>line; if(trim(line)=="HIERARCHY") loadStructure(input); break; } input.close(); Node temp; }
void CTownHandler::loadStructures(CTown &town, const JsonNode & source) { BOOST_FOREACH(const JsonNode &node, source.Vector()) { loadStructure(town, node); } }
DocumentStructure(Index & index, const indri::utility::greedy_vector<indri::index::FieldExtent> & fields) : _index( &index ) , _numNodes( 0 ), _nodes( ), _childrenBuff( ) { loadStructure(fields); }
void CTownHandler::loadStructures(CTown &town, const JsonNode & source) { if (source.getType() == JsonNode::DATA_VECTOR) { for(auto &node : source.Vector()) { if (!node.isNull()) loadStructure(town, node); } } else { for(auto &node : source.Struct()) { if (!node.second.isNull()) loadStructure(town, node.second); } } }