18 #include "boost/bind.hpp"
37 std::cout <<
"[TODO] error FileManagerServiceBase::canLoadDataType not implemented yet." << std::endl;
38 return QString(
"TODO");
45 return reader->canRead(type, filename);
54 return reader->read(uid, filename);
61 for (std::set<FileReaderWriterServicePtr>::iterator iter = mDataReaders.begin(); iter != mDataReaders.end(); ++iter)
63 if ((*iter)->canRead(type, path))
72 for (std::set<FileReaderWriterServicePtr>::iterator iter = mDataReaders.begin(); iter != mDataReaders.end(); ++iter)
74 if ((*iter)->canWrite(type, path))
86 retval = reader->loadVtkImageData(filename);
95 return reader->loadVtkPolyData(filename);
101 std::vector<FileReaderWriterServicePtr> retval;
102 for (std::set<FileReaderWriterServicePtr>::iterator iter = mDataReaders.begin(); iter != mDataReaders.end(); ++iter)
104 if (dataType.compare((*iter)->canWriteDataType()) == 0)
105 retval.push_back(*iter);
113 std::vector<FileReaderWriterServicePtr> retval;
114 for (std::set<FileReaderWriterServicePtr>::iterator iter = mDataReaders.begin(); iter != mDataReaders.end(); ++iter)
116 if (dataType.compare((*iter)->canReadDataType()) == 0)
117 retval.push_back(*iter);
128 return reader->canReadDataType();
129 CX_LOG_WARNING() <<
"FileManagerServiceBase::findDataTypeFromFile: Cannot find a file reader";
135 bool success =
false;
138 success = reader->readInto(data, path);
152 std::vector<DataPtr> retval;
155 retval = reader->read(filename);
163 return writer->write(data, filename);
172 CX_LOG_DEBUG() <<
"Adding a reader/writer: " << service->objectName() <<
" to: " <<
this;
177 for(std::set<FileReaderWriterServicePtr>::iterator it = mDataReaders.begin(); it != mDataReaders.end(); )
179 if (service->
getName() == (*it)->getName())
181 mDataReaders.erase(it++);
192 return reader->getName();