Gemmi C++ API
Loading...
Searching...
No Matches
read_cif.hpp
Go to the documentation of this file.
1// Copyright 2021 Global Phasing Ltd.
2//
3// Functions for reading possibly gzipped CIF files.
4// Trivial wrappers that can make compilation faster
5// by having a separate implementation file src/read_cif.cpp.
6
7#ifndef GEMMI_READ_CIF_HPP_
8#define GEMMI_READ_CIF_HPP_
9
10#include "cifdoc.hpp" // for Document
11#include "input.hpp" // for CharArray
12
13namespace gemmi {
14
15GEMMI_DLL cif::Document read_cif_gz(const std::string& path);
16GEMMI_DLL cif::Document read_mmjson_gz(const std::string& path);
17GEMMI_DLL CharArray read_into_buffer_gz(const std::string& path);
19GEMMI_DLL cif::Document read_first_block_gz(const std::string& path, size_t limit);
20
21inline cif::Document read_cif_or_mmjson_gz(const std::string& path) {
22 if (giends_with(path, "json") || giends_with(path, "js"))
23 return read_mmjson_gz(path);
24 return read_cif_gz(path);
25}
26
27} // namespace gemmi
28
29#endif
#define GEMMI_DLL
Definition fail.hpp:53
GEMMI_DLL cif::Document read_first_block_gz(const std::string &path, size_t limit)
GEMMI_DLL cif::Document read_cif_gz(const std::string &path)
GEMMI_DLL cif::Document read_mmjson_gz(const std::string &path)
bool giends_with(const std::string &str, const std::string &suffix)
Definition util.hpp:105
GEMMI_DLL CharArray read_into_buffer_gz(const std::string &path)
GEMMI_DLL cif::Document read_cif_from_buffer(const CharArray &buffer, const char *name)
cif::Document read_cif_or_mmjson_gz(const std::string &path)
Definition read_cif.hpp:21