STORMM Source Documentation
Loading...
Searching...
No Matches
file_util.h
1// -*-c++-*-
2#ifndef STORMM_FILE_UTIL_H
3#define STORMM_FILE_UTIL_H
4
5#include <fstream>
6#include <iostream>
7#include <string>
8#include "copyright.h"
9#include "Constants/behavior.h"
10#include "Parsing/textfile.h"
11#include "Topology/atomgraph_enumerators.h"
12#include "Trajectory/trajectory_enumerators.h"
13#include "file_enumerators.h"
14
15namespace stormm {
16namespace diskutil {
17
18using constants::ExceptionResponse;
19using parse::TextFile;
20using topology::TopologyKind;
21using trajectory::CoordinateFileKind;
22
23const char default_amber_crd_extension[] = "crd";
24const char default_amber_inpcrd_extension[] = "inpcrd";
25const char default_amber_ascii_rst_extension[] = "rst";
26const char default_amber_netcdf_extension[] = "cdf";
27const char default_amber_netcdf_rst_extension[] = "rcdf";
28const char default_sd_file_extension[] = "sdf";
29const char default_pdb_file_extension[] = "pdb";
30
38std::ofstream openOutputFile(const std::string &filename,
39 PrintSituation expectation = PrintSituation::OPEN_NEW,
40 const std::string &description = std::string(""),
41 DataFormat style = DataFormat::ASCII);
42
48int removeFile(const std::string &filename, ExceptionResponse policy = ExceptionResponse::WARN);
49
54DataFormat getTrajectoryFormat(CoordinateFileKind cfkind);
55
62TextFile readFileSample(const std::string &file_name, const std::string &caller,
63 const size_t nchar);
64
75CoordinateFileKind detectCoordinateFileKind(const TextFile &tf);
76
77CoordinateFileKind detectCoordinateFileKind(const std::string &file_name,
78 const std::string &caller = std::string(""));
80
85TopologyKind detectTopologyKind(const TextFile &tf);
86
87TopologyKind detectTopologyKind(const std::string &file_name,
88 const std::string &caller = std::string(""));
90
91
95std::string getDefaultFileExtension(CoordinateFileKind kind);
96
104CoordinateFileKind inferCoordinateFileKind(const std::string &file_name);
105
118std::string assembleFilePath(const std::string &root_path, const std::string &base_path,
119 const std::string &extn);
120
121} // namespace diskutil
122} // namespace stormm
123
124#endif
Structure for translating a text file into a compact, rapidly parsable vector of characters in CPU RA...
Definition textfile.h:45