5#ifndef GEMMI_MMREAD_HPP_
6#define GEMMI_MMREAD_HPP_
31 while (buf < end - 8) {
32 if (std::isspace(*buf)) {
34 }
else if (*buf ==
'#') {
35 while (buf < end - 8 && *buf !=
'\n')
37 }
else if (*buf ==
'{') {
61 const std::string& path,
75 fail(
"wrong format of coordinate file " + path);
80 const std::string& path,
110 fail(
"Unknown format of " +
111 (
input.path().empty() ?
"coordinate file" :
input.path()) +
".");
CIF parser (based on PEGTL) with pluggable actions, and a set of actions that prepare Document....
fail(), unreachable() and __declspec/__attribute__ macros
Reading CIF-JSON (COMCIFS) and mmJSON (PDBj) formats into cif::Document.
Read mmCIF (PDBx/mmCIF) file into a Structure from model. hpp.
Data structures to store macromolecular structure models.
Document read(T &&input, int check_level=1)
Document read_mmjson(T &&input)
GEMMI_DLL Document read_mmjson_insitu(char *buffer, std::size_t size, const std::string &name="mmJSON")
Document read_memory(const char *data, size_t size, const char *name, int check_level=1)
CharArray read_into_buffer(T &&input)
Structure make_structure_from_chemcomp_block(const cif::Block &block, int which=7)
Structure read_structure_from_char_array(char *data, size_t size, const std::string &path, cif::Document *save_doc=nullptr)
Structure read_structure(T &&input, CoorFormat format=CoorFormat::Unknown, cif::Document *save_doc=nullptr)
CoorFormat coor_format_from_content(const char *buf, const char *end)
Structure make_structure_from_doc(cif::Document &&doc, bool possible_chemcomp, cif::Document *save_doc=nullptr)
Structure read_pdb(T &&input, PdbReadOptions options={})
Structure make_structure(cif::Document &&doc, cif::Document *save_doc=nullptr)
structure from a coordinate mmCIF document
int check_chemcomp_block_number(const cif::Document &doc)
CoorFormat coor_format_from_ext(const std::string &path)
CoorFormat
File format of a macromolecular model.
bool iends_with(const std::string &str, const std::string &suffix)
Structure read_pdb_from_memory(const char *data, size_t size, const std::string &name, PdbReadOptions options={})
Structure read_structure_file(const std::string &path, CoorFormat format=CoorFormat::Unknown)
Structure read_structure_from_memory(char *data, size_t size, const std::string &path, CoorFormat format=CoorFormat::Unknown, cif::Document *save_doc=nullptr)
void fail(const std::string &msg)
constexpr int ialpha4_id(const char *s)
Structure make_structure_from_chemcomp_doc(const cif::Document &doc, cif::Document *save_doc=nullptr, int which=7)
Read the PDB file format and store it in Structure.
Utilities. Mostly for working with strings and vectors.