Open a file to extract. \param filename Filename. \return -1 if a stream is already assigned, 0 otherwise. */
| 96 | \return -1 if a stream is already assigned, 0 otherwise. |
| 97 | */ |
| 98 | PDAL_EXPORT int open(const std::string& filename) |
| 99 | { |
| 100 | if (m_stream) |
| 101 | return -1; |
| 102 | |
| 103 | m_stream = FileUtils::openFile(filename); |
| 104 | m_fstream = dynamic_cast<std::ifstream*>(m_stream); |
| 105 | return 0; |
| 106 | } |
| 107 | |
| 108 | /** |
| 109 | Close the underlying stream. |