Skip to content

Commit

Permalink
save
Browse files Browse the repository at this point in the history
  • Loading branch information
jnooree committed Dec 11, 2023
1 parent d2ec0a3 commit d60ecfe
Show file tree
Hide file tree
Showing 7 changed files with 26,689 additions and 0 deletions.
43 changes: 43 additions & 0 deletions include/nuri/fmt/pdb.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
//
// Project nurikit - Copyright 2023 SNU Compbio Lab.
// SPDX-License-Identifier: Apache-2.0
//

#ifndef NURI_FMT_PDB_H_
#define NURI_FMT_PDB_H_

#include <string>
#include <vector>

#include <absl/base/attributes.h>

#include "nuri/core/molecule.h"
#include "nuri/fmt/base.h"

namespace nuri {
/**
* @brief Read a single PDB string and return a molecule.
*
* @param pdb the PDB string to read.
* @return A molecule. On failure, the returned molecule is empty.
*/
extern Molecule read_pdb(const std::vector<std::string> &pdb);

class PDBReader: public DefaultReaderImpl<read_pdb> {
public:
using DefaultReaderImpl<read_pdb>::DefaultReaderImpl;

bool getnext(std::vector<std::string> &block) override;

private:
std::vector<std::string> header_;
std::vector<std::string> rfooter_;
};

class PDBReaderFactory: public DefaultReaderFactoryImpl<PDBReader> {
private:
static const bool kRegistered ABSL_ATTRIBUTE_UNUSED;
};
} // namespace nuri

#endif /* NURI_FMT_PDB_H_ */
Loading

0 comments on commit d60ecfe

Please sign in to comment.