Gemmi C++ API
Loading...
Searching...
No Matches
Namespaces | Macros | Functions
cif.hpp File Reference

CIF parser (based on PEGTL) with pluggable actions, and a set of actions that prepare Document. To just read the CIF format, include read_cif. hpp instead. More...

#include <cassert>
#include <cstdio>
#include <iosfwd>
#include <string>
#include "third_party/tao/pegtl.hpp"
#include "cifdoc.hpp"
#include "fileutil.hpp"

Go to the source code of this file.

Namespaces

namespace  gemmi
 
namespace  gemmi::cif
 

Macros

#define error_msg(rule, msg)
 
#define GEMMI_CIF_FILE_INPUT(in, path)    tao::pegtl::file_input<> in(path)
 

Functions

template<typename Rule >
const std::string & gemmi::cif::error_message ()
 
template<typename Input >
void gemmi::cif::parse_input (Document &d, Input &&in)
 
template<typename Input >
Document gemmi::cif::read_input (Input &&in, int check_level=1)
 
template<typename Input >
size_t gemmi::cif::parse_one_block (Document &d, Input &&in)
 
Document gemmi::cif::read_file (const std::string &filename, int check_level=1)
 
Document gemmi::cif::read_memory (const char *data, size_t size, const char *name, int check_level=1)
 
Document gemmi::cif::read_cstream (std::FILE *f, size_t bufsize, const char *name, int check_level=1)
 
Document gemmi::cif::read_istream (std::istream &is, size_t bufsize, const char *name, int check_level=1)
 
template<typename Input >
bool gemmi::cif::try_parse (Input &&in, std::string *msg)
 
template<typename T >
Document gemmi::cif::read (T &&input, int check_level=1)
 
template<typename T >
bool gemmi::cif::check_syntax (T &&input, std::string *msg)
 
template<typename T >
size_t gemmi::cif::read_one_block (Document &d, T &&input, size_t limit)
 

Detailed Description

CIF parser (based on PEGTL) with pluggable actions, and a set of actions that prepare Document. To just read the CIF format, include read_cif. hpp instead.

Definition in file cif.hpp.

Macro Definition Documentation

◆ error_msg

#define error_msg (   rule,
  msg 
)
Value:
template<> inline const std::string& error_message<rule>() { \
static const std::string s = msg; \
return s; \
}

Definition at line 155 of file cif.hpp.

◆ GEMMI_CIF_FILE_INPUT

#define GEMMI_CIF_FILE_INPUT (   in,
  path 
)     tao::pegtl::file_input<> in(path)

Definition at line 301 of file cif.hpp.