storage::compound_metadata_list* CSVHeader::load(const Loader::params& args) { csv::params p(_parameters.getCSVParams()); p.setLineCount(4); try { std::vector<line_t> lines(csv::parse_file(args.getBasePath() + _filename, p)); return createMetadata(lines); } catch (std::runtime_error& e) { throw Loader::Error(e.what()); } }
IndexSync::IndexSync(FB::BrowserHost host, ObjectStoreSync& objectStore, TransactionFactory& transactionFactory, Metadata& metadata, const string& name, const optional<string>& keyPath, const bool unique) : Index(name, objectStore.getName(), keyPath, unique), transactionFactory(transactionFactory), host(host), metadata(metadata, Metadata::Index, name), keyGenerator(keyPath.is_initialized() ? new Support::KeyPathKeyGenerator(host, keyPath.get()) : NULL), implementation(keyPath.is_initialized() ? Implementation::AbstractDatabaseFactory::getInstance().createIndex( objectStore.getImplementation(), name, keyGenerator, unique, transactionFactory.getTransactionContext()) : Implementation::AbstractDatabaseFactory::getInstance().createIndex( objectStore.getImplementation(), name, unique, transactionFactory.getTransactionContext())) { createMetadata(keyPath, unique); initializeMethods(); }