generated from jnooree/c-like-templ
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
26,689 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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_ */ |
Oops, something went wrong.