#include <jsondataframereader.h>
|
|
| JSONDataFrameReader (const JSONDataFrameReader &)=default |
|
| JSONDataFrameReader (JSONDataFrameReader &&) noexcept=default |
|
JSONDataFrameReader & | operator= (const JSONDataFrameReader &)=default |
|
JSONDataFrameReader & | operator= (JSONDataFrameReader &&) noexcept=default |
| virtual JSONDataFrameReader * | clone () const override |
| virtual std::shared_ptr< DataFrame > | readData (const std::filesystem::path &fileName) override |
| std::shared_ptr< DataFrame > | readData (std::istream &stream) const |
|
DataReaderType & | operator= (const DataReaderType &that)=default |
|
| DataReader (const DataReader &rhs)=default |
|
| DataReader (DataReader &&rhs) noexcept=default |
|
DataReader & | operator= (const DataReader &that)=default |
|
DataReader & | operator= (DataReader &&that) noexcept=default |
|
const std::vector< FileExtension > & | getExtensions () const |
|
void | addExtension (FileExtension ext) |
| virtual bool | setOption (std::string_view key, std::any value) |
| | Set reader specific options See the documentation of the specific reader for the available options.
|
| virtual std::any | getOption (std::string_view key) |
| | Query the value of an reader specific option.
|
|
template<typename T> |
| bool | readsType () const |
|
| virtual bool | canRead (const std::type_index &index) const override |
| static void | checkExists (const std::filesystem::path &path) |
| static std::ifstream | open (const std::filesystem::path &path, std::ios_base::openmode mode=std::ios_base::in) |
|
static std::ifstream | openAndCacheIfUrl (const std::filesystem::path &path, std::ios_base::openmode mode=std::ios_base::in) |
|
static std::filesystem::path | downloadAndCacheIfUrl (const std::filesystem::path &url) |
| static std::string | readFileContents (const std::filesystem::path &path) |
|
std::vector< FileExtension > | extensions_ |
Reads a json file into DataFrame Expects object layout: [ {"Col1": val11, "Col2": val12 }, {"Col1": val21, "Col2": val22 } ] The example above contains two rows and two columns.
◆ clone()
| virtual JSONDataFrameReader * inviwo::JSONDataFrameReader::clone |
( |
| ) |
const |
|
overridevirtual |
◆ readData() [1/2]
| virtual std::shared_ptr< DataFrame > inviwo::JSONDataFrameReader::readData |
( |
const std::filesystem::path & | fileName | ) |
|
|
overridevirtual |
read a JSON file from a file Expects object layout: [ {"Col1": val11, "Col2": val12 }, {"Col1": val21, "Col2": val22 } ] The example above contains two rows and two columns.
- Parameters
-
| fileName | name of the input file |
- Returns
- a DataFrame containing the JSON data
- Exceptions
-
Implements inviwo::DataReaderType< DataFrame >.
◆ readData() [2/2]
| std::shared_ptr< DataFrame > inviwo::JSONDataFrameReader::readData |
( |
std::istream & | stream | ) |
const |
read DataFrame from a JSON-encoded input stream, e.g. a std::ifstream. In case file streams are used, the file must have be opened prior calling this function. Expects object layout: [ {"Col1": val11, "Col2": val12 }, {"Col1": val21, "Col2": val22 } ] The example above contains two rows and two columns.
- Parameters
-
| stream | input stream with the json data |
- Returns
- a DataFrame containing the data
The documentation for this class was generated from the following file: