Correlation 4.10.0
An Analysis Tool for Liquids and for Amorphous Solids
Loading...
Searching...
No Matches
FileReader.cpp File Reference

Implementation of the unified file reader. More...

#include "readers/FileReader.hpp"
#include "core/MappedFile.hpp"
#include "readers/NaturalSort.hpp"
#include "readers/ReaderFactory.hpp"
#include <algorithm>
#include <filesystem>
#include <fstream>
#include <stdexcept>
#include <utility>
Include dependency graph for FileReader.cpp:

Namespaces

namespace  correlation
namespace  correlation::readers

Functions

FileType correlation::readers::determineFileType (const std::string &filename)
 Determines the FileType from a given filename extension.
correlation::core::Cell correlation::readers::readStructure (const std::string &filename, FileType type, const ProgressCallback &progress_callback=nullptr)
 Reads an atomic structure from a file.
correlation::core::Trajectory correlation::readers::readTrajectory (const std::string &filename, FileType type, const ProgressCallback &progress_callback=nullptr)
 Reads a trajectory from a file.
correlation::core::Trajectory correlation::readers::readTrajectory (const std::vector< std::string > &filenames, FileType type=FileType::Unknown, const ProgressCallback &progress_callback=nullptr)
 Reads a trajectory concatenated across multiple files.
std::expected< correlation::core::Cell, std::string > correlation::readers::readStructureExpected (const std::string &filename, FileType type=FileType::Unknown, const ProgressCallback &progress_callback=nullptr)
 Reads a structure from the given file, returning Cell or diagnostic error string.
std::expected< correlation::core::Trajectory, std::string > correlation::readers::readTrajectoryExpected (const std::string &filename, FileType type=FileType::Unknown, const ProgressCallback &progress_callback=nullptr)
 Reads a trajectory from the given file, returning Trajectory or diagnostic error string.
std::expected< correlation::core::Trajectory, std::string > correlation::readers::readTrajectoryExpected (const std::vector< std::string > &filenames, FileType type=FileType::Unknown, const ProgressCallback &progress_callback=nullptr)
 Reads a trajectory from multiple files, returning Trajectory or diagnostic error string.

Detailed Description

Implementation of the unified file reader.

License
SPDX-License-Identifier: AGPL-3.0-only